1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Tracking DMR

Discussion in 'PHP & Perl' started by xhpdx, May 20, 2010.

  1. xhpdx

    xhpdx Regular Member

    Joined:
    Sep 21, 2008
    Messages:
    331
    Likes Received:
    2,160
    Occupation:
    Coder
    Location:
    EU
    I am building a custom tracker for myself and have trouble properly tracking dmrs. Basically instead of counting 1 click it is counted twice(duh it is dmr), so I decided to check if there is a query string in the second meta refresh and if there isn't then count it as a click. To make it easier here is a sample code

    PHP:
    if($_SERVER['HTTP_REFERER'] != "") {
        echo 
    "<meta http-equiv=\"refresh\" content=\"0;url=$self?go=1\" />";}
        if(
    $_SERVER['HTTP_REFERER'] == "") {
        echo 
    "<meta http-equiv=\"refresh\" content=\"0;url=$location\" />";}}
    and this is my tracking
    PHP:
    if(!isset($_GET['go'])){
    // track click
    }
    With a sniffer I see that the browser opens $self?go, but it is still tracked. Has anyone done something similar or have a better idea ?
     
  2. ru ru

    ru ru Junior Member

    Joined:
    Mar 23, 2009
    Messages:
    109
    Likes Received:
    30
    or you can use extra variable


    PHP:
    $is_clean false;
    if(
    $_SERVER['HTTP_REFERER'] != "") {
        echo 
    "<meta http-equiv=\"refresh\" content=\"0;url=$self\" />";}
        if(
    $_SERVER['HTTP_REFERER'] == "") {
        
    $is_clean true;
        echo 
    "<meta http-equiv=\"refresh\" content=\"0;url=$location\" />";}} 
    PHP:
    if($is_clean){
    // track click
    }  
    i like to track using pixel tracking. eg. piwik.org, prosper202;
    or simple file/db click log.
     
  3. xhpdx

    xhpdx Regular Member

    Joined:
    Sep 21, 2008
    Messages:
    331
    Likes Received:
    2,160
    Occupation:
    Coder
    Location:
    EU
    That does not seem to work for me. I will probably have to simplify the app to do the tracking properly