3

If a site visitor clears cookies, uses various browsers or computers then Google Analytics will have a hard time detecting them as being by the same user.

However since 95% of the site content is only available when logged in, so I should be able to identify multiple visits as the same user so long as they log in.

How can I help Google to identify that the visits are by the same user? (without breaking the Terms and Conditions)

0

If I understand your question, I think should try to send to Google Analytics the user identifier (aka "User ID"), as specified on their documentation:

https://support.google.com/analytics/answer/3123662?hl=en

The User ID enables the association of one or more sessions (and any activity within those sessions) with a unique and persistent ID that you send to Analytics.

To implement the User ID, you must be able to generate your own unique IDs, consistently assign IDs to users, and include these IDs wherever you send data to Analytics.

For example, you could send the unique IDs generated by your own authentication system to Analytics as values for the User ID. Any engagement, like link clicks and page or screen navigation, that happen while a unique ID is assigned can be sent and connected in Analytics via the User ID.

| improve this answer | |
  • Thanks for pointing out this new feature! After a bit of digging I notice that the GA TOS has been amended to remove the clause in my answer. They have replaced it with the following, which you must accept to enable User-ID tracking in the Analytics account: You will not upload any data that allows Google to personally identify an individual (such as certain names, national insurance numbers, email addresses or any similar data), or data that permanently identifies a particular device... it goes on further. I haven't added the feature to my site yet but am hopeful. – Craig Nov 23 '16 at 13:05
  • 1
    You don't need to identify the user in Analytics, you just need Analytics to have a common identificator to each user, so you can try passing, for example, the user ID in your database or, even better, the user's email in MD5. Google is not able to identify it, so you will be al right. This is also recommended by some third parties like Criteo: support.criteo.com/hc/en-us/articles/… (for example). – Alfonso Moure Nov 25 '16 at 16:35
1

Saving the GA cookies on each page view and then restoring them if they were not present on the users next login would have the desired effect. Storing the cookie data in a database against a user id would not be against the GA TOS http://www.google.com/analytics/terms/us.html

You will not (and will not allow any third party to) use the Service to track, collect or upload any data that personally identifies an individual (such as a name, email address or billing information), or other data which can be reasonably linked to such information by Google. You will have and abide by an appropriate Privacy Policy and will comply with all applicable laws and regulations relating to the collection of information from Visitors. You must post a Privacy Policy and that Privacy Policy must provide notice of Your use of cookies that are used to collect traffic data, and You must not circumvent any privacy features (e.g., an opt-out) that are part of the Service.

Google provide server-side code to read the cookies that could be used as a starting point: https://developers.google.com/analytics/devguides/collection/other/mobileWebsites and here is a (slightly old) blog post explaining the cookie data: http://blog.vkistudios.com/index.cfm/2010/8/31/GA-Basics-The-Structure-of-Cookie-Values

| improve this answer | |
  • I successfully used this method for a number of years but Google have now added a feature to Analytics to do it properly, see Alfonso's answer – Craig Nov 23 '16 at 13:09
0

Actually, if your system allows to identify the user of your system personally (e-mail, surname etc., FB/Google login), then you'll definitely breach the agreement.

But in order to detect the same user you have to be able to "connect the dots" - which requires personal identification as I consider. Your interest in aggregated data should be called fair use. And Google doesn't treat you as a fair player at any point of time. Thus, you'll need to gain user's consent for fair tracking and do it yourself.

| improve this answer | |
  • That's exactly what I want to avoid. Apart from breaching the agreement, the exact browsing habits of individual users is of no interest. I'm only interested in aggregated data but over a wider context than google supports by default (sessions). – Craig Nov 3 '12 at 0:16
  • @AB In the post you linked to, you seem to suggest it would be possible and offered some steps to achieve it. Have I misunderstood? – Craig Nov 3 '12 at 0:34
  • No, there was a need to identify users, but not against the will - once they reset the session, they'll have new identity. Your problem lies in question: detecting them as being by the same user. – berezovskyi Nov 3 '12 at 0:50
  • And I just now realized that you problem is deadlock in its root. So I edited my answer. – berezovskyi Nov 3 '12 at 0:51
  • If I saved the GA cookies on each page view and then restored them if they were not present on the users next login this would have the desired effect without identifying the user individually, which I think is a variation of your earlier edited post and wouldn't break the agreement. – Craig Nov 3 '12 at 1:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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