This plugin is used to quickly add Amazon products links to your WordPress posts and pages. The product links can be simple text links, thumbnail images, full-size images, complex templates or full-blown Amazon flash widgets.
The content of the product links can be statically entered by the Author (when the link is created), or dynamically refreshed when displayed using data from the Amazon site that is most appropriate for the nationality of the reader.
The product links to be displayed can be specified when the link is created, using the built in Amazon search widget, or dynamically generated by searching the content of the site.
All product links will contain the Amazon affiliate ID of the site author and will be the relevant one for that locale. This allows you to collect commission on any products purchased through the links.
- Search Tool to assist authors to create links in posts and pages
[amazon]shortcode used to generate product links
- Localisation of all links based on the nationality of the reader
- Amazon Product Details Cache to ensure pages load quickly
- Optional multinational popup to allow the reader to choose which Amazon site to visit
- Global options to update the behaviour of all the links on your site
- Ability to locally override the global options using the shortcode content
- Affiliate Tracking IDs for each WordPress user or by user specified ‘Channels’.
- Flexible template facility to enable the author to quickly create complex content quickly and consistently
- Includes built in templates for the major Amazon widgets (Carousel, My Favourites, etc.).
- Facility to extend and modify the functionality of the plugin using WordPress filters
To quickly add a simple text link add the following lines into an entry (page, post or text widget):
[amazon asin=<ASIN Number>&text=<link text>]
Where ASIN Number is the unique amazon number used to identify products e.g. “1405235675”. The Link Text is simply what you want to be shown for the link, e.g. “Mr. Good”.
To utilise one of the templates simply specify the template option with the name of the template to use. For example:
[amazon asin=<ASIN Number>&title=<link text>&thumb=<image url>&template=thumbnail].
To take full advantage of the plugin features it is recommended that you have an Amazon Web Services account, and enter the Access Key ID and Secret Access Key in the Amazon Link Settings page. Once your AWS account settings are entered the plugin can be configured to dynamically fill in the templates with live information from the appropriate Amazon site. Alternatively you can use the Amazon Search tool on the Page/Post edit screen to find Amazon products and let the plugin pre-fill the Amazon Link shortcode with all the details needed to create the appropriate template.
To generate a list of products relevant to the content of your site use the ‘cat’ option, to specify where the plugin should search for Amazon product links. This option can be either ‘local’ to search the current page content or a list of category ids to search specific sections of your site. For example I use this feature to provide friends and family some ideas for presents. This feature also needs access to the Amazon Web Service API and uses the ‘CartSimilarities’ feature to generate the list of items.
This is created by either putting the line
amazon_recommends(<Category>,<Number of Posts>) in your template. Or putting the line
[amazon cat=<Category>&last=<Number of Posts>] within a post or page. Where ‘Category’ is a list of category ids to search within (e.g. as expected by the ‘cat’ argument of query_posts function. The ‘last’ parameter is the number of posts to search through.
Latest Version – 3.2.10
- Bug Fix – The default ‘no image’ URL use https if site is using https
- Bug Fix – Remove any hard coded ‘http’ URLs (inc Templates)
- Bug Fix – Make links use ‘AWS’ parameters
The plugin Settings page is where the author can modify the behaviour of all the links embedded in their site.
Note any changes here will affect all existing links that do not explicitly set these options via the shortcode content. These options can be viewed as the ‘default’ behaviour any of which can be overridden locally by adding the appropriate parameter to the shortcode.
The Settings are split into 5 sections dealing with different aspects of the plugin:
- Display Options
- Localisation Options
- Amazon Associate Information
- Amazon Data Cache
- Advanced Options
These options affect the default appearance and behaviour of standard text links and the type of Amazon Wishlist that is displayed.
Allows the author to change the default class used when the plugin inserts a thumbnail or image into a post. This option is equivalent to the ‘image_class’ shortcode argument, and the %IMAGE_CLASS% keyword in the template.
This is the default template used by the plugin when it auto generates a list of products using the wishlist facility. This option can be overridden in the shortcode by specifying a valid template using the ‘template’ argument.
This is the maximum number of items to display in a wishlist. This option can be overridden in the shortcode by specifying the ‘wishlist_items’ argument.
Note: Amazon only returns a maximum of 5, for the ‘Similar’ type of list.
This sets the default type of wishlist to generate. A wishlist of type ‘Similar’ will show items similar to the ones found in the content. A wishlist of type ‘Random’ will show a random selection of the ones found. A wishlist of type ‘Multi’ simply lists the items in the order they were found. This option can be overridden in the shortcode by specifying the ‘wishlist_type’ argument.
New Window Link
If this option is enabled then when generating links, the plugin will ensure that if they are clicked on it will open it in a new browser window. This option is equivalent to the ‘new_window=1’ shortcode argument.
Link Title Text
This is the text that will appear in the link ‘title’ attribute for the Amazon links, it may contain any of the usual template keywords e.g. %TITLE% or %TEXT%. Leave blank to not have a title attribute.
Use Media Library
This option adds the ability to upload images for products from the Amazon site to your local WordPress media library. Once uploaded the plugin will always use these local images for all shortcodes for that product.
Add Amazon Link – Form Options
These options affect the default values that are shown in the ‘Add Amazon Link’ helper box that is used to insert Amazon Link shortcodes into Posts.
If you do not specify the ‘text’ argument in your [amazon] shortcode, then this text will be used by default. This option is equivalent to the ‘text’ shortcode argument, and the %TEXT% keyword in the template.
Use this setting to pre-select the template to use when inserting new Amazon Links into posts.
Use this setting to pre-select the channel to use when inserting new Amazon Links into posts. If nothing is selected then the ‘Default’ channel is always used.
Default Search Index
Use this setting to pre-select which search index should be used when searching for Amazon products.
The localisation options control how the plugin deals with visitors from countries other than your default locale. The majority of these options require the ip2nation database to be installed.
At the top of this section is the current status of the ip2nation database and buttons to allow you to Remove, Update or Install the database.
If localisation is not enabled, or has failed for some reason, then this is the default Amazon site to use for the link.
Localise Amazon Link
If this option is selected and the ip2nation database has been installed then the plugin will attempt to use the most appropriate Amazon site when creating the link, currently supports www.amazon.co.uk, www.amazon.com, www.amazon.com.br, www.amazon.ca, www.amazon.cn, www.amazon.de, www.amazon.es, www.amazon.fr, www.amazon.in , www.amazon.it and www.amazon.co.jp.
When creating Amazon Links the plugin will use data provided in the shortcode in preference to data retrieved from Amazon (e.g. Setting the ‘
Title=My Favourite Book‘ in the shortcode will override the Title retrieved from Amazon). If you have localisation enabled, by default the data in the shortcode will only override your default locale. Enable this option if you want shortcode data to override the Amazon data in all locales.
Create Search Links
If localisation or the Multinational popup are enabled then the plugin will create links to Amazon sites other than your default locale. Sometimes these links either do not work – for example that exact product ASIN is not available in that country. Or is not suitable – for example it is an incorrect region DVD or a book in the wrong language.
Selecting this option will force the plugin to generate links to non-local Amazon sites that search for your product rather than an exact ASIN link. The exact terms of the search are determined by the next option.
This option can be overridden in the shortcode by specifying the ‘search_link=1’ or ‘search_link=0’ argument.
Default Search String
If the ‘Create Search Links’ option is enabled then this string determines what keywords are used to create the search link. Any of the keywords used in the Templates can be used to generate the term, for example the keyword ‘%ARTIST%’ will be expanded by the plugin to the Author/Artist/Director of the linked item.
This option can be overridden in the shortcode by specifying the ‘search_text=Specific Search String’ argument.
If this option is selected then the plugin will enable a small popup menu of country specific links whenever the user’s mouse rolls over the Amazon link, enabling them to select the site they feel is most appropriate.
Amazon Associate Information
To get the most out of the Amazon Link plugin it is highly recommended that you have access to the Amazon Product Advertising API and populate the ‘Amazon Web Services’ (AWS) key settings.
This will enable a number of features of the plugin that require access to Amazon Web Services (AWS). These include the generation of live data when displaying the links, providing a product search facility on the post/page edit admin screens, and the ability to generate product wishlists & recommendation.
If you wish to use any of these features then you must have the appropriate AWS Access IDs and enter them in these two settings. To get these keys simply register with the Amazon Web Service – Advertising API site and this will provide you with the appropriate strings. Note you must also enable the Product Advertising API in your AWS account for this to work correctly.
See the ‘Getting Started‘ section for a guide to joining the various Amazon Affiliate programmes & the Amazon Advertising API.
AWS Public Key
Enter the ‘Access Key ID’ found in your AWS Account under ‘Security Credentials > Access Credentials’
AWS Private Key
Enter the ‘Secret Access Key’ found in your AWS Account under ‘Security Credentials > Access Credentials’
Once you have entered your AWS Access keys and updated the options the AWS Keys Validated checkbox should be ticked. If it is not the Error Message displayed should provide a clue to why the keys are not working.
If this option is enabled then the plugin will attempt to retrieve up to date (and localised) information on the product when generating the product link. For this to work the AWS Access keys in the global settings must be configured with valid keys. If not enabled then the plugin will only use the information included in the shortcode. This option can be overridden in the shortcode by specifying the ‘live=1’ or ‘live=0’ argument.
Note this option also changes the behaviour of the Amazon Search Tool. When the tool is used to insert shortcodes into the post it will automatically prefill the keywords needed for the selected template. It will only do this if live data is not enabled.
Change the condition of the items returned when making Amazon Web Service requests, this affects the items returned on the search box as well as the pricing and offers returned when getting details about a specific item. The Amazon website notes on the ‘Condition’ parameter:
Use the Condition parameter to filter the offers returned in the product list by condition type. By default, Condition equals “New”. If you do not get results, consider changing the value to “All…
ItemSearch returns up to ten search results at a time. When condition equals “All,” ItemSearch returns up to three offers per condition (if they exist), for example, three new, three used, three refurbished, and three collectible items. Or, for example, if there are no collectible or refurbished offers, ItemSearch returns three new and three used offers.
Normally the plugin will not fetch data from the Product cache or via AWS unless it needs to populate a keyword. This means that for simple text links the plugin is much faster. However if all your shortcodes are complex and require data retrieved from the AWS then enable this option to improve template parsing.
User Affiliate IDs
This options enables all users of the WordPress site to have their own set of Affiliate IDs. This allows each post author to collect Amazon commission on posts for which they are the Author. The IDs (one for each locale) are accessible on the User’s profile page.
Amazon Product Cache
If you use the plugin to its full extent and display a lot of content retrieved from the Amazon Web Service it is recommended that you enable the Amazon Product Cache.
This will improve page load times for pages that retrieve live data from the Amazon Web Service by keeping a local copy of the data.
At the bottom of this section are buttons to Enable, Disable (and remove) and Flush the content of the Amazon Data Cache.
Cache Data Age
Amazon recommend that data is not stored in caches for too long, especially price and availability information. Adjust this setting depending on the volatility of the data you display (e.g. Titles, List Prices and Artist information rarely change, however Offer prices may change more frequently).
If you have a site with high levels of traffic, then it may be worth while enabling the ‘Shortcode cache’. This stores the expanded template in the site database rather than evaluating it for every visitor. You are trading off extra Database access and storage against Server CPU load. This option is currently experimental and has not been properly evaluated to see if it does actually reduce server load.
If you are already using some other form of WordPress content cache then this will add no additional benefit.
SC Cache Data Age
The number of hours data is kept in the shortcode cache without being refreshed. Keep this low to ensure that the latest product details are always displayed.
This setting only affects the Template Previews in the Template Manager section of the Amazon Link Settings page. Change this list of ASINs to change which ASIN(s) are used to generate the Template Previews.
If you are having problems with the plugin and need to contact me, it may be helpful if you could enable this option briefly. It causes the plugin to put extra hidden output in your sites pages that are displaying Amazon Links. I can use this information to diagnose any problems.
It is not recommended that this option is enabled for any length of time as it will show your AWS access keys in the page HTML source.
Purge on Uninstall
If you want to permanently uninstall the plugin then select this option before uninstalling on the ‘Installed Plugins’ page. This will ensure that all Amazon Link Settings, Templates, Associate Tracking IDs, Cache Data and the ip2nation data are removed from the WordPress database.
The main arguments available when creating a shortcode are listed below, enter each argument separated by a ‘&’. It is also possible to override settings on the global options page, or elements used in the product templates:
The text used to generate the amazon link, Enter any plain string e.g. ‘text=My Text’.
The css class used when displaying the image in the post.
The unique Amazon product ID or IDs, of the form ‘1405235675,1234567890’. Enter as ‘asin=1405235675,1234567890’. It is also possible to specify different ASINs per local using the form ‘asin=1405235675,1234567890&asin=1840347839,0123456789’.
Which template to populate and display with product data, must be one of the templates listed on the Amazon Link > Templates Settings page.
It is possible to manually select which set of tracking IDs the link uses by specifying the ‘chan=channel_id’ option. This will override the user specific affiliate ids.
When creating a wishlist you must specify the post category(s) through which to search for other Amazon links. Enter as ‘cat=4,7’. Alternatively enter ‘cat=local’ to search the content on the current page.
When creating a wishlist you can specify how many posts to search through for Amazon links. Enter as ‘last=30’.
Overides the ‘Localise Amazon Link’ setting. 0 to force the default country, 1 to force localisation.
Overides the ‘Multinational Link’ setting. 0 to disable the popup, 1 to enable the popup.
Overrides the ‘Create Search Links’ setting. 0 to force direct links by ASIN, 1 to force search based links.
Overrides the ‘Default Search String’ setting. A more specific search string can be used to generate the links.
Overrides the ‘Default Country’ setting. Must be one of ‘uk’, ‘us’, ‘ca’, ‘cn’, ‘de’, ‘es’, ‘fr’, ‘in’, ‘it’ or ‘jp’.
Overides the ‘AWS Public Key’ setting.
Overides the ‘AWS Private Key’ setting.
Set the number of items in this particular wishlist. Overides the ‘Wishlist Length’ setting.
Set the type of this particular wishlist. Overides the ‘Wishlist Type’ setting.
The plugin relies upon the php script aws_signed_request kindly crafted by Ulrich Mierendorff.
The plugin has two utility classes that might be of use to other plugin designers. The first is one for generating the options page (as well as the ‘Add Amazon Link’ meta box). The second is an AJAX facility for performing Amazon product searches and returning an array of product details, including a facility to fill in a HTML template with various attributes of the product using the patterns %TITLE%, %PRICE%, %AUTHOR%, etc. See the plugin source files for more details on how to utilise them.
The plugin comes with translation support but as yet no translations are included, please refer to the WordPress Codex for more information about activating the translation.
If you want to help to translate the plugin to your language, please have a look at the i18n/amazon-link.pot file which contains all definitions and may be used to create a language specific .po file, if you do then
contact me and I will add it to the plugin ready for the next update.
Amazon requires that all access to the AWS system contain a valid affiliate tag. If you don’t not have an affiliate account for all locales do not worry. If the setting is empty the plugin will automatically insert a valid one by default. However it is recommended that you enrol in the Amazon Affiliate program for all countries that your site targets.
There are a number of things I want to update the plugin to do, some of which have already been done in other plugins, but not quite how I would like. I would like to bring it all together in one plugin.
Features I will be adding to the plugin in the future:
- Allow the wishlist to search for legacy Amazon links not just ones embedded in the shortcode.
- Have static data for displaying the template previews, for users without AWS keys
- Source Widgets not working on new install – Template ASINs has no default?
- Add diagnostics submenu, get cache cron task working, display ‘not found’ items in cache page
- Add ‘Status’ Box -> Alerts on Dashboard, nag, ‘not found’ items, x% from locale with no tag
- Kindle items not showing list price, add format?
- Combine ‘convert’ and ‘alternates’ extras plugins
- Add flush to sc cache on any admin change, settings, template post/page edit.
- Add Price history database, graph popup -> cloud store/access data
This option which is automatically enabled when Developer Support is enabled, allows access to plugin extras. These are additional smaller plugins that provide extra features such as:
- Cache – Extra control and access to the Product Cache
- Convert – A Beta utility to convert Amazon Links to other formats
- Editorial – A plugin to add the EDITORIAL keyword to display Product Editorial Content
- Images – Allows access to all product images and the ability to change the size of images
- Redirect – Enables link cloaking
- References – Allows the user to create shortcuts to common products e.g. ref=fav books
- Spoof Locale – To enable testing of your site as if viewed from another country
- Styles – Change the stylesheet used by the plugin
Additionally any custom feature developed are also only available with this option enabled.
Some guidance on upgrading the Amazon Link plugin from one version to the next.
As with all software upgrades have a recent backup your database prior to installation, at the very least take a screenshot of your settings. The plugin should upgrade okay but there may be teething problems with the new version so if you want to regress to a previous version you may need to reset your settings.
Disable Extra Plugins
The latest versions of the plugin support additional features installed as ‘extra’ plugins if you have installed any of these then prior to upgrading the Amazon Link plugin disable them.
Install the New Version
Upgrade the plugin using your usual method, normally using the ‘Update Now’ button on the Main Plugins page.
Any problems at any point in the upgrade process don’t hesitate to use the WordPress Amazon Link plugin forums to get help.
Check Your Settings
After the new version has been updated and re-activated go to the Amazon Link Settings page and check your settings are as expected, your IP2Nation database is detected, the AWS keys still validate and the cache is detected.
On the Affiliate IDs Settings page check your affiliate IDs are all correct (especially those in the default channel).
Check the Templates are still available on the Templates Settings page, and check each template displays as expected.
Upgrade Extra Plugins
If you are using any extras plugins go to the Extras Settings page and check if any need updating. One at a time Activate each plugin in turn checking for any problems.
Check Your Links
Browse a good cross section of your posts and pages check that the links are displayed as you expect and your affiliate IDs are included in the links.
If you use localisation then try using the spoof locale extras plugin to check what you site and links look like from other locales and that your affiliate IDs are included in the links.
Good or bad please feedback your view on the latest plugin version in the forum, rate or review the plugin, mark the plugin as ‘Working’ or not on the main plugin page, or if your feeling generous a donation might help the next version along!
- Install either via WordPress Plugin Installer (Go to:
'Plugins' > 'Add New'admin page and Search Plugins using the term
'amazon link'). Or by uploading the files to your server (in
'/wp-content/plugins/') after downloading the amazon-link plugin from the Plugin Directory
- Activate the plugin through the ‘Plugins’ menu in WordPress.
- Update the settings (at the very least enter the default Affiliate Tags)
- If you wish to use the advanced functionality: Wishlists, Search, Media Upload facilities or the live data option you must also set up an Amazon Web Services account. So that you can update the AWS Public and Private key settings.
- If you wish to use link localisation then you need to install the ip2nation database using the option in the Amazon Link Settings page.
- If you would like to take advantage of the Amazon Link Product caching then you will need to enable this on the Amazon Link Settings page.
- Insert links and wishlists into your content using the [amazon] tag as described above, or using the Amazon Link box on the Page/Post edit pages.
Generally upgrading should happen smoothly, however for major releases (e.g. 3.0 to 3.1) please read the Upgrade Guide.
To upgrade use the built in WordPress update option on the Plugins Admin page.
- I’ve tried the plugin and it doesn’t do what I want, help?
- Where do I enter my Amazon Affiliate/Associate IDs?
The site owner can enter their Affiliate IDs on the Amazon Link > Associate IDs page in the ‘Amazon Tracking ID Channels’ section. Select the ‘Default’ Channel and enter your IDs for all the locales in which you have registered.
Optionally any user of your site (including the owner/administrator) can also add their Affiliate IDs to their User Profile. However it is recommended that the Affiliate IDs in the default channel as set up, as some sections of the site (e.g. shortcodes inserted in sidebar widgets) do not have an ‘author’.
If some of the IDs are not supplied in a User’s profile, or in a particular Channel, then the ones in the default channel will be used instead. Only if no IDs exist for a particular locale then the plugin will use its own default IDs.
- How do I insert product links into my posts?
The plugin adds a helper tool to the Post and Page administrative pages of your WordPress site that can be used to generate shortcodes easily and quickly.
If you already know the ASIN then simply enter it into the ASIN input and click on ‘Send To Editor’, this can be used to generate simple text links to products.
If you do not know the ASIN then there is a facility to search Amazon, by ASIN, Index, Product Title and or Product Author/Artist. Use this to find the product you wish to link to on your site. Once found select the appropriate template and other settings and press the ‘Insert’ button. This will insert the shortcode into your post with all the settings required for the selected template pre-filled. This feature is only available if you have entered your Amazon Web Services access keys in the plugin settings.
If you are using ‘live’ data then it will only include keywords that must be provided by the author ‘text’, ‘text1’, etc. If you are using static data then it will also pre-fill the keywords with the product information retrieved from the Amazon site.
There is also a facility to add cover images from the Amazon items into the local media library as attachments to the post (Press the ‘Upload’ button). The plugin will always use these local images in preference to ones fetched from the Amazon site. These images or the remote ones hosted on Amazon can be used to insert image or thumbnail links into your posts.
- How do I align thumbnails, images or iframes horizontally and make the text wrap around?
If you want images to be displayed side by side and the text to wrap around the Amazon items, then you simply need to take advantage of the built in ‘align’ classes provided by WordPress.
On the Amazon-Link / Templates Settings page:
- Find the template you wish to use (e.g. thumbnail),
- Create a copy of that template and rename it appropriately (e.g. thumbnail left)
- In the template content find the first element e.g. inside the
<iframe>, either add or update the existing
class="..."section to include either ‘
alignright‘ or ‘
- Save the new template and use it for your Amazon Links.
- Why do my Kindle products not show any prices?
Unfortunately Amazon do not provide any offer prices with any of their Kindle items. Although Amazon frown on putting static price info you could do this by adding
&price=to the shortcode, as long as you put the date of the price you should be okay.
In the next version of the plugin I might add an ‘unofficial’ Kindle price finder.
- How do I add the ‘Amazon Product Previews’ to my posts/templates?
However to add the popup to individual posts and pages simply ensure that the ‘preview script’ template is installed and add the shortcode
[amazon template=preview script]to the bottom of your post.
If you wish to add the script to your WordPress theme then you can add the following to the footer.php of the template:
<?php if (function_exists(amazon_shortcode)) echo amazon_shortcode("template=preview script"); ?>
- Can I create my own templates for product links?
On the Amazon Link > Templates Settings page there is a section showing all the available templates. Use this to create, delete and copy templates. The template content is based on standard HTML with additional keywords that are surrounded by ‘%’ characters. These keywords are automatically filled in with the relevant Amazon product information.
See the Template Help on the same page for a description of each of the keywords that can be used.
Most of the keywords are self explanatory:
'%TITLE%'will expand to be the product’s title,
'%PRICE%'the formatted product’s price, etc.
However links can be created by using the keyword pair
'%LINK_CLOSE%'with the subject of the link being placed between them. For example
'%LINK_OPEN%Amazon Product%LINK_CLOSE%'. The link produced will comply with whatever settings you have used, i.e. localised to the user’s country or produce a multinational popup, it will also use the appropriate Amazon associate IDs.
There are a number of other keywords that are also localised these include:
'%LINK_OPEN%'– as described above,
'%TLD%'the Top Level Domain to be used ‘.co.uk’, ‘.it’, ‘.com’, etc.;
'%MPLACE%'– the Amazon Market place to use ‘GB’, ‘IT’, ‘US’, etc.;
'%CC%'– the localised country code ‘uk’, ‘it’, ‘us’;
'%TAG%'– The amazon associate tag to use.
By specifying the ‘Live Data’ setting either in the settings page or within the Amazon shortcode the data used to fill the template can be generated when the link is displayed. Or if you prefer to use static data or override some of the template content the keywords can be specified in the shortcode.
There are a number of keywords that are only used for static data, these are
You must ensure that the template type is set correctly when creating the template, it should be one of:
- No ASIN
For most templates this should be ‘Product’, which is used to create links about a single Amazon product using the ASIN entered in the shortcode.
If the template accepts a list of ASINS (e.g. like the Carousel widget) then the type should be set to ‘Multi’, and the template should include the keyword
If the template does not require an ASIN to be specified then set the type to ‘No ASIN’, typically used for Banners, Scripts and more general items.
Browse the default included templates to see some examples of how the keywords can be used.
Widgets: The Amazon widgets are currently not supported in some locales (Canada, China, Italy and Spain).
Banners: The code provided by Amazon to generate banners is very particular to the locale (e.g. the category specified is in the local language), so these don’t tend to display properly when not viewed in the default locale (they drop back to the default Amazon banner).
- Can I force a template keyword to a particular locale?
If you want an item in the template to be forced to output information from a specific locale you can apply country modifiers to the template keywords.
For example you wish to show the prices from a number of locales.
This is possible by adding a country modifier to the end of the Template keyword, one of (UK#, CA#, CN#, DE#, ES#, FR#, IN#, IT#, JP#, US#). This can be applied to any of the template keywords.
%PRICE%UK#, %PRICE%DE#, %PRICE%FR#would generate a list of prices from the UK, Germany and France.
- I am displaying a lot of Amazon links on my site, can I speed it up?
If you have a lot of Amazon links displayed this can slow down your site considerably as the plugin needs to retrieve data from the Amazon servers for every link.
One way to improve page performance is to turn on the Amazon Link Cache function provided by the plugin. On the plugin Settings page there is a sub section related to the ‘Amazon Data Cache’, selecting ‘Enable Cache’ will install the cache that uses your local database.
Select the maximum time that data should be stored in the cache by updating the ‘Max Age’ setting, this defaults to 48 hours. After which the information stored is cleared from the cache.
To manually empty the cache simply select ‘Flush Cache’.
- What templates are included with the plugin?
The plugin contains a set of basic templates to show how the keywords can be used. The easiest way to create new ones is to copy one of the existing ones and update it to meet your needs.
Most of these templates were created by using the Amazon Affiliate site, generating the widget or link required then copying the generated output into the ‘Template Content’ box. Then quickly replacing any of the static data with template keywords, e.g. the product ASIN, Title, etc.
Currently the plugin has default templates for:
- Thumbnail link
- Image link
- Multinational Template
- Amazon Iframe based Image link
- Amazon Carousel Widget
- Amazon My Favourites Widget
- Amazon MP3 Clips Widget
- Amazon Enhanced Pop-up Script
- Amazon Easy Banner
- Wishlist Template
The ‘Wishlist’ template is the default template used for any lists created by shortcodes, as such it must exist. Deleting this template will cause the plugin to recreate any of the default templates that do not exist. This can be used to reset the templates back to their factory settings.
- How do I re-install the default templates?
On the Amazon Link > Templates Settings page the plugin provides access to the ‘Default Templates’. These are the ones provided by the plugin. If you accidentally delete a template that you still want or have edited one and it stops working, you can use this page to re-install the default templates.
There are two options, either ‘Install’ which will add the template to your existing list (this creates a new copy of the default template, e.g. ‘Thumbnail2’ if it already exists). If the plugin detects that the default version has been upgraded then the ‘Upgrade’ option will be available this which will overwrite any existing template with the same Name with the new version.
If you are viewing your existing installed templates there is also an option to ‘Reset’ the template back to its default content.
The plugin includes some basic version tracking, based on the Name of the template and the version installed. If you rename the template then it will not be recognised as one of the defaults. The plugin does not track any changes you make to the template, so if you ‘Upgrade’ or ‘Reset’ a template your changes will be lost.
- Does the plugin support multiple Amazon Tracking IDs?
The plugin allows the site author to create any number of ‘Amazon Affiliate Channels’ that specify a different set of Affiliate Tracking IDs. This allows the user to monitor how effective particular sections of the site are for generating referrals to Amazon.
Then under the Amazon Link Settings page, in the ‘Channels’ section, create a new Channel and enter the tracking IDs created.
Individual WordPress users can also add their own tracking IDs to their User profile. Any page of post that they are the author of will automatically use their Affiliate IDs (This facility can be disabled on the Amazon Link > Settings Page).
When generating Amazon Link shortcodes, either manually add ‘chan=channel_id’ to the shortcode or use the drop down selector in the Link Tool to choose one of the available channels. Leave blank to adopt the page author’s tracking IDs or use the ones defined in the ‘Default’ channel.
The plugin also allows Channels to be set up to use different Tags depending upon the posts category, tags, author or type, or randomly use that channel.
Associate ID Priority
If the user specifies a Channel in the Amazon Link shortcode then this will always be used (if it exists).
If the post or page is authored by a user who has specified their own affiliate ids then these will be used next.
Otherwise the Affiliate IDs in the ‘default’ channel will be used.
If the Channel selected does not contain affiliate IDs for all locales then ones from the ‘default’ Channel will be automatically inserted. Only if no affiliate IDs are set for a particular locale will the plugin will insert its own ID.
- Can I specify different ASINs for different locales?
If you want to provide different ASINs for different locales then this can be done using the shortcode country modifiers .
For example if you want to generate a link for a book and the ASIN for France is ‘2020479893’, the UK is ‘0340993782’ and Germany is ‘3548602045’. Then putting the following in the shortcode will ensure that any localised links will use the appropriate ASIN.
If you have ‘live’ data enabled then if the link is localised all other aspects (Title, images, etc.) will be generated using the appropriate ASIN.
If the link is localised to a locale that does not have a user specified ASIN then it will use the one from the default locale.
Alternatively if you have ‘search link’ enabled the plugin will generate a link that will cause Amazon to search for the keywords related to the product rather than a specific ASIN.
- Why doesn’t the Wishlist function or Search or Live data work?
For these features to work you must have set up an Amazon Web Services account and set the AWS Public and Private key settings to those provided in the AWS->Security Credentials->Access Credentials section.
For the wishlist to work you must also have inserted at least a few links to Amazon products using the
[amazon]tag for it to generate a list of related product suggestions.
- Can I change the styling of the templates?
If you are using the default templates that came with the plugin then you can either override the default stylesheet or change the templates to use classes and ids from your own/themes stylesheet.
To override the default stylesheet add the file ‘
user_styles.css‘ to the
wp-content/plugindirectory and then go to the Amazon Link > Extras admin page and install the ‘Stylesheet’ plugin. This will load the
user_styles.cssfile instead of the default
The following styles are used in some of the default templates:
- amazon_container – Encloses whole wishlist.
- amazon_prod – Encloses each list item.
- amazon_img_container – Encloses the item thumbnail (link+img)
- wishlist_image – (Default) Class of the item thumbnail IMG element
- amazon_text_container – Encloses the item description (Title paragraphs+link + Details paragraphs)
- amazon_details – Encloses the item details part of the description
- amazon_price – Spans the item’s formatted price.
- Are the links localised to match my visitor’s country of origin?
The links that are generated can optionally be localised to the Amazon store most likely to be used by the visitor to your site, this is achieved by installing the ip2nation database and enabling ‘localise links’ option in the plugin settings.
Link Localisation Limitations
The localisation process is far from perfect and authors should be aware of the following limitations:
Incorrect nationality detection –
The database is updated periodically so it will may be slightly out of date and incorrectly detect an visitor’s locale. Additionally some people browse through proxies or through their company’s firewall which again may confuse the plugin and get the wrong country of origin.
Incorrect Amazon site allocation –
There are only 10 major Amazon sites (UK, France, Germany, Spain, US, Japan, India, Italy, China, Brazil and Canada). So the plugin has to guess where a country’s residents are most likely to shop on-line. An alternative is to enable the ‘Multinational Link’ option, this will enable a small popup for each link allowing the site visitor to choose the most appropriate site (based on locale or language).
Product Availability –
A product that is available in the author’s locale may not be available on other Amazon sites. If the live data option is enabled the plugin will display a link to the Amazon site in the author’s own locale if the product is not available at the visitor’s Amazon store.
Product Localisation –
Some products such as books, DVDs and CDs have unique ASINs for each language, country or region. There currently no facility for the plugin to find the correct product for that visitor. If it is not obvious from the product picture, it is recommended that for these items a note should be displayed that recommends the visitor finds the most appropriate version of the item for their locale. They may be disappointed to buy a book in a language they can not understand!
The plugin includes a tool to install and monitor the status of the ip2nation database. However the installation of the ip2nation database is not validated, it simply downloads the latest database file from ip2nation and zaps it into your WordPress mysql database.
If the file is corrupted or maliciously changed then this operation could completely destroy your sites mysql database, if in doubt manually download the database from ip2nation and check its content, currently it consists of 2 tables ip2nation and ip2nationCountries.
- Can you provide a few examples of the shortcodes?
[amazon asin=0893817449&text=Henri Cartier-Bresson]
Will produce a text link to an Amazon Product page:
[amazon asin=0893817449&title=Masters of Photography&template=Thumbnail&live=1]
Will produce a thumbnail image link to an Amazon Product page.
[amazon asin=0893817449,0500410607&template=Iframe Image]
Will produce 2 classic Amazon product links to the specified products.
Will produce a single Amazon Carousel widget containing all the specified products.
Will produce a list of the 2 products using data from the reader’s local Amazon site.
[amazon asin=1841498955&template=Wishlist Post&product=Book&title=Surface Detail (Culture)&artist=Iain M. Banks&thumb=http://ecx.images-amazon.com/images/I/41n7sphvJpL._SL160_.jpg&image=http://ecx.images-amazon.com/images/I/41n7sphvJpL.jpg&price=£5.30]
Will produce a link using a custom template filled in with the data included in the shortcode.
[amazon asin=1841498955&template=Wishlist Post&live=1&title=My Favourite Book]
Will produce a link using a custom template filled in with live data from the Amazon site, but with the title set by the data included in the shortcode.
[amazon text=Recipe Books&cat=3,10&last=30&wishlist_type=Random]
Produce a wishlist using the default template containing a random selection of products found in the posts in categories 3, 4 and 5.
[amazon cat=local&template=My Favourites&wishlist_type=similar&text=Some Related Products]
Produce an Amazon My Favourites widget containing a selection of related products to those already displayed on the current page.
Contributors & Developers
“Amazon Link” is open source software. The following people have contributed to this plugin.Contributors
3.2.10 – 06 March 2019
- Bug Fix – The default ‘no image’ URL use https if site is using https
- Bug Fix – Remove any hard coded ‘http’ URLs (inc Templates)
- Bug Fix – Make links use ‘AWS’ parameters
3.2.9 – 30 May 2018
- Feature – Add support for Australia.
- Bug Fix – Fix localisation & localisation spoofing on Cloudflare.
- Bug Fix – Fix changing associate tags on Setup screen.
- Bug Fix – Fix Media Upload of Images
- Bug Fix – Fix ‘Images’ extra plugin failing to resize images
3.2.8 – 12 December 2017
- Feature – Add ability to disable some locales.
- Bug Fix – Fix failing ip2nation installation.
- Bug Fix – Fix some warnings.
3.2.7 – 24 June 2017
- Feature – Add global option to disable template previews.
- Feature – Add global option to set the default template.
- Feature – Add Amazon Search Widget template.
- Bug Fix – Fix ‘Convert’ plugin to help with removal of shortcodes.
3.2.6 – 15th July 2016
- Bug Fix – Fix Multinational ASIN handling in the shortcode, blanks & ‘-‘ parsed correctly.
- Bug Fix – Fix key validation for non-UK registered affiliates
- Feature – Add support for Mexico
3.2.5 – 25th June 2015
- Bug Fix – Validate AWS Keys in all locales.
- Bug Fix – Tidy up ip2nation installer, in support of MaxMind alternate
- Update – Update the Default Templates to use the new Amazon Widget URLS
- Feature – ‘Count’ keyword for multi ASIN links
- Feature – ‘alt’ option to return ‘AlternateVersions’ of an Item
- Feature – Allow User names as well as IDs in the ‘Author’ Channel Filter
- Feature – Add support for links to an book’s author’s Biography %BURL% and %BLINK_OPEN%
- Feature – Update Amazon Link Images Extra to use image modifiers (e.g. SL800 More) not just size (e.g. 800)
- Feature – Add filters to change the country map, locales available to allow removal of support for specific locales.
- Policy – Plugin Extras linked to Developer Support Option
3.2.4 – 24th June 2014
- Bug Fix – Save Affiliate IDs on Setup Screen.
3.2.3 – 11th May 2014
- New Feature – Add ‘home_links’ option to show default locale links if product not available locally, and hide price if not relevant for that locale.
- Bug Fix – Correct US iframe image – %RCM% keyword.
3.2.2 – 9th April 2014
- New Feature – New Setup page to help new users configure the plugin
- New Feature – Add support for Brazil locale
- New Feature – Add settings to allow the ‘Add Amazon Link’ form to have pre-configured defaults
- Bug Fix – Correction to iframe localised subdomains
- Bug Fix – Tweek the way Amazon data is escaped to show HTML in the Editorial Comments
- Bug Fix – Remove depreciated screen_icons
- Bug Fix – Ensure ‘Link Text’ is put into the shortcode when link inserted into a post
- Bug Fix – Prevent PHP timeouts when install the ip2nation database
- Bug Fix – Ensure multinational links are ‘nofollow’
- Bug Fix – Escape the ‘&’ in the link URLs
3.2 – 12th March 2014
- New Feature – Experimental ‘live search’, use a shortcode using s_title, s_index, s_author to create a wishlist of search results.
- Bug Fix – Improve separation of backend and frontend functionality
- Bug Fix – Fix bug with Template Export encoding function
- Bug Fix – Ensure ‘Extra’ plugins are Deactivated before Uninstalling
- Bug Fix – Improve performance of User Channel lookups
- Bug Fix – Rework parsing of shortcode arguments and settings
- Other – Updates to match WordPress coding standard
- Other – Update Amazon Java based Templates to match new subdomains
- Compliance – Improve visibility of use of plugins own affiliate IDs
3.1.2 – 16th December 2013
- New Feature – Add keyword for URL, RURL & SURL as per LINK_OPEN but just the URL.
- New Feature – Experimental ‘Shortcode Cache’ to attempt to reduce load on high traffic sites
- Bug Fix – Make Media Library Image Search Optional to reduce server overhead
- Bug Fix – Ensure Image Upload works when ‘images’ extra installed.
- Bug Fix – Update ‘wishlist’ styles to allow variable height items.
- Bug Fix – Fix Wishlist selection of post categories
- Bug Fix – Update ip2nation to use WP functions to get & extract the database
- Bug Fix – Fix clash with other plugins and Amazon Link Settings Menus
- Bug Fix – Fix clash with ‘Category Sticky Posts’
- Other – Rework Channel selection to use live product data
This release of the plugin is a major rework of the internals to make it simpler to customise the behaviour of the plugin. Please take the usual precautions when upgrading (backup Database, etc.). Please read the Upgrade Guide.
- New Feature – Re-organised Settings pages and update Contextual Help
- New Plugin (BETA) – Add ‘Redirect links’ an ‘Extras’ plugin to create links in the form
www.domain.com/al/0123456789that auto redirect to the appropriate Amazon site.
- New Plugin (BETA) – Add a database of predefined shortcodes accessed using a unique References ID
- New Plugin (BETA) – Add a facility to search for and replace shortcodes in post content
- New Plugin (BETA) – Add a facility to change the size of the images retrieved from Amazon
- New Feature – Ability to Export existing templates to a plugin file
- New Feature – Add new keywords PUB_KEY, BUY_BUTTON
- New Feature – Add new Amazon Link type ‘URL’ so can manually specify the link destination
- New Feature – Add simple Rules to Channels
- New Feature – Option to disable User specific Affiliate IDs
- New Template – ‘Add To Cart’ Template added
- Bug Fix – Change the way templates are processed, to improve page performance
- Bug Fix – Update settings page to correctly handle 1 or 2 column mode
- Bug Fix – Update multinational ‘popup’ to reposition itself if not in correct screen location.
- Bug Fix – Remove various warnings when DEBUG enabled, and some CSS errors
- Bug Fix – Conditionally add contextual help based on WordPress version
- Other – Rework plugin to allow more customisation of the data retrieved and how it is displayed.
- New Feature – Amazon Link Helper Box added to all custom Post types
- New Feature – Add ‘Extra’ plugin manager to allow installation of user provided features, e.g. The addition of an ‘%Editorial%’ keyword to display Amazon ‘Editorial Review’ content
- New Feature – Add ability to change the ASINs used to generate the template previews
- Bug Fix – correct multi-ASIN argument handling
- New Feature – Add basic contextual help to the plugin Settings page.
- New Feature – Validate AWS keys when entered on the Setting page.
- New Feature – Add support for ‘Link to Reviews’ rather than the product in templates
- New Feature – Add ‘rel=”nofollow”‘ to all links.
- Bug Fix – Check for Creation Date when checking the ip2nation database, thanks to Ken Paulson for spotting
- Bug Fix – Position of ‘multinational popup’ made more consistent
- New Feature – Simple Template Manager
- New Feature – Amazon Product Cache to speed up page loading
- New Feature – Add ‘Template Type’ option to identify templates that require no ASIN, or Multiple ASINS.
- New Feature – Search using by ‘ASIN’ if ‘Title’ and ‘Author’ fields blank
- New Feature – ‘country’ modifiers (UK#, DE#, US#, etc.) for Template keywords.
- New Feature – ‘country’ specific shortcode modifiers (, , , etc.) for any Shortcode keyword.
- Templates Update – Add ‘Amazon Impression Tracking’ to templates
- Templates Update – Add ‘Easy Banner’ template example
- Templates Update – Add ‘Amazon Preview Script’ template, add to the bottom of your post/page or include in your theme’s footer
- Templates Update – Add ‘Multinational’ template, example of using ‘country’ modifiers.
- Bug Fix – Fix filtering of incomplete tags.
- Bug Fix – Move ‘aws_signed_request’ into the Class to avoid name clash with ‘premiumtheme’, thanks to pst61 for spotting.
- New Feature – Amazon search links for non-local links
- Bug Fix – Fix so that searches from all Search Indices return valid results.
- Bug Fix – Extra checks on ip2nation lookup failures.
- Bug Fix – Extract price information from OfferListing, LowestNew, LowestUsed and then ItemAttributes. Thanks to Matthew for spotting.
- Fix US localisation of image iframe template – addition of RCM template item
- Add support for www.amazon.es
- Improve localisation of image iframe template – addition of MPLACE_ID template item
- Add Affiliate ID channels and User Affiliate ID settings
- Facility to set Affiliate channel by Author or manually in each shortcode.
- Bug fix – Italian AWS API Version Increment
- Bug fix – Fix php ‘Notice’s when WP_DEBUG is enabled
- Add extra support for www.amazon.it and www.amazon.cn
- Add ‘found’ tag to templates to indicate if product is listed on Amazon, and updated default templates to make use of this.
- Bug fix – not displaying ‘$’ prices correctly
- Bug fix – not linking to default locale correctly
- Make template names case insensitive
- Added debug output option to help diagnosis of problems
- Add notes to options page to highlight AWS requirements
- Disable Search options on page/post edit screens if AWS keys not entered
- Bug Fix – Only do ‘live’ data lookups when activated
- Bug Fix – Improve ability of shortcode settings to override global settings when generating template links
- Bug Fix – If product not available in locale, use author’s locale. Thanks to Sandie for highlighting.
- Bug Fix – Improve handling of failed ASIN lookups. Thanks to Matt for bring to my attention.
- Bug Fix – Correct usage of activation hook, and add upgrade checks
- Tidy up options so that default affiliate ID’s are not displayed and removed redundant ‘remote_images’ option.
- Fix bug with plugin activation outputting characters – Thanks to Viktor Leberecht for highlighting.
- Fix bug when creating the default templates – Thanks to Tobias Hartmann for spotting.
- Add template facility, with pre-designed templates for most Amazon widgets
- Add ability to create multiple links from one shortcode
- Add shortcode processing in widgets
- Add an option to make the links open in a new window when clicked on by a reader.
- Add an option to set the length of the wishlist displayed
Default to using .com for aws requests when user has configured Italian or Chinese as the default domain. Note requires WordPress version 3.1 for this release.
Add support for images into the shortcode, as well as the ability to add images to the WordPress media library.
Rework ip2nation download function
Add support for China and Canada Associates sites, fix ip2nation status check bug.
Added a simple widget to the post & page new/edit screen to assist in adding shortcodes to posts, providing a facility to search Amazon.
Add link localisation through IP address lookup, and support for all 6 amazon affiliate sites not just one via a image popup.
Improve options page processing.
Move options page into ‘Options’ section.
Corrected stylesheet content, updated styles & provide facility to override the stylesheet.
Add internationalisation hooks into plugin.