Google Analytics - User Defined visitor tracking
As I finished the tutorial on the visitor Network Properties in Google Anaytics, I saw that the next section for reporting is the “user defined” section. I honestly thought it would be a simple two paragraph post. I haven’t yet been able to use the “user defined” reporting, and was under the very wrong impression that it’s simply a ‘hotwire’ mechanism that enables users to add tracking for variables that Google hasn’t yet included in the suite. And while I’m sure that it could be used for that, the real purpose is to provide an extremely powerful and useful means of segmentation and A/B (and even C!) testing within Google Analytics.
Here is what the basic screen looks like. As I mentioned, I haven’t set any custom variables yet, so it isn’t all that exciting.
![]()
To set a variable (or create a visitor segment), you don’t actually do anything within Google Analytics itself. You need to add a small line of code to your page, and that creates the segment. The code is simply:
__utmSetVar(”variable name”)
The code would be added after you called the Google Analytics tracker code on the page (http://www.google-analytics.com/urchin.js).
So, what can you utilize the “user defined” reporting for? Well, it’s really only limited by your imagination, which ways you can think to segment your traffic and test different content and creative. Here are a few examples:
Visitor Type Segmentation
This is the example given within Google Analytics itself. Suppose you have a form on your site in which you capture the visitors’ job titles. You could load those titles into the _utmSetVar, and track the value of different visitor segments on your website. Think about it, you could track these through to conversion, and derive such metrics as:
- Executive level visitors are xx% more likely to lead to an eventual sale, therefore we should be advertising in more networks/websites/magazines that cater to executives.
- Technical users are xx% more likely to download our whitepapers, so we should be including more technical specs, how we out-perform the competition.
If you don’t have a form or any mechanism whereby visitors can define their own title, there’s another way you could accomplish that. If you take a look at the homepage of SAS.com, you’ll see “Recommended Starting Points”, targeted content for different visitor personas. On the start page of each, you could call the _utmSetVar function there, and assign a visitor to that segment.
Landing Page Segmentation
It’s very common to create multiple landing pages. These could be for different events/promotions, or you could be creating unique landing pages for one campaign, but visitors would be arriving from different sources (e.g. a banner ad, a postcard, and an email). If the user types the URL into the address bar directly, you can’t really track where they’re coming from, so it’s most effective to use unique URLs for each.
However, it would be a pain, and create a lot of redundancy to duplicate the conversion form for each promotion as well (unless the form is embedded in the landing page). So, it would be simplest to use a single point of conversion, but segment visitors by the landing page. You could do this through Navigation analysis, but the simplest way to compare landing page effectiveness is to use the _utmSetVar function on each landing page, and create a unique segment for each. That way, you can click the “Goal Conversion” tab, and see a very quick snapshot comparing the conversion rates of each. This can help you determine your best landing page, and even which advertising medium provided the highest ROI.
Referrer Segmentation
Google Analytics referrer tracking is OK, but it leaves something to be desired. You can see the site and page that a visitor came from, but any parameters are left out. This is fine in most cases, but if you are running ads on any dynamic site, you can’t tell which exact page your visitors come from.
For example: say you’re renting a few forum signatures in a single forum. You have no idea which signature has referred the most visitors, without providing them each with their own unique tracking code.
Well, you can either use Reuben Yau’s refferer hack, or you can also do this with user defined variables. You could simply add _utmSetVar(document.referrer) to your code, and that will create a segment for each full URL. Alternately, you could parse just the querystring parameter out of the referrer string (such as the thread or page ID) using JavaScript or server side scripting, and call _utmSetVar on that. That way you’ll be able to track your visitor segments to the exact pages they’ve come from.
Creative A/B Testing
One of the coolest ways you could use _utmSetVar is to track different calls-to-action on one page! For example, say on your landing page you had a “buy now” splash image at the top. Then you have some content down the page further explaining the offer, and at the bottom another “buy now” link to capture them once they’re read all the details. You could define each link as a separate segment, and track which placement, image, wording, etc is most effective.
The code would look like this:
<a href=”buy.htm” onclick=”_utmSetVar(”link 1″)><img src=”buy.jpg” /></a>
Content content content
Content content content
Content content content
<a href=”buy.htm” onclick=”_utmSetVar(”link 2″)>Buy now!</a>
In your User defined report, you should be able to clearly see which of those two links drove higher conversion rates!
Conclusion
As you can see, while the “user defined” section is empty by default, it’s potentially one of the most functional reports in the entire suite!







on August 16th, 2007 at 10:01 am
Thank you for this nice article!
I have been experimenting with the “user defined” function on a specific website and came to the following conclusion: once a visitor has been tagged with a specific segment (_utmSetVar(”segmentX”)) it is not possible to tag it again, within the same session.
I discovered this while trying to track not-registered visitors vs registered ones. At first, visitors were tagged “not-registered” and once they went through the registration process, i tagged them “registered”. Unfortunately, i found in the GA reports that registered users kept the first assigned segment.
Any ideas, thoughts, advices on this matter?
on August 16th, 2007 at 11:53 am
Paul,
that’s an excellent question, I haven’t yet run into that problem myself. Off the top of my head I wonder if you couldn’t manually expire the cookie upon logging in, which would effectively initiate a new session for the user. But I’ll have to look into it further
on September 2nd, 2007 at 9:12 am
Paul,
I’ve been digging around, and haven’t been able to figure out how to reset or delete the variable. Maybe you should contact support. If you do locate an answer, please post it here!