- This topic is empty.
February 27, 2010 at 4:33 pm #28195
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!February 27, 2010 at 6:40 pm #71155matt25Participant
What is the context just so I can further understand what you are trying to do here?
MattFebruary 28, 2010 at 1:28 pm #71760
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:
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?February 28, 2010 at 2:39 pm #71763matt25Participant
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.
MattFebruary 28, 2010 at 6:31 pm #71774
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!
- The forum ‘Back End’ is closed to new topics and replies.