I received this question from a CJ publisher this morning:
I was happy to find your site today and read more about the new CJ affiliate links. I thought I’d start converting last night, but even when checking the option for the link to open in a new window, the JS script did not operate in that manner.
I’ve seen target as a Y/N before in other links, such as RSS feeds (ie. targ=Y) but am not a javascript expert. I’ve tried everything I can think of. Having my visitors STAY at my site is very important. They may never remember where they started otherwise.
Thanks for reading, Joyce. I tested it out and confirmed that it’s true. While the CJ javascript link is has a TARGET=_blank parameter in it, it’s not making it’s way into the final HTML code:
Here’s the javascript code. TARGET=_blank gets added to the Javascript:
<script type="text/javascript" language="javascript" src="http://www.anrdoezrs.net/placeholder-65587?TARGET=_blank&MOUSEOVER=N"></script>
Now, it’s up to CJ to do something with that TARGET=_blank since they’re serving the final HTML that gets displayed on your website. Here’s the HTML that they’re serving for this link:
<form name="CJ1203578X614" method="POST" style="margin:0px;display:inline" action="http://www.anrdoezrs.net/click">
<input type="hidden" name="AID" value="1203578"/>
<input type="hidden" name="PID" value="2057689"/>
<input type="hidden" name="url" value="http://www.zappos.com/bin/zapposset?src=cj&ref=comjun&kw=brands"/>
<a href="javascript:CJ1203578X614.submit();">Get great brand name shoes at Zappos.com!</a>
</form>
<img src="http://www.anrdoezrs.net/image-2057689-1203578" width="1" height="1" border="0"/>
You’ll note that there’s no code in there that will open the page in a new window. There’s nothing that you, the publisher, can do here. This is a problem for CJ to fix.
OK, no big deal, CJ’s got a bug, and I’m sure they’ll fix it (though it will be a little tricky with the JS submission). But more importantly, this illustrates something about Javascript links. If something goes wrong, it’s very difficult to see what’s going on because you cannot view source on the page and see the HTML. Things are not displaying properly, but is it me? or is it CJ? It’s hard to tell.
You can open the javascript directly by calling the url in a browser, but then you get HTML wrapped in Javascript code
How did I get this HTML code that’s getting served? I built a CJ LMI Decoder. Give it a try to see for yourself what’s getting served in your Javascript links.
Thanks to Joyce at PlusSizeNow for this question.
(ask a question and if I use it for a post, with your permission, I’ll link to your website.)
