Well I'm starting working on storing the IP of the visitor, adding a timestamp, and allow new click only every X hours.
If anybody want to help (I'm going to add more field for the views I created in my last post)

Comments

kbahey’s picture

Title: IP/Time check for avoiding constant click » Modify schema to support more fine grained click tracking

Actually, if you want to change the module, then better take a step further and normalize the database.

Ideally, each click will cause a new row to be inserted, rather than the incrementing that happens for day/week/month today.

This way,

Another useful thing is to make the campaigns descriptive rather than just numbers. So the settings page will have a tab where you can add a new campaign which are stored in a separate db table.

 cid int(10) NOT NULL auto_increment, // click ID
 nid int(10) NOT NULL default '0', // Node ID
 gid int(10) NOT NULL default '0', // Campaign group for this click 
 timestamp int(11) NOT NULL default '0', // Timestamp
 host varchar(128) NOT NULL default '', // IP Address
 uid int(11) NOT NULL default '0', // User ID, if logged in
gid          int  NOT NULL default '0', // campaign group id
name         varchar(255) NOT NULL default '', // campaign name
description  longtext, // campaign description
start_time   int(11) NOT NULL default '0', // start time

We could not do a GROUP BY gid to see all clicks from a certain campaign and do BETWEEN on timestamp for clicks within a certain time frame, and many other neat things.