Cross domain tracking [modified]
-
Hi, I have two sites (domain1 asp.net web application and domain2 perl web booking application). Currently, a user clicks a button on domain1 to start their journey, they are then sent to domain2. On domain2 the user clicks a button to complete their journey. This is what I want to do, when the user clicks the button on domain1 to start their journey, a cookie is saved and when the user clicks the button on domain2 to complete their journey the cookie is updated. This will allow me to record how many people who started the journey, completed it. I know cross domain cookies are an issue however i've heard of people using the image tag to get round this problem by placing a hidden image on the pages where the buttons are and setting it's src in script to a page elsewhere. I've seen solutions in php for this but i don't know php and need a .net or classic asp solution. I also need to send the cookie info to a database but thats the easy bit. Any ideas?? -- modified at 4:15 Tuesday 3rd July, 2007
-
Hi, I have two sites (domain1 asp.net web application and domain2 perl web booking application). Currently, a user clicks a button on domain1 to start their journey, they are then sent to domain2. On domain2 the user clicks a button to complete their journey. This is what I want to do, when the user clicks the button on domain1 to start their journey, a cookie is saved and when the user clicks the button on domain2 to complete their journey the cookie is updated. This will allow me to record how many people who started the journey, completed it. I know cross domain cookies are an issue however i've heard of people using the image tag to get round this problem by placing a hidden image on the pages where the buttons are and setting it's src in script to a page elsewhere. I've seen solutions in php for this but i don't know php and need a .net or classic asp solution. I also need to send the cookie info to a database but thats the easy bit. Any ideas?? -- modified at 4:15 Tuesday 3rd July, 2007
The image URL should work like any normal ASP.NET page, just set the cookie, probably based upon the GET variables. (Look up Response.Cookies and Request.QueryString.) Using an tag seems a little bit like a hack and therefore I wouldn't guarantee it would be totally future proof though. Instead I would just use a hidden IFrame, which expects a normal HTML source instead of an image. In domain2 you just set your cookie like normal . If clicking the button is what sends the user to domain2, why not skip any cross domain cookie access and just POST the data ala a form to domain2 when they click the button instead of it being a vanilla link. That would seem to me to be the cleanest approach. Domain2 can then set its cookie appropriately based on the POST (see Request.Form).