I thought I’d take a closer look at CJ’s new Javascript affiliate links, with a view to seeing exactly how they work.
With this in mind, I decided to take a detailed look at the Javascript source code that will be presented to a browser when an impression of a link occurs. It’s always worth looking at any third-party Javascript to see what it does, for two reasons:
- You can make sure that your own page is compatible with it.
- You need to do it in order to know that the third-party Javascript is not posing a security risk to your web page.
The source code of the link that I decided to investigate is as follows:
<script type="text/javascript" language="javascript" src="http://www.kqzyfj.com/placeholder-3037?
TARGET=_top&MOUSEOVER=N"></script>
This is how it appears within the document:
The code that is called up by this link is as follows:
document.write("<form name=\"CJ10378406X452\" method=\"POST\" style=\"margin:0px;display:inline\" action=\"http://www.kqzyfj.com/click\">\r\n…
<input type=\"hidden\" name=\"AID\" value=\"10378406\"/>\r\n…
<input type=\"hidden\" name=\"PID\" value=\"1853467\"/>\r\n…
<input type=\"hidden\" name=\"url\" value=\"http://www.godaddy.com/gdshop/default.asp?…
isc=cjcmsc001t\"/>\r\n…
<a href=\"javascript:CJ10378406X452.submit();\">…
www.GoDaddy.com </a>\r\n…
</form>\r\n…
<img src=\"http://www.kqzyfj.com/image-1853467-10378406\" width=\"1\" height=\"1\" border=\"0\"/>");
Note that the above code has been broken at various points for display purposes, and an ellipsis is shown at points where a line break cannot occur due to a lack of spaces. These line breaks do not occur in the actual source code.
This code is equivalent to writing the following non-Javascript directly within the document:
<form name="CJ10378406X452" method="POST" style="margin:0px;display:inline" action="http://www.kqzyfj.com/click">
<input type="hidden" name="AID" value="10378406"/>
<input type="hidden" name="PID" value="1853467"/>
<input type="hidden" name="url" value="http://www.godaddy.com/gdshop/default.asp?…
isc=cjcmsc001t"/>
<a href="javascript:CJ10378406X452.submit();">…
www.GoDaddy.com </a>
</form>
<img src="http://www.kqzyfj.com/image-1853467-10378406" width="1" height="1" border="0"/>
Note that when I first looked at this source code, I distinctly remember it being quite different in structure. The source code should not be regarded as static; it could change at any time in any way.
The first thing to note is the form name. I refreshed the browser, and I saw that the form name had changed from CJ10378406X452 to CJ10378406X520, and so had the corresponding code in the hyperlink. I suspect that the last three digits are random, and the purpose of these random digits is to ensure that every impression of the link has its own specific form. I believe this is necessary for the links to function where multiple impressions of the same link occur on the same webpage.
Other than that, the form fields are as follows: AID is the advertiser’s identifier, i.e. the identifier of the merchant. PID is the publisher’s identifier. The url field specifies the destination landing page.
The image is used for impression-tracking, as is the case with legacy links.
The coding of the hyperlink element <a> is giving the hyperlinked text the property that when clicking on it, the form will be submitted. It’s similar to using the code <input type="submit" value="www.GoDaddy.com">, except for the fact that the hyperlink is rendered as a text link as opposed to a button.
I think the main reason that merchants might want the Javascript links to be used is that it gives them greater control over the links. Certain merchants, such as eBay, are not using Javascript links, and are sticking with legacy links. Generally speaking, new Javascript links will be slower to load than legacy links, because the browser has to open a TCP connection to obtain the Javascript code in addition to the impression-tracking image. If page loading times represent a significant factor for you, the use of legacy links will improve the situation. If you’re not worried about counting impressions with CJ’s interface, the use of keyword links would improve the loading time still further, especially where you use images on your pages.
If you’re using AdWords to direct traffic to landing pages and you have been hit by Google’s new quality scoring algorithm for landing pages, it may be worth trying the Javascript links, as it may be more difficult for robots to explicitly identify them as affiliate links.
Finally, it is important to note that browsers will usually not be able to bookmark this type of link. If you suggest to your users that they might wish to bookmark a link directly, the new Javascript links won’t function for this purpose, and you will have to rely on legacy links. While testing in Firefox, I found that I could bookmark the link, but that the bookmark did not function.
David Thomas, The Affiliate Marketer