we are switching from our own forms to gravity forms, and are need of a addon that tracks google Analytics tracking cookies, below we have the code used for that section
// used to get the tracking cookie from google analytics and make it viewable
function tracking_cookie() {
$GLOBALS['version'] .= " (Tracking Cookie V1.6)";
$trackarr = split('[|]',$_COOKIE["__utmz"]);
$conversion = $_COOKIE["Conversion"];
for($i=0;$i<count($trackarr);$i++){
$keyvalues=split('[=]',$trackarr[$i]);
$key=substr($keyvalues[0],-6);
switch ($key){
case "utmcsr":
$cookie['SearchEngine'] = $keyvalues[1];break;
case "utmccn":
$cookie['SearchCampaign'] = $keyvalues[1];break;
case "utmcmd":
$cookie['SearchType'] = $keyvalues[1];break;
case "utmcct":
$cookie['AdText'] = $keyvalues[1];break;
case "utmctr":
$cookie['Keyword'] = $keyvalues[1];break;
case "mgclid":
$cookie['isPPC'] = $keyvalues[1];break;
}
}
if ($cookie['isPPC'] !='') {$cookie['SearchType']='PPC';$cookie['SearchEngine']='google';}
if ($conversion !='') {$cookie['SearchType']='Conversion';$cookie['SearchEngine']='google';}
return $cookie;
}
thats the function we used, we would then exec it
$cookie = tracking_cookie(); // results from tracking cookie
and then input it into the admin, or site owner email to display
Search Engine: {$cookie['SearchEngine']}
Keyword: {$cookie['Keyword']}
Type: {$cookie['SearchType']}
Ad Text: {$cookie['AdText']}
Campaign Name: {$cookie['SearchCampaign']}
and it would display something like this
Search Engine: search.toolbars.alexa.com
Keyword:
Type: referral
Campaign Name: (referral)
can this be created as a addon? we need one ASAP