Forum Moderators: open

Message Too Old, No Replies

Bad code generator

"do not alter this code"

         

Reid

3:24 am on Feb 9, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I found an affiliate partner company that has some very desirable clients that I need for my site.

This affiliate partner provides a code generator to all the partners with a stern warning not to alter the code in any way (or else you might lose commissions).

So if I want access to these important affiliates I am stuck with this bum code generator. I tried to e-mail the company but get no replies.

I use [w3.org...] validator and this code just spews out dozens of errors for every link this code generator gives me.
There are 3 problems with this code.
1. They use a 1x1 pixel image for tracking purposes with a

NOSAVE
attribute and no
 alt="" 
tag
That's 2 errors. After googling
 NOSAVE 
I find that this is a completely usless tag and should be removed. (There is no problem for me to add an empty
 alt="" 
either)

2.

align="center" 
within an image element.
That's one error.
(options are "top" "middle" "bottom")

I don't know why they did this.

3. Unencoded ampersands.
This accounts for dozens of errors.

Within a URL

0629&siteid=41482307&bfpid=189789344X&bfmtype=

is incorrect.

Should be

0629&siteid=41482307&bfpid=189789344X&bfmtype=

(those id's are bogus)

This is because a browser may misrender these unencoded ampersands as character encoding

&siteid gets confused as &sit;

So my question is should I
A. Find a different validator and leave the code alone?
B. Fix the code. Will this really screw up the tracking?

This validator also hates my google search bar because it fails to recognize a table within a form element. It spews out a string of these:

Line 59, column 75: end tag for element

 "INPUT"
which is not open

 ...s" value="www.ihatecodegenerators.duh"></input> 

Captaffy

4:00 am on Feb 9, 2005 (gmt 0)

10+ Year Member



You should probably just ignore it.
While having perfectly valid markup is laudable, having one section of your code not validate is certainly not the end of the world. And you can rest easy knowing that what YOU wrote is valid.

Of course it will be a pain when you want to check your markup in the future. You'll have to always take out the offending parts, or just ignore the resulting errors.

You could always ask the company responsible to fix their markup, but I doubt they'd do anything.

Orbite

6:33 am on Feb 9, 2005 (gmt 0)

10+ Year Member



Fix the code. Will this really screw up the tracking?

I always fix the code. I even rewrite some code completely to take advantage of CSS positioning instead of table layouts. So long, I have never been punished for it. But, maybe I'm very lucky...

Reid

10:52 am on Feb 9, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well that makes one to fix and one not to fix.
LOL
Thanks anyway.
I ended up fixing the google searchbox by removing the
</input>
tags. (I found out they are unnessecary) The search box still works fine.
I find it funny that google who is so big on valiation would generate invalid code for their search box.
They also used a
</image>
for their logo in the search box which is really wierd and also invalid.

For the affiliate:
The

align= "center"
In the image tag does not bother me to fix because that is simply the image tag for displaying the gif on my page.
What I really need to know (from someone who understands tracking methods) is about this 1x1 pixel image.
Does the
NOSAVE
attribute in this image serve any purpose? Also is an empty alt tag ok or should I put a
&nbsp;
in there? (I know google does not like missing alt tags)
Also the unencoded ampersands within URL's does this affect tracking in any way?

Sanenet

11:12 am on Feb 9, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'd say that you can go ahead and fix it no problems. The only things you can't change (and for that reason I would advocate leaving the ampersands alone) is the url calls to the affiliate servers. Otherwise, get rid of the NOSAVE (I think that that's a browser specific -NN?- tag to say don't cache) and put in an alt with anything you want).

Just make sure that anything you send or call from their server is exactly as they want it, and change the rest.

Reid

11:57 am on Feb 9, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



That pretty much gets down to my basic question.

Query string seperators:
will their server prefer a straight

&
or would it be just as happy with
&amp;
?

This is the biggest problem. Were talking about dozens of invalid messages for each item.

Sanenet

12:03 pm on Feb 9, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



In theory, changing the & to &amp; wouldn't affect their servers. However, I personally wouldn't bother, as I don't like changing anything that calls to a third party server.

At the end of the day, it (currently) really doesn't matter that it's & instead of &amp;.

kaled

7:47 pm on Feb 9, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



&amp; is translated into & by the browser when necessary. Provided you translate & into &amp; correctly, everything should be fine and your code will validate.

Kaled.

Reid

7:12 am on Feb 10, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



thanks kaled that makes me a lot more confident about it.
I'll check back here again to see if there is any more feedback on this.

Sanenet

1:22 pm on Feb 10, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



kaled, good point, of course this image is being called client side rather than server side.

Reid

10:28 pm on Feb 10, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks for the input guys.
After doing my resarch on this topic I came up with a basic rule of thumb for HTML.

&
should be changed to
&amp;

but only within URL's not in the text body itself.
Do a google search on
&amp;
and you'll see why.
Although the browser will automatically translate
&amp;
to
&
even within the text body, Googlebot will not.

kaled

12:59 am on Feb 11, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Ignore googlebot, etc. & should always be encoded as &amp; in body text. In urls, you may also use #26

Kaled.

g1smd

6:49 pm on Feb 15, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Fix all the errors.

The NOSAVE and alt="" are easy to do.

The "& as &amp;" problem should also be fixed. The browser knows what to do with an &amp; in the URL. It puts an & on the screen and sends an & to the remote server.

g1smd

8:43 pm on Feb 15, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Fix all the errors.

The NOSAVE and alt="" and the various "align" things are all easy to do.

The "& as &amp;" problem should also be fixed. The browser knows what to do with an &amp; in the URL. It puts an & on the screen and sends an & to the remote server.

The problem with the closing </input> tag is that the code as given is for XHTML. You don't need that for HTML 4.01 so just delete it. Whoever supplied that code took the "easy" way out "for them". They should have published two versions: one for HTML and one for XHTML and let users choose which one to use.

The warning about not modifying the code I take to mean to not alter the parameters, not alter their values, and to not alter the order that they are supplied in the query string and so on. If the HTML isn't valid, I see no problem in correcting those errors.

Just do it!

Reid

8:16 pm on Mar 5, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



yeah this one affilliate marketing company generates crappy code for all their affiliates and then the affilliates themselves add their portion of the code which is often in need of editing
no image size variables invalid tags etc, what a mess.

Oh well they got some damn good affiliates though, my site is travel related so I need some of these big name affiliates just for the service they provide.

The tracking seems to be working fine (# of impresssions) but I havn't made any sales yet.

I'm going to let it slide for a while (with fixed code) and see what happens.
I found another afilliate marketing company that uses nice clean code generator (other than image sizes declared only in alt) I,m using both of them to see how they fare against each other. The only problem is the crappy code one is the one I prefer but not if my sales don't get tracked.