Other
December 7th, 2009 @ 15:12
For a while, there’s been a possibility to separate your users in various segments in Google Analytics, by setting a (single) variable in the Analytics cookie, for example:
pageTracker._setVar("member-premium-true");
Earlier this year, Google introduced the neat possibility to use multiple custom variables, allowing more customization and flexibility. You are allowed to use five slots (1-5) and set a name, value and scope to your variable.
The old setVar method has been deprecated and replaced by the new setCustomVar:
pageTracker._setCustomVar(
1, // This custom var is set to slot #1
"Member Type", // The name of the custom variable
"Premium", // The value of the custom variable
1 // Sets the scope to visitor-level
);
pageTracker._trackPageview();
This isn’t really news, but it wasn’t obvious what had happened by just looking at the Google Analytics API docs, so I thought I’d mention it here just to “spread the word”.
<script type="text/javascript">
pageTracker._setVar('member-premium-true');
</script>
Flash & Flex
September 23rd, 2009 @ 17:09
I recently discovered that some of our stats in Google Analytics looked a bit suspicious. When looking into it, I remembered that there was a previous issue in the ga.js tracker, causing usage of user-defined variables, setVar(), to be tracked as pageviews. These pageviews corrupted stats like bounce rates and time on site.
Google fixed this issue in January, but the latest GA for Flash release is from December. So there’s a big chance that the bug still remains in the ActionScript version. I’ve posted a question in the GA for Flash discussion group, but as the group seems to be full of porn spam, I’m not very hopeful in getting an answer right now…
Also, some of our stats were missing data about screen resolution etc and I fear that the Flash tracker and setVar() is the root of that as well (since it’s working fine in products where setVar() isn’t used).
Anywho. I’ve not yet confirmed that this bug is still there, but an easy solution is to use Google Analytics for Flash in “Bridge mode“, instead of “AS3 mode”. This means that the ga.js file is used, which is a guarantee that the latest official Google updates are always used.