To see it in action, hover your mouse over this book cover image:
You are welcome to use this widget on your own website, although we cannot offer warranties or guarantees or tech support of any kind. If you have affiliate accounts with any of the major online book retailers you can insert your IDs in section #2 below so you earn your own referral revenues. If you do not — full disclosure — then our own affiliate codes will be included. Seems fair, yes?
Here’s what you need to do:
1. In the header of each page where you want to use the “Buy this book” widget, copy-and-paste this text immediately before “</head>”:
<script type=”text/javascript” src=”https://www.twliterary.com/buybookwidget/buybook.js”></script>
2. At the bottom of each page, copy-and-paste this text immediately before “</body>”, and insert your affiliate IDs, if applicable (be sure to leave the single quote marks in place):
<script type=”text/javascript”>
var myBuyBook = function(){
var myBuyBook_amazon = ‘yourAmazonID‘; //(optional)
var myBuyBook_bn = ‘yourBNID‘; //(optional)
var myBuyBook_bam = ‘yourBAMID‘; //(optional)
var myBuyBook_indiebound = ‘yourIndieBoundID‘; //(optional)
var myBuyBook_powells = ‘yourpowellsID‘; //(optional)
return {
‘myBuyBook_amazon’: myBuyBook_amazon,
‘myBuyBook_bn’: myBuyBook_bn,
‘myBuyBook_bam’: myBuyBook_bam,
‘myBuyBook_indiebound’: myBuyBook_indiebound,
‘myBuyBook_powells’: myBuyBook_powells
};
};
buyBookWidget();
</script>
3. For each individual book link, insert and edit this HTML code (be sure to leave the single quote marks in place):
<a onmouseover=”ShowContent(‘buyBook_widget’,’ISBN# HERE‘); return true;” href=”javascript:ShowContent(‘buyBook_widget’,’ISBN# HERE‘)”>[Title text and/or book cover image]</a>
We have found that only 10-digit ISBN codes seem to work consistently.
4. Finally please TEST each of your pages and links. Again, we cannot offer warranties or guarantees or tech support of any kind.
We hope you find this widget useful. Now step away from the computer and go read a book.