I am creating an app that requires to know if the visitor visiting the app is a unique visitor or an already visited visitor. I know we could persist a cookie on the visitor's computer to know identify this.

What I would like to understand are the different other ways that can be used to know to keep track of unique and existing visitors? How does Google Analytics know whether it is a unique visitor or an existing visitor?

Can I use browser fingerprinting (https://panopticlick.eff.org/) to know unique visitors/ existing visitors?


2 Answers 2


Unique visitors are identified by GA using the __utma cookie set by analytics. Here is a official article on Cookies used by GA. You could refer to these cookies by reading them using your server side script.

If you have a login system in your app, you could try setting a customvariable as the user id (which would be unique). Here is the document on Custom Variables in Google Analytics.

  • So, if the cookies are deleted, then GA identifies it again as a Unique Visitor? Commented Apr 6, 2013 at 7:39
  • Yes. Also, if the user opens the app using two different devices or browsers, then GA will also tag them as different unqiue visitors. There is a separate article on Universal Analytics (which supposedly addresses this issue (support.google.com/analytics/answer/2817075). Although I must confess that I do not have any hands on experience with UA. Commented Apr 6, 2013 at 8:56

If you are rolling your own...

Just to clarify... I think most tracking systems will see the user agent (browser) as the "visitor". It's not possible to track real people unless you have some authentication/login in place. Most normal users will tend to use just one browser, but often on more than 1 device these days - so 1 real person is likely to equate to more than 1 visitor.

The IP address alone is not sufficient, since it can be shared by many many users (behind NAT).

So, if you reside to the fact you are tracking user agents then, in an ideal world, the cookie is king. However, not every user agent supports cookies (or has them enabled) - robots, for instance, generally do not have cookies enabled. So, unless you are filtering this traffic by some other means (by analysing the user agent string for instance) then your visitor stats are going to be seriously skewed.

A simple way to workaround the no cookie issue is to fall back to checking user agent string + IP address. Checking a browser fingerprint is a bit overkill in my opinion, and possibly too slow.

Bear in mind that no one system is perfect. Different systems tend to return different results depending on what they consider a visitor to be.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.