Page 1 of 1
How to track a purchase from a client by cookie?
Posted: Fri Mar 03, 2006 6:12 am
by bigjl
I know cookie can store some information on client machine and it will automatically pop up client's details when the client relog the system.
I tried to think over the way that cookie can access outter websites and get information whether the client has made a purchase or not, but couldnt find a sulotion.
I dont understand how they track a client till the client makes a purchase, even the client makes the purchase the next time with a quote number.
Any of you guys know how the affiliate program tracking work?
Please help me.
Thank you very much
Re: How to track a purchase from a client by cookie?
Posted: Fri Mar 03, 2006 6:43 am
by shiznatix
your question does not make much sence. from what I understood there are 2 websites abc.com and xyz.com . Someone buys something from abc.com and it saves a cookie on their computer and then you want xyz.com to be able to read that cookie? Thats impossible (and would be a HUGE security issue if it was possible).
If you ment that you just want to be able to use a cookie and read the information on the same website then look at setcookie() and use the $_COOKIE super global.
Re: How to track a purchase from a client by cookie?
Posted: Fri Mar 03, 2006 7:06 am
by onion2k
shiznatix wrote:your question does not make much sence. from what I understood there are 2 websites abc.com and xyz.com . Someone buys something from abc.com and it saves a cookie on their computer and then you want xyz.com to be able to read that cookie? Thats impossible (and would be a HUGE security issue if it was possible).
It's not impossible if you control both the domains. You can get the cookie value from abc.com by setting up a series of forwarders. You simply create a page on abc.com that, when the user hits it, takes the value of the cookie and appends it to a URL as a GET variable, and forwards the user again.. eg
1. User arrives at xyz.com with a cookie set for abc.com.
2. Forward the user to abc.com/cookie.php
3. cookie.php takes the abc.com cookie value and sticks it on the end of index.php .. eg index.php?abccookie=sdfkjnsjkdnfunidviv
4. cookie.php then forwards the user to xyz.com/index.php?abccookie=sdfkjnsjkdnfunidviv
Ta da! xyz.com knows what the value of the cookie set at abc.com is. But you need to control both domains, and it'll only work for stuff where the cookie value doesn't need to be secure.
Re: How to track a purchase from a client by cookie?
Posted: Fri Mar 03, 2006 8:44 am
by bigjl
onion2k wrote:shiznatix wrote:your question does not make much sence. from what I understood there are 2 websites abc.com and xyz.com . Someone buys something from abc.com and it saves a cookie on their computer and then you want xyz.com to be able to read that cookie? Thats impossible (and would be a HUGE security issue if it was possible).
It's not impossible if you control both the domains. You can get the cookie value from abc.com by setting up a series of forwarders. You simply create a page on abc.com that, when the user hits it, takes the value of the cookie and appends it to a URL as a GET variable, and forwards the user again.. eg
1. User arrives at xyz.com with a cookie set for abc.com.
2. Forward the user to abc.com/cookie.php
3. cookie.php takes the abc.com cookie value and sticks it on the end of index.php .. eg index.php?abccookie=sdfkjnsjkdnfunidviv
4. cookie.php then forwards the user to xyz.com/index.php?abccookie=sdfkjnsjkdnfunidviv
Ta da! xyz.com knows what the value of the cookie set at abc.com is. But you need to control both domains, and it'll only work for stuff where the cookie value doesn't need to be secure.
Ok. let me put it straight.
There are 3 websites out there.
abc.com is affiliate website contains ads
my.com is my website
xyz.com is the website owns the ads which put on abc.com
A client clicks the ads on abc.com.
The link points to my.com to store some details of the client.
Then the link redirect to xyz.com.
I need to track all routine that the client takes and need to know whether the client has made a purchase on xyz.com.
Will that be possible?
Posted: Fri Mar 03, 2006 8:50 am
by neophyte
If all the sites are on the same server:
Give the user a unique token at purchase by writing it to a query string and in a db
When they get to the next site check the token vs. db
If it is write the token to a cookie/session for that site.
???
Posted: Fri Mar 03, 2006 8:50 am
by feyd
You can't read cookie data from another domain (XSS aside). So unless they tell you by sending the user or a request back to a url or some other communication, you're out of luck.
Posted: Fri Mar 03, 2006 10:20 am
by bigjl
feyd wrote:You can't read cookie data from another domain (XSS aside). So unless they tell you by sending the user or a request back to a url or some other communication, you're out of luck.
So that means it is not possible to build a cookie cross 3 websites. right?
There has to be a intergration between mysite and xyz.com.right?
But how those affiliate program tracking system work? Any of you guys knows?
Posted: Fri Mar 03, 2006 11:30 am
by bigjl
I just came up with an idea that I can put some code inside xyz.com and when a client visit to the certain page with my code in it. My code can send something back to my.com. That means i need to control the cookie through javascript. right?
Can i do that?