HOW TO display book titles in Amazon ads dynamically based on context or custom keywords
The Recommended Product Links Amazon widget can be adapted to display book titles in Amazon ads dynamically based on context or custom keywords.
Here is a GitHub Gist snippet that illustrates this -
I have used this in our app to search for free eBooks from the Google Books collection. It improves the app by showing results from an additional info source and helps surface free Kindle eBooks that may be available for a specified keyword.
Here is a GitHub Gist snippet that illustrates this -
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Show book titles in Amazon ads by keyword</title> | |
</head> | |
<body> | |
<div id="amz"></div> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script> | |
<script> | |
$(document).ready(function () { | |
amzn("India"); | |
function amzn(keyword) { | |
var amzn = '<br><iframe src="http://rcm-na.amazon-adsystem.com/e/cm?t=webdevetipstr-20&o=1&p=48&l=st1&mode=books&search=' + keyword + '&fc1=000000<1=_blank&lc1=3366FF&bg1=FFFFFF&f=ifr" marginwidth="0" marginheight="0" width="728" height="90" border="0" frameborder="0" style="border:none;" scrolling="no"></iframe>'; | |
$("#amz").append(amzn); | |
} | |
}); | |
</script> | |
</body> | |
</html> |
Comments
Post a Comment