Mobile app version of vmapp.org
Login or Join
Pierce454

: Anonymouse versus logged in users on my site & Google Analytics I'd like to be able to run two different 'tracks' for Google Analytics; One for anonymous users of the site and another for

@Pierce454

Posted in: #GoogleAnalytics

I'd like to be able to run two different 'tracks' for Google Analytics; One for anonymous users of the site and another for Users whom are logged-in.

I say "track" because I'm not sure of the term -- but I definitely know I want it to all be in the same "Analytics Account", I just want to segregate my logged-in users.

In the site template, I can very easily add a conditional to display one or the other (Analytics code snippet)... Which I'm hoping this comes down to and although I'm not sure, it seems that the last digit in your Analytics ID (e.g. UA-15XXXX0-X) could be incremented to gain such additional 'tracks'.

My current footer snippet:

<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>

<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-XXXXXXX-1");
pageTracker._trackPageview();
} catch(err) {}
</script>

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Pierce454

1 Comments

Sorted by latest first Latest Oldest Best

 

@Debbie626

The last digit in the Analytics ID (the final X in your example) denotes a specific tracked site. The first portion (UA-XXXXXXX-YY) denotes the Profile the site belongs to (useful for grouping collections of sites when tracking lots).

As far as I'm concerned, the best way to track multiple streams under one Analytics ID - to keep all data under one site's profile - would be to append a new/different UTM tag onto the URL after the user is logged in, and optionally onto all pages during the logged-in session. Creating multiple Analytics IDs and then rewriting the code depending on whether a user is logged in or not can be extra work for no real reason as you can't easily cross-compare between two sites to track anonymous and authenticated users. (I can appreciate you may have a good reason for doing it this way, however.)

Intown Web Design and Google's own Analytics Help pages (specifically the Analytics URL Builder tool) are highly useful resources to learn and experiment with UTM tagging.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme