How to put PHP tracking code on individual Wordpress Posts

8 replies
This PHP tracking code below is what I want to put on this ONE page on my site How Buy Silver Bullion

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!
#code #php #put #tracking
  • Profile picture of the author cosmolito
    I was getting a blank screen on the submission process when trying to post the above post.

    I guess I pressed "submit post" 3 times which is why this post appears 3 times in a row.
    Signature
    My $money$ line 360-810-8062
    {{ DiscussionBoard.errors[4610442].message }}
    • Profile picture of the author Andyhenry
      You can delete the others you know.

      Just click edit post and then delete.
      Signature

      nothing to see here.

      {{ DiscussionBoard.errors[4626478].message }}
      • Profile picture of the author cosmolito
        can't see where to do it
        Signature
        My $money$ line 360-810-8062
        {{ DiscussionBoard.errors[4626489].message }}
  • Profile picture of the author johnnyN
    there are wordpress plugins that allow you to insert PHP

    search on the wordpress plugin page for plugins with the name "php exec"
    {{ DiscussionBoard.errors[4626773].message }}
  • Profile picture of the author nkatla
    hi from where did you get this code ? i guess there might be some instructions on how to use this code.
    {{ DiscussionBoard.errors[4627630].message }}
    • Profile picture of the author cosmolito
      I got this code from a product called Affiliate Prophet... apparently they have a bigger and better product called conversion prophet. Not sure what I'll do yet. I REALLY need serious eff'in tracking because playing in the dark is losing me money!
      Signature
      My $money$ line 360-810-8062
      {{ DiscussionBoard.errors[4628991].message }}
  • Profile picture of the author lordspace
    a couple of suggestions.

    move the code with the cookie one row up and move the header... redirect to the next line

    the line with the cookie you may need to enter ".yourdomain.com"
    Signature

    Are you using WordPress? Have you tried qSandbox yet?

    {{ DiscussionBoard.errors[4695969].message }}
  • Profile picture of the author starli88
    Hi Cosmolito,

    Is the affiliate link format still active or working?
    If so try to move the line, $referrer = urlencode($_SERVER['HTTP_REFERER']);
    after the last str_replace line.

    Edwin
    {{ DiscussionBoard.errors[4720543].message }}

Trending Topics