O'Reilly logo

Amazon Hacks by Paul Bausch

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Rotate Through Several Keyword Banners on Your Site

Keyword banners provide some rotation as people visit your site, but to do cross-promotion with several keywords across categories, you’ll have to script a rotation solution.

Imagine you run a site for photography enthusiasts. There are several subject areas and product categories that they may be interested in: books of photographs, magazines about photography, and digital cameras. Setting a single recommended product banner for books with photographs would be fine, but you may want to expand your product recommendations into those other subject areas to increase the chances that someone will find something they’re interested in.

With a bit of scripting, you can set up some keywords and product areas, and randomly select them for each page visit.

The Code

The following code can be added to any ASP page:

<%
'Add Keywords separated by commas
strKeywords = "insert comma-separated list of keywords"

'Add Modes separated by commas
'Potential values: books, magazines, music, classical-music, 
'  vhs, dvd, toys, baby, videogames, electronics, software, 
'  tools, garden, kitchen, photo, wireless-phones
strModes = "insert comma-separated list of product modes" 'Turn lists into arrays arKeywords = Split(strKeywords,",") arModes = Split(strModes,",") intTotalKeywords = UBound(arKeywords) 'Choose a random number Randomize intRndNumber = Int((intTotalKeywords + 1) * Rnd + 1) - 1 'Set variables to the chosen random point in the array strKeyword = ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required