Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Saving and passing variables in a URL string

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #28195
    RThompson
    Member

    I’m hoping someone can put me on the right track here –

    I am passing tracking ID’s to my website in the URL (ie. /?tid=xxxxx).

    How can I use PHP to capture this tracking ID in a cookie on the visitors machine and then pass it along when they click an external link from my site to a different domain? Is a cookie the right way to do this, or is there a different way? I just picked up a PHP book and I’m up to teaching myself, but I need a little guidance.

    Someone please nudge a PHP n00b in the right direction!

    #71155
    matt25
    Participant

    What is the context just so I can further understand what you are trying to do here?
    Matt

    #71760
    RThompson
    Member

    I’m basically wanting to track paid search (PPC advertising) keywords from Adwords –> My Site –> Another site where my visitors will go to purchase a product.

    I can identify the incoming clicks with a unique tracking ID in the URL, such as:

    http://www.mysite.com/mypage?tid=xxxx

    Where the tid portion of the URL would be a unique number related to the keyword that triggered my Ad to display.

    Once the visitor arrives on my site, my ultimate goal is to have him/her click a link to another site where they can buy a product and earn me a commission. When they click that link I want to pass the tid=xxxx string along to the external site so if they do make a purchase I can see which tid is related to the sale. That way I can see which Adwords keywords are more likely to generate a sale, and thus worth a higher CPC bid.

    HOWEVER, when they reach my site they will not always go from my page directly through to the merchant’s site. They may click around my site, read articles, browse other product recommendations, etc….I want to figure out a way to use PHP to make sure that tid number stays with the visitor as they click around my site, so I can pass it through to the merchant site when they do eventually click my links leading away from my site.

    Does that make sense?

    #71763
    matt25
    Participant

    You can keep the tid by putting it into a cookie like this:

    Code:

    That will set a cookie with the tid so it can be used again, but you can’t find out if someone has bought something from another site without access to it or them having an affiliate system inplace. You can track outgoing links with google analytics though if that helps.
    Matt

    #71774
    RThompson
    Member

    Thanks Matt, that’s really helpful. These are affiliate programs I’m working with, so if I pass the tid in the string and it converts to a sale I’ll be able to see the ID# associated with that sale in the affiliate stats reports.

    I appreciate your advice!

Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘Back End’ is closed to new topics and replies.