views:

2317

answers:

5

We have several websites on different domains and I'd like to be able to track users' movements on these sites.

  • Obviously cookies are not feasable, because they don't cross domain borders.
  • I could look at a combination of IP address and User Agent, but there are some cases where that does not work.
  • I don't want to use flash or other plugins.

Any ideas? Or am I doomed to rely on the IP/User_Agent combination?

+13  A: 

You can designate one domain or subdomain to tracking and have it serve a 1x1 pixel image which you include in all pages you would like to track. Serve a cookie with the image, look at the tracking domain's server logs, voilà.

Simon
That won't work. Internet Explorer default security settings won't allow pictures from other domains (or iframes) to set any cookies.
BlaM
... okay, revised: will work if I take http://support.microsoft.com/kb/323752/EN-US/ into account :)
BlaM
Wow, I actually didn't know that IE6 does this - I haven't used frames much recently. So you have to use the HTTP headers trick, or does setting cookies work when not using frames?
Simon
err, nevermind. I should read before posting...
Simon
The problem that this is require extra work to be done. You have to include that in every page you need to track.
mnour
+3  A: 

This question is closely related to the Question Accessing Domain Cookies within an iFrame on Internet Explorer.

For Internet Explorer I need to take P3P Policies into account and set an additional P3P HTTP-Header to allow images to set cookies across domain borders. Then I can use simon's suggestion.

BlaM
A: 

You can follow the same concept used in Google Analytics. Injecting javascript in the pages you want to track.

mnour
I could, but how would that help me to track users across domain borders?
BlaM
There are different types of tracking.Google Analytics will let you look back at a history of your many visitors behaviour, even crossing domains. Another type of tracking such as PHP session tracking is used to control what content is served to a single visitor.
Liam
google analytics does exacly what simon said, and it injects an 1x1 pixle image, this is how it can track across multiple domains, and it does this injection by JS
solomongaby
+2  A: 

You do not give any context to your situation -just the basic problem. So it is difficult to give an answer that clearly fits. However, here are some techniques/mechanisms for passing information from one page to another, regardless of what domain is involved.

  • include hyperlink to a 1x1 pixel transparent gif image (sometimes called a "beacon")
  • rely on referrer information in HTTP request headers to identify page hyperlink is on
  • include extra parameters in hyperlinks to other site - assuming you run both sites
  • buy services of a company like Akamai to do user tracking for you
  • possibly use cross domain cookie mechanism in the future if standard is ever approved

Which techniques really come down to whether you can place software on all of the sites (servers) that the user will visit where you have interest - or you cannot place your software on all of them.

JohnnySoftware
A: 

What about using the IP Address of the user to track your domains visits. You can make a javascript file and include it in your pages. I choose the IP because it's almost the only thing which will not change across domains.

You can get the client IP using javascript like the following: http://bytes.com/forum/thread92174.html

Within your javascript, you can send the IP address to some external tracking domain along with any required information like the time of the visit, browser type ... etc.

mnour
IP addresses are not reliable and cannot be used for identification. If you use them for casual purposes, it's OK, but many people sitting behind (for example) corporate firewalls can get different IP addresses every hit.
Ovid
There is no one way which guarantee to work all the time. Even cookies alone won't be enough. I have stated one of the ways. In tracking you need to combine one or more ways to identify a specific visitor.
mnour