Skip to content

Instantly share code, notes, and snippets.

@nickkoskowski
Created August 31, 2015 17:00
Show Gist options
  • Select an option

  • Save nickkoskowski/32ab3d2f0daac7df7ed1 to your computer and use it in GitHub Desktop.

Select an option

Save nickkoskowski/32ab3d2f0daac7df7ed1 to your computer and use it in GitHub Desktop.
For encoding tracking parameters using hitpath.
<?php
function get_c1() {
if (isset($_REQUEST['c1'])) {
$c1 = $_REQUEST['c1'];
return $c1;
}
}
function get_c2() {
if (isset($_REQUEST['c2'])) {
$c2 = $_REQUEST['c2'];
return $c2;
}
}
function get_c3() {
if (isset($_REQUEST['c3'])) {
$c3 = $_REQUEST['c3'];
return $c3;
}
}
function get_affID() {
$default = '370432';
if (isset($_REQUEST['affid'])) {
$affid = $_REQUEST['affid'];
return $affid;
}
else {
return $default;
}
}
function encodeTrackingParameters() {
$tpl = '?affid='.get_affID().'&c1='.get_c1().'&c2='.get_c2().'&c3='.get_c3();
return $tpl;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment