Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I am sure there are some already written modules or something that can help me do some ad tracking. What I am looking for is some guidance in the format that would be best. We have a members site where people can create ads and track the visitors that click on those ads. I am building all the back office systems, and am going to integrate this feature, free, for all members.

What I cannot figure out, is how to do some robust programming that will allow them to see statistics like per day traffic, and so forth.

Can someone enlighten me on the best way to do this in Perl and MySql? or just some robust way?

Thank you so very much

Rick
  • Comment on Creating Ad Tracking with Perl and MySQL

Replies are listed 'Best First'.
Re: Creating Ad Tracking with Perl and MySQL
by derby (Abbot) on Aug 07, 2007 at 23:24 UTC

    Geez! That's a wildly vague post there Rick. You say there's a front-end where people create ad links that are clicked. Well what happens when the links are clicked? Is the data recorded? In a database? Log file? On one machine? Many?

    Ideally your ad links contain some information that encapsulates the member and the ad campaign. When the link is clicked, you should be taken to some type of app that logs the member/campaign info and then redirects to the target. And that's just the tip of the iceberg - some ad tracking systems track ads delivered (displayed) *and* ads clicked.

    You're back end system could easily be CRUD system that exposes the member slice of the underlying database or it may need to aggregate all the log info and then populate a database (of some type, not necessarily an RDBMS).

    Either way, for PM you either need to tell us what code you have so far and where you're having *code* problems or you need to hire a consultant to build your solution.

    -derby
Re: Creating Ad Tracking with Perl and MySQL
by whereiskurt (Friar) on Aug 08, 2007 at 19:05 UTC

    Rick,

    More information would be helpful. As other posters have mentioned: How are you serving the Ad links up?? That will give us a better idea of what needs to be done...

    I'll make some assumptions. To me, every ad you display probably looks like this:

    <a href="adtracker.cgi?uid=12345&aid=123929&redirect=1"> <img src="someimage.gif" alt="Buy this car!"/> </a>

    When someone clicks the ad, they are first sent to a 'front controller' for your ad server (adtracker.cgi) This controller is a mod_perl/cgi script that inspects the params, writes the stats to a DB/logfile, and forwards off the advertisers site. You might need to write this.

    No matter how you slice it, really, somewhere along the way you need to capture the ad click. That ad click has to be a GET/POST to your webserver.

    Give us more details, and we'll tell you other ways to abuse URLs to get what you need. ;-)

    Kurt