Wednesday, 7 May 2008

Ebay and Blogger - the Explanation

In this post I am going to explain the steps of turning your ebay Partner Network code into code that works in Blogger.

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='" + Math.floor(Math.random()*999999999999) + "&adtype=3&size=468x60&def=u7v&n3y=1&u7v=1&a3h=1&mpvc='></sc"+"ript>");</script><noscript> <a href=''> <img border='0px' src='[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='" + 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=''> <img border='0px' src='[CACHEBUSTER]&adtype=1&size=468x60&def=u7v&n3y=1&u7v=1&a3h=1&mpvc=' alt='Click Here'> </a></noscript>


Step 3 - Breaking it apart

So now we have the bits of code from Ebay that we want, we need to remove what we dont want. Start by removing the following bits.

  1. Remove the <script lanuage='JavaScript1.1'>
  2. 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='" + 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
  1. document.write("<sc"+"ript language="JavaScript1.1" src='
  2. '></SC"+"RIPT>");

You should now be left with something that looks likes the following" + 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.


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" + 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='" + 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"));


<noscript> <a href=''> <img border='0px' src='[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.

Sean J Connolly
Visit AJAX Web Development Store

DMS - Document Management, Webmail - Online Property Sales and Letting


Colin Noden said...

tried it four times now with no results. TIme to walk away from the machine!

Sean J Connolly said...


I will post a basic overview, I am thinking this explanation is a bit complex.

Don't Give Up

Kool T said...

Hi sean, how long is it gonna take u to come up wit a workable but simple way to make our codes work on blogger. Appreciate ur efforts. Thks, pal
kool t

Sean J Connolly said...

Kool T.

thanks for the kind comments. If you have anything in mind let me know and I will code a fix for it.

Happy blogging

Joey said...

Hey Sean,

Just wanted to say thanks! I was having problems with ebay snippet codes, so I followed your instructions and they worked! But I have another issue now! I am trying to use the ebay "Editor Kit" and it's not working well. When I paste the code, the border is to wide, and the alignment is off. I read another post about this this problem, but I just started to learn about I don't really understand how to modify the template. They talked about Blogger templates having CSS code.They said the modify the code, which I have no idea about. Thanks again and hope you can help.

Sean J Connolly said...

Joey, great to hear your code now works. to alter the border in your blogger template you need to alter the code of the element that has the large border, in css it is simply "border:1px black solid" which would produce a black 1 px border. It oyu are having problems, feel free to email me over you complete blogger template code and I will take a look and give oyu the right solution.

neo said...

thank you Mr sean for this tip!! ;)


Fix Blue Screen on Windows said...

cool, good job bro...., ohya I have you can backlink to my blog....


Blogger said...

If you're looking for a reputable contextual ad network, I suggest that you check out Propeller Ads.