Skip to content

Instantly share code, notes, and snippets.

@underdown
Created February 19, 2014 20:25
Show Gist options
  • Select an option

  • Save underdown/9100764 to your computer and use it in GitHub Desktop.

Select an option

Save underdown/9100764 to your computer and use it in GitHub Desktop.
Cookie Based PPC Call Tracking
<?php
if($_GET["ppc"] == “true”) {
$cookieValue = “PPCVisit”;
setcookie(“PPCCampaignTracking”, $cookieValue, time()+60*60*24*90); //90 days
$cookie = $cookieValue;
} else {
$cookie = $_COOKIE["NoTracking"];
}
if (isset($_COOKIE["PPCCampaignTracking"])){
$phone="480-351-4744";
$phone2="623-552-4323"
} else {
$phone="480-515-1240";
$phone2="602-354-5223";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment