On target with WhiskerBiscuit
Dynamically Targeted Amazon.com Associate Ads
A whisker biscuit is an archery accessory to steady the arrow as it flies and ensure the shot will always be on target. It’s also a provocative piece of slang but there is no such thing as bad publicity and double entendre never killed anyone. Though doubtless a whisker biscuit has aided a murder or two.
There is a soup of generally ignored information in most web page requests. The referring page often has query information showing exactly what a user wants to see. The current page sometimes has the same. Even the title and content of a page give clues for targeting an advertisement.
Narrowing the target of a user’s interest is what marketing companies pay great green for.
When you mix this semantic discovery with another webservice like keyword driven Amazon.com Associates advertisements, you get a potent cocktail.
Who this is for
This service is for anyone who wants to place Amazon.com advertisements on a website. It is specifically for those who are Amazon.com Associates. You don’t need to be one to use it but you can’t make money otherwise. You could substitute the Associate ID of a charity of your choice—quite a few charities and non-profits are Associates—if you don’t want to have one yourself. If the service is used without providing an Associate ID, then an elektrum press’s ID is used.
If you wish to become an Associate, it’s easy. Visit Amazon’s Associate pages to learn about the program and sign up and get your own ID.
The goal posts
WhiskerBiscuit is a dynamic augmentation of an existing static service. It will be used to govern decisions about how to apply “Recommended Product Links” advertisements from Amazon.com Associates. These are not automated and must be built via their web form or by a web developer who can edit the HTML output from the form. We use this particular format, of the many Amazon.com provides because it can be keyword driven.
WhiskerBiscuit will use an augmented Query()
object to narrow the best
keyword choice; attempting to match the visitor’s declared interest as
told by referring search queries, etc. Then it will write out the
static advertisement with the dynamically discovered keywords.
It will allow the client code to set the size of the ad, the store/product-type to search in, and fall back keywords in case no sensible query information can be uncovered.
Amazon.com Associates’s Recommended Product Links
They are straightforward HTML in an <iframe>
. look
like this; the src
URI has been omitted for space.
<iframe src="..." marginwidth="0" marginheight="0" width="120" height="150" border="2" frameborder="0" style="border:none;" scrolling="no"></iframe>
You can see that writing out the HTML for the
<iframe>
is simplistic. The height and width
have to be variable to provide different sizes of ads.
This is what the src
URI look like.
Need to know
There are four keys in the src
URI that we’ll need to
touch, and the height and width in the HTML so we can deliver more
than one ad format.
- t is the token, AKA the Amazon.com Associates’s ID.
- mode is the store in which we’re going to look for products.
- search is the term which we give to Amazon.com to find for products in the chosen store.
- p is the index to the ad size/layout. In the case above, 6 corresponds to the 120x150 ad box.
- height and width attributes within the
<iframe>
. They will have to match the index we select for the p parameter.
The API
- assoc=[your_amazon_associate_tracking_id|ours]
- Your associate ID to be inserted into the ad1. The argument is not required but obviously recommended. If you omit it, the associate ID for an elektrum press will be used.
- size=[468x60|160x600|text|…etc]
- Required. The size of the ad. Allowed sizes are show below
If
size
is omitted an error message in a<div>
tag will be written out to the page. - store=[books|dvd|music|videogames|electronics|…etc]
- Not required. Default is
books
; it’s the largest selection and generally works best. If you supply a non-existent store key,books
will be substituted. See below for the list of possiblestore
s. - override=1
- Not required.
override
changes the priority of thekeyword
. Ifoverride
is set,keyword
will be used for the ad and the query, title, and referrer information will be ignored. - keyword=[keyword_for_ad]
- Not required. This is the seed for the ad generation. Things like
“Internet,” “cats,” or “Java” are good candidates. Without
override
, thekeyword
is considered last. -
If no meaningful terms are found in the document referrer or the
current page’s query string, the
keyword
will be used to write the ad.
The possible values for the store parameter
The possible values for the size parameter, ads shown 1/3 scale
- 120x150
- 180x150
- 468x60
- 120x240
- 120x450
- 120x600
- 160x600
- text (for a plain text link)
Amazon.com offers a couple gargantuan sizes, like the completely goofy 468x336, which we won’t support because there is no good excuse for filling half the screen with an advertisement.
A sample call to WhiskerBiscuit.js
<script type="text/javascript" src="http://elektrum.org/js/WhiskerBiscuit.js?assoc=feather-20;size=468x60"> </script>
The API/UI is locked down. Now for the service.
After Passing JavaScript arguments via the src attribute and Query catching for fun and profit, there is nothing difficult involved in writing out the HTML for the ad. Just apply the arguments and ta. The only new consideration is what part of the information is valuable for the search parameter keyword of the ad.
Where we find targeting information
The hierarchy of potential information
-
A user
override
+keyword
from the clientscript
’ssrc
arguments. - The human semantic portion of the last page’s query string via the
document.referer
. - The human semantic portion of the current page’s query string
document.location
. - A user fall back from the client
script
’ssrc
arguments. - The
<title>
of the current page.
It’s possible, but atypical, that none of those will have any useful information. The client code doesn’t have to supply a keyword to fall back on, or an override to use it up front. There may be no referrer or no sensible information in it. There may be no query string in the current page. The page itself may be untitled.
This is great, what’s the catch?
There’s no margin in pangrams and greeking. The catch with the WhiskerBiscuit service is that it makes you money, so there is an automatic tip jar for an elektrum press in it.
The service will deliver the ad with your associate ID, if you have one and use it properly, approximately 98% of the time and an elektrum press’s the remaining 2%. If you do not include your own associate ID in the service call, the press’s will be used.
License
All the code in this manual except for WhiskerBiscuit is open for use and reuse. See Licenses and terms of use for more. The code for WhiskerBiscuit may not be altered or repurposed without written permission from an elektrum press.