Wednesday, January 20, 2010

Installing Amazon's Product Preview tool

This article is about fixing a problem with installing Amazon's Product Preview feature into your blog or website.



What is Amazon's Product Preview code

If you you build your Amazon Associates product links through Amazon's website, you might notice that, in the sidebar, there there is a link to put the Product Previews feature into your website.

The instructions say to place the HTML "after your content and before your closing tag", which is fine provided you are willing to accept the disadvantages of editing your theme, and are not using a dynamic theme.


Is it that easy

When I first discovered this, in Jan  2010, I tried to install it got this error:

"Your template could not be parsed as it is not well-formed. Please make sure that all XML elements are closed properly.
XML error message: The reference to entity "o" must end with the ';' delimiter."
After a little investigation, I found that this was an example of 3rd party HTML that needed to be "escaped" before it could be put into my theme.

In particular, I had to change the & sign to &-amp-;
(but without the dashes, they're there to stop Blogger from display just an ampersand sign on this page!)

For example:
What Amazon gave me:

<script type="text/javascript" src="http://www.assoc-amazon.co.uk/s/link-enhancer?tag=YOUR-AMAZON-ASSOCIATES-ID&o=2">
</script>
<noscript>
    <img src="http://www.assoc-amazon.co.uk/s/noscript?tag=YOUR-AMAZON-ASSOCIATES-ID" alt="" />
</noscript>

What I needed to change it to:


<script type="text/javascript" src="http://www.assoc-amazon.co.uk/s/link-enhancer?tag=YOUR-AMAZON-ASSOCIATES-ID&amp;o=2">
</script>
<noscript>
    <img src="http://www.assoc-amazon.co.uk/s/noscript?tag=YOUR-AMAZON-ASSOCIATES-ID" alt="" />
</noscript>


What your readers see

I don't have Amazon Product Preview installed in this blog, because that's not the effect I'm looing for - but I am going to try to install it into this post.

If I've been successful, then you will see it when you hover your mouse over the Amazon product ad to the right of this paragraph.   (Though last time I checked, it had not been successful.)




Related Articles

Building Amazon Associates product links

Limitations of dynamic themes.

Adding 3rd party HTML to your blog

Advantages and disadvantages of editing your theme

Some other advertsing programmes to consider

Share this Article

URL:

HTML link code:

BB (forum) link code:

Subscribe to Blogger-hints-and-tips

FeedBurner will send a confirmation message. Click the verify link in it to start your subscription.

Follow Me on Pinterest Subscribe to Blogger-HAT on Google + RSS subscription icon Follow BloggerHAT on Twitter

1 comment: