SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member
    Join Date
    Dec 2005
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    AdSense ads tracking script

    Hello.

    I'm new to all this PHP thing and i don't know anything about it.I didn't even know where to search for an answer on the forum.Hope you don't get upset with me .

    I found a free script for tracking clicks on adsense ads.Here is the link for it : http://www.monetizers.com/php-click-tracker.php

    I did all that it said on read-me file except adding the javascript on ads pages.I only added it on one page with ads.
    When I open index.php I get this message :

    Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /hsphere/local/home/pubsit10/onlinefunnygames.com/tracker/index.php on line 18


    Please it anybody else used this tool help me.Or if you know what is the problem please tell me.

    Thank you very much.

  2. #2
    SitePoint Zealot kobra's Avatar
    Join Date
    Sep 2003
    Location
    Chicago
    Posts
    190
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is aginst their TOC, if they catch you and they probably will they'll close your account you won't be able to open a new one to your name ever.


  3. #3
    SitePoint Member
    Join Date
    Dec 2005
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't change the script from adsense.I found on some forums that someone asked adsense people if he can use this and they said it's ok.

  4. #4
    SitePoint Zealot kobra's Avatar
    Join Date
    Sep 2003
    Location
    Chicago
    Posts
    190
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I doubt that


  5. #5
    SitePoint Zealot
    Join Date
    Oct 2005
    Posts
    140
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You said its javascript? But its performing a php action? And I agree with kobra. Its probably an illegal website in the first place ;-)

  6. #6
    SitePoint Addict Php_penguin's Avatar
    Join Date
    Aug 2004
    Location
    Colwyn Bay, Wales, UK
    Posts
    287
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    adsense already does tracking for you doesnt it?

    if not, and you want to write your own, heres a quick walktru:

    the file needs to contain:
    IP timestamp pageurl referrer [browser type]

    so in your hits log:
    PHP Code:
    $fp fopen("sitehits.hitlog""a");
    $ip GetHostByName($REMOTE_ADDR);
    $timestamp time();
    $pageurl $_SERVER['PHP_SELF'];
    $refer $_SERVER['HTTP_REFERER'];
    $browser get_browser(nulltrue);
    $fw fwrite($fp$ip." ".$timestamp." ".$pageurl." ".$refer." ".$browser['browser']); 
    if you make that a seperate file and include() it in the footer or header of your pages, then every user will be recored as and wehn the go to a page.

    with this information you cann write another script to track specfic users, count how many users are from google (referrer), how many pages are being hit per user, how long a user is staying on a page - pretty muh anything you might want to do.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •