How DO I put PHP tracking code on individual Wordpress Posts?

1 replies
OK so I'm a numbskull...

Finally this will be correct. My title above reflects that I need to learn how to add script that will affect individual wordpress posts (not globally).

This PHP tracking code below is what I want to put on this ONE page on my site EconomicCollapseSurvival.com/how-buy-silver

PHP Code:
                       <? 
    $referrer = urlencode($_SERVER['HTTP_REFERER']); 
    $referrer =  str_replace("http://","", $referrer);
    $referrer =  str_replace("https://","", $referrer);
    if(!$_GET['apflag']) header("Location: http://www.ourkangen.net/affiliateprophetscript/go.php?uid=1&cid=1&apflag=1&referrer=$referrer&".$_SERVER["QUERY_STRING"]);
    if(!$_COOKIE['apid']) setcookie("apid", $_GET['apid'], time()+300000000);
?>
I have no idea how to even do that but there must be a way. Please tell me what I need to do in order to successfully add that tracking code

Thanks!
#php #post #script #tracking #wordpress
  • Profile picture of the author johnnyN
    you could try a plugin that lets you insert php , try searching for phpexec or execphp or something like that on the wordpress plugin site.
    {{ DiscussionBoard.errors[4611586].message }}

Trending Topics