What It Is
The S.R.E. Web Widget adds a small portion of the power of Sales Rank Express to your own blog or Web site. It will show your visitors the current Amazon sales rank, customer rating, and other info for one or more books, CDs, DVDs, or anything else, on Amazon.com or any other Amazon site worldwide. Also included is a link to the item’s page on that site, which can include your Amazon affiliate ID for commissioned sales. Examples appear here on the right.
The widget is designed for safety and efficiency. It will not delay or slow down the loading of the rest of your page, even if a temporary glitch or other problem makes the widget fail. It will not compromise the security of your page with active code. And it can be installed by anyone with the slightest familiarity with HTML.
Due to the variety of settings in which this widget might be installed, it is not guaranteed to work in all of them. So far, we have heard it is prevented from running on blogs hosted at WordPress.com.
Though nothing prevents you from modifying the widget as much as you like, alterations beyond the ones prescribed below are likely to compromise its finely tuned layout. Keep in mind that the widget must function well not only on different pages, but also in all major browsers and at all normal viewing sizes. Most problems we’ve seen with the widget have arisen from well-meant tinkering with inadequate testing. Our recommendation: If it ain’t broke, don’t fix it!
How to Install It
1. Find the box below for the country you want. Click in the box and choose “Select All” from your Edit or contextual menu. Then copy and paste this code into the HTML of your blog sidebar or Web page, at whatever point you want the widget to appear. (Don’t see the code boxes? Then your browser is too old to work with this widget anyway!)
Amazon.com (U.S.)
Amazon.ca (Canada)
Amazon.co.uk (U.K.)
Amazon.fr (France)
Amazon.de (Germany)
Amazon.co.jp (Japan)
2. Within the code you’ve pasted, look at the largest block, which consists of two “iframe” tags—a very long starting tag and a short closing one. Toward the end of the starting tag, you’ll see “ItemId=”, followed by a 10-character code of numbers and letters. The 10-character code is an ASIN, Amazon Standard Identification Number. Every item sold on Amazon has a unique ASIN, and this is what tells the widget what to look up.Replace the ASIN in the code with the ASIN of the item you want displayed. For a book, this will usually be the same as its ISBN in 10-digit format without hyphens. If you look up your item on Amazon, you’ll find the ASIN or ISBN-10 in the section with the item’s essential data (date, dimensions, sales rank, and so on). It will also be part of the Amazon Web page address as seen at the top of the browser window, where the ASIN will appear between two slashes (/). To ensure accuracy, use cut and paste commands to place it in the widget code. This is the only code change you absolutely must make!
3. If you are signed up for that Amazon site’s affiliate program—called Amazon Associates in the U.S., Canada, and the U.K.—find “AssociateTag=” within the long iframe tag. This will be followed by the affiliate ID of Sales Rank Express—for example, “salranexp-20” for the U.S. Replace this with your own affiliate ID.
Note that the affiliate program for each Amazon site is independent, so you have to sign up separately for each one you want to participate in and receive a separate ID. You can do this by following the “Affiliate Program” links on the S.R.E. main page. Be aware, though, that payment from a foreign Amazon is only in that country’s currency, or else in gift certificates.
If you are not an affiliate for that country, please do not change or remove the affiliate ID in the widget. Including the S.R.E. affiliate ID helps support Sales Rank Express at no cost to you or your visitors.
4. If you want to show more than one item, you have two choices. The first is simply to paste in the entire widget code more than once, anywhere in your page’s HTML, using a different ASIN each time. This will give you a number of separate widgets.
The second method will report on multiple items within a single widget (as shown in the lowest example to the right). For this, copy just the large code block with the iframe tags and paste it one or more times immediately below the original block. Then change the ASIN in each pasted block.
5. Please contact us with your page’s Web address so we can see for ourselves how the widget is working. This will help us to improve the widget’s compatibility with varied environments and to provide guidance for a variety of situations.
If you install the widget and it does not work, then please—before you remove it from the page—send us the page’s entire source code so we can try to find the problem. We’ll let you know if there’s anything we can do about it.
How It Works
Like Sales Rank Express itself, the S.R.E. Web Widget requests data directly from Amazon Web Services, which then directly returns it to your visitor. This data is formatted by Amazon to S.R.E. specs, as provided in a file written in XSLT, a stylesheet language based on XML.
Unlike Sales Rank Express, the widget includes no code in JavaScript or any other active language—just in the display languages of HTML and CSS, the most basic building blocks of the Web. The Amazon data, again formatted as HTML and CSS alone, is loaded into a standard inline frame. From a security standpoint, this may be the safest widget on your page.
The widget is designed so it will never stall or even slow down your page’s loading—nothing it does or requires will make the browser wait for it. In fact, very little demand is made on the browser at all—the heavy work is done by Amazon itself, and there is no refresh while your page is on screen.
In all ways, you should find the S.R.E. Web Widget a very cooperative player.
Technical note: The iframe tag is a common feature in today’s widgets. Unfortunately, it is officially recognized only in the more popular, “Transitional” versions of HTML and XHTML. Browsers will read it regardless, but if a page uses a “Strict” DTD, a syntax checker will report it as an error. C’est la vie.