: 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
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>
More posts by @Pierce454
1 Comments
Sorted by latest first Latest Oldest Best
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.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.