Ok so here we go.
Step 1 - Get your code from Ebay Partner Network
Looks like this
<script language='JavaScript1.1'> document.write("<sc"+"ript language='JavaScript1.1' src='http://rover.ebay.com/ar/1/55956/1?campid=5335857286&toolid=55956&customid=&mpt=" + Math.floor(Math.random()*999999999999) + "&adtype=3&size=468x60&def=u7v&n3y=1&u7v=1&a3h=1&mpvc='></sc"+"ript>");</script><noscript> <a href='http://rover.ebay.com/rover/1/710-53481-19255-7/1?campid=5335857286&toolid=55956&customid=&def=u7v&n3y=1&u7v=1&a3h=1&mpvc='> <img border='0px' src='http://rover.ebay.com/ar/1/710-53481-19255-7/1?campid=5335857286&toolid=55956&customid=&mpt=[CACHEBUSTER]&adtype=1&size=468x60&def=u7v&n3y=1&u7v=1&a3h=1&mpvc=' alt='Click Here'> </a></noscript>
Step 2 - Remove what we dont want
Ok firstly let me explain Ebay gives you a bunch of code that works for browsers that support JavaScript and for browsers that dont' support JavaScript or have it disabled.
So the bit we are only interested in really is the bit before the <noscript> section or in other words the bit that looks like.
<script language='JavaScript1.1'> document.write("<sc"+"ript language='JavaScript1.1' src='http://rover.ebay.com/ar/1/55956/1?campid=5335857286&toolid=55956&customid=&mpt=" + Math.floor(Math.random()*999999999999) + "&adtype=3&size=468x60&def=u7v&n3y=1&u7v=1&a3h=1&mpvc='></sc"+"ript>");</script>
A small word of warning you need the <noscript> section when you post your code to blogger, unless you do not want to cover non JavaScript browsers with your advert. So just cut this bit out and paste in into a text editor for later use.
So cut out the bit that looks like
<noscript> <a href='http://rover.ebay.com/rover/1/710-53481-19255-7/1?campid=5335857286&toolid=55956&customid=&def=u7v&n3y=1&u7v=1&a3h=1&mpvc='> <img border='0px' src='http://rover.ebay.com/ar/1/710-53481-19255-7/1?campid=5335857286&toolid=55956&customid=&mpt=[CACHEBUSTER]&adtype=1&size=468x60&def=u7v&n3y=1&u7v=1&a3h=1&mpvc=' alt='Click Here'> </a></noscript>
WE NEED THIS LATER SO KEEP IT SAFE
Step 3 - Breaking it apart
- Remove the <script lanuage='JavaScript1.1'>
- Remove the </script>
You should now be left with a JavaScript statement without the code enclosure, in other words something that looks like
document.write("<sc"+"ript language='JavaScript1.1' src='http://rover.ebay.com/ar/1/55956/1?campid=5335857286&toolid=55956&customid=&mpt=" + Math.floor(Math.random()*999999999999) + "&adtype=3&size=468x60&def=u7v&n3y=1&u7v=1&a3h=1&mpvc='></sc"+"ript>");
Ok now remove the following bits
- document.write("<sc"+"ript language="JavaScript1.1" src='
- '></SC"+"RIPT>");
You should now be left with something that looks likes the following
http://rover.ebay.com/ar/1/55956/1?campid=5335857286&toolid=55956&customid=&mpt=" + Math.floor(Math.random()*999999999999) + "&adtype=3&size=468x60&def=u7v&n3y=1&u7v=1&a3h=1&mpvc=
As you can guess this is the basic link to Ebay for our product. Copy and paste this link into a blank notepad document or into another text editor or development program.
WE NEED THIS LATER SO KEEP IT SAFE
Step 4 - Rebuilding what we want
Now we have the basic link for the link to ebay we need to assemble this into something that will work in Blogger.
Its a good idea to start building the new link from scratch either in your web development program or in notepad.
For this example we are going to start with a blank notepad document.
In your blank document
- Type <script language="JavaScript1.1"> press enter/return
- Type document.write(unescape("%3Cscript src='
- Paste directly after this the link you save earlier in step 3i.e http://rover.ebay.com/ar/1/55956/1?campid=5335857286&toolid=55956&customid=&mpt=" + Math.floor(Math.random()*999999999999) + "&adtype=3&size=468x60&def=u7v&n3y=1&u7v=1&a3h=1&mpvc=
- Type ' type='text/javascript'%3E%3C/script%3E")); press return/enter
- Type </script> press return/enter
- Paste the <noscript> section we saved in step 2
You now should have code in your document that looks like
<script language="JavaScript1.1">
document.write(unescape("%3Cscript src='http://rover.ebay.com/ar/1/55956/1?campid=5335857286&toolid=55956&customid=&mpt=" + Math.floor(Math.random()*999999999999) + "&adtype=3&size=468x60&def=u7v&n3y=1&u7v=1&a3h=1&mpvc=' type='text/javascript'%3E%3C/script%3E"));
</script>
<noscript> <a href='http://rover.ebay.com/rover/1/710-53481-19255-7/1?campid=5335857286&toolid=55956&customid=&def=u7v&n3y=1&u7v=1&a3h=1&mpvc='> <img border='0px' src='http://rover.ebay.com/ar/1/710-53481-19255-7/1?campid=5335857286&toolid=55956&customid=&mpt=[CACHEBUSTER]&adtype=1&size=468x60&def=u7v&n3y=1&u7v=1&a3h=1&mpvc=' alt='Click Here'> </a></noscript>
Step 5 - Adding it to Blogger
Now we have the code we need for our advert we simply login to our blogger dashboard and do the following
- Click Layout Tab
- Click the Page Element tab - if you dont see this you need to click to customise your template.
- Click add page element where you want your ad to appear
- In the pop up click the add HTML / JavaScript option
- Paste in your code from above and click save.
Congratulations you now have Ebay Partner Network code working on your website.
Thanks
Sean J Connolly
Visit AJAX Web Development Store
DMS - Document Management, Webmail
BuzzProperties.co.uk - Online Property Sales and Letting