Tracking user actions from banner marketing campaigns

Advance PHP knowledge is needed to understand this technique

When advertising on a site, you want to know how the user actions from that site (if it converted or not: signed up or buy).

One solution is to add a domain.tld/?refer=somecode but that looks ugly for the ones who visit. 

For fav20 I see if user registered by using the following code:

if(stristr($_SERVER[‘HTTP_REFERER’],’domain.tld’)) {
       $referer = ‘domain.tld’;
       setcookie(“referer”, $referer, time() + 3600 * 24 * 30,”/”);
}

And then I use the $referer variable to add it to a hidden field in the sign-up form and insert it in the database. User will be tracked for 30 days on my example.


Posted

in

by

Comments

2 responses to “Tracking user actions from banner marketing campaigns”

  1. Un roman in Canada Avatar

    Interesanta chestia. Pe mine m-ar interesa sa pun un tracker de gen dar pentru google ads. Adica sa-mi zica exact care dintre ads au clikuri mai multe…

  2. Razvan Girmacea Avatar
    Razvan Girmacea

    Nu ai cum 🙂