Since you got version 1.11 working for me.

Here is a feature request.... see http://www.adsenselogger.com

CommentFileSizeAuthor
#2 adsense_click_tracker.zip2.92 KBTimotheos

Comments

Hosting Geek’s picture

This would be a nice feature I am sure a lot of new drupal user will become drupal users for just this feature.

I am +1 for this.

Timotheos’s picture

Version: 4.6.x-1.x-dev » master
Status: Active » Needs review
StatusFileSize
new2.92 KB

Hi Khalid,

Ok here we go. I've attached a zip package with three files.

  • adsense.install - Set up the database for logging
  • adsense.module.patch - The patch to the module to make this happen
  • adsense.js - The javascript that fires counter to log the click. This script was taken from http://www.webmasterworld.com/forum89/1788.htm

How it works

  • Logging is enabled under the "Advanced options"
  • The log can be viewed under admin/logs/adsense
  • It works well with the statistics access log enabled as you'll see the page 'adsense/counter' logged when an ad is clicked. This way you can see what page they were on.

What to look out for

The clicks logged and what is shown by Google is not 100% inline. The reasons are numerous. Here's a few of them:

  • The javascript doesn't work in Firefox. I'm not sure about Opera. I'm no good at javascript so if anybody has something better I'd love to see it.
  • Google throws out what it sees as invalid clicks.
  • I've found it takes Google 15 to 20 minutes before recording the click.

Some things I haven't done:

  • There's a way to log size and color of the ad that I haven't implemented
  • Probably should have a cron function that discards old logs
  • It would be nice to be able to export to a CSV file.

As you know, I'm a budding Drupal developer so I'd appreciate your help and insights. One of the things that I'm unsure of is the pgsql table as I have no experience with it. I think that's it.

kbahey’s picture

Status: Needs review » Fixed

Committed to HEAD and 4.7.

Thanks Tim.

Anonymous’s picture

Status: Fixed » Closed (fixed)