Tuesday, April 28, 2009

google adsense sparklines

since a couple of weeks, the infosthetics website contains a sparkline diagram of its relative daily Google Adsense earnings, updated hourly. in contrast to the quite static "unique visitors" graph, this sparkline is more volatile & shows more complex patterns that are interesting to grasp. it is loosely based on a script that creates an Adsense RSS feed. instead of a RSS file, it now parses the data into a sparkline.
for those wanting to have their own Adsense sparklines on their website, the source code (PHP) can be downloaded here. one also needs the sparkline PHP library & some basic knowledge of crontab on your webserver to set up the automatic hourly execution of the script. 
but most importantly, one must first kindly ask Google Adsense permission for its use! note that this display is in accordance to the Google Adsense policy, as it does not disclose the earnings directly, but only shows its relative fluctuations. see more information about this issue after the break.

No comments:

Post a Comment