PHP Help...How to Track Properly

Discussion in 'PHP' started by hello340, Oct 22, 2008.

  1. #1
    Hi, I am new to PHP and need some help. I want to learn what code to use in order to track a product properly. I am promoting a clickbank product through a landing page with google adwords.

    What code should I use within the landing page to track and also to cloak the links. Also what is a good way to check if the tracking actually works?

    I was going to use this. Anyone have any better suggestions?

    1. initial link ---> http://www.mywebsite.com/test.php?tid=50
    2. landing page link -----> http://www.mywebsite.com/index.php

    index.php....redirects to the clickbank product --->

    http://myid.productid.clickbank.net/?tid=

    code: landing page

    <?php

    $seedvar=$_GET['id'];

    ?>

    code: index.php

    <?php
    $seedvar=$_GET['id'];
    $link = "http://myid.productid.clickbank.net/?tid=".$seedvar;
    header("Location: $link");
    ?>


    I am not certain whether this code is right, please correct it if it is wrong. Thank you

    Jack
     
    hello340, Oct 22, 2008 IP
  2. bartolay13

    bartolay13 Active Member

    Messages:
    735
    Likes Received:
    14
    Best Answers:
    1
    Trophy Points:
    98
    #2
    use a global variable
    dont put your variable in the url

    try to search more about $_SESSION

    session_id(), $_SESSION['name'] is what you need
     
    bartolay13, Oct 22, 2008 IP
  3. Kyosys

    Kyosys Peon

    Messages:
    226
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #3
    session_id is actually not important, but you miiiiight want to look into session_start(); :p
     
    Kyosys, Oct 22, 2008 IP
  4. bartolay13

    bartolay13 Active Member

    Messages:
    735
    Likes Received:
    14
    Best Answers:
    1
    Trophy Points:
    98
    #4
    ofcourse there an opening of session_start() before every predefined session functions..
    why didnt i think of that. ^^
     
    bartolay13, Oct 22, 2008 IP