Wednesday, 23 April 2008

Ebay Affiliates and Blogger



&

Click Here


Click Here





You may experience issues when trying to add your ebay listing from your affiliates account to your blogger blog, this is caused by the way Blogger compiles the elements of the blog at runtime.

To fix this is quite simple.

For example if we have the following code from Ebay

<script language='JavaScript1.1'> document.write("<sc"+"ript language='JavaScript1.1' src='http://rover.ebay.com/ar/1/55972/1?campid=5335857286&toolid=55972&customid=&mpt=" + Math.floor(Math.random()*999999999999) + "&adtype=3&size=728x90&def=u7v&n3y=1&a3h=1&u7v=1&mpvc='></sc"+"ript>");</script><noscript> <a href='http://rover.ebay.com/rover/1/710-53481-19255-15/1?campid=5335857286&toolid=55972&customid=&def=u7v&n3y=1&a3h=1&u7v=1&mpvc='> <img border='0px' src='http://rover.ebay.com/ar/1/710-53481-19255-15/1?campid=5335857286&toolid=55972&customid=&mpt=[CACHEBUSTER]&adtype=1&size=728x90&def=u7v&n3y=1&a3h=1&u7v=1&mpvc=' alt='Click Here'> </a></noscript>

It looks pretty complex, b ut all we need to do is firslty ignore the <noscript> section as thsi will work as it is, in all browsers as there is no complicated stuff going on here.

So the bit we are interested in is the first bit

<script language='JavaScript1.1'> document.write("<sc"+"ript language='JavaScript1.1' src='http://rover.ebay.com/ar/1/55972/1?campid=5335857286&toolid=55972&customid=&mpt=" + Math.floor(Math.random()*999999999999) + "&adtype=3&size=728x90&def=u7v&n3y=1&a3h=1&u7v=1&mpvc='></sc"+"ript>");</script>

The problem blogger encounters is that is cannot encode this into the existing structure, so all we need to do is play around with the JavaScript a bit and turn the above code into the following

<script language='JavaScript1.1'> document.write(unescape("%3Cscript src='http://rover.ebay.com/ar/1/55972/1?campid=5335857286&toolid=55972&customid=&mpt=" + Math.floor(Math.random()*999999999999) + "&adtype=3&size=728x90&def=u7v&n3y=1&a3h=1&u7v=1&mpvc=' type='text/javascript'%3E%3C/script%3E"));</script>

As you can see what we are doing is using a slightly more complex method to do the same job, by using the unescape command we are asking the browser to do the work and not blogger.

So all you need do is replace the necessary parts of your ebay affiliate code with that above and everything should be fine.

If anyone has any problems doing this, just drop me an email and I will show you how.

Happy Ebaying.

Thanks
Sean J Connolly
Visit AJAX Web Development Store







DMS - Document Management, Webmail
BuzzProperties.co.uk - Online Property Sales and Letting




6 comments:

Matt Sun said...

Could you please try to explain this a little more for us dumb a**'s. some of ebays instructions just confuse me more.
Ive tried everything and still cant get it to work.
Thanks for trying to help everyone

Sean J Connolly said...

No problem as all Matt I will post a post with a detailed explanation

Penny Robbins said...

You are a legend! Thank you so much. I was tearing my hair out trying to figure out why the page element wouldn't work in my new blog. Now it works perfectly. Thanks again.

Sean J Connolly said...

No problem at all Penny, if you need any more help just ask.

Take care
Sean

Blogger said...

Hi!
Seems the code has changed now? How can I make my ready to go Ebay widget work with my blogspot blog?

Or are they banned now?

LilyoftheWoods.com blog said...

To fix this simply?? so funny.