The Android operating system has versions. If you’re expecting your site to look good on Android devices using browsers, you want to know how many visitors are using different versions. But Webtrends 9 (and some other analytics products we could mention) doesn’t have an out-of-the-box report on it.
Not a problem; just make a custom dimension then use it in a custom table. This post is a good example of a slightly advanced custom dimension that consists of a subpart of a longer string, which is a capability a lot of people don’t know about. It’ll take about five minutes to do, since we’ve done the research for you.
The gist of it is this: the Android Version custom dimension needs to extract the version number out of the User Agent portion of the SDC (or regular) logs.
To prep for this, we did a little homework since we needed to know what Webtrends has to work with, i.e. how Android appears in the User Agent field in logs. It was pretty easy. We just opened a log we had lying around and looked for mentions of “Android.” It was obvious that the typical Android-using browser inserts something like this in the User Agent field of the SDC logs, as in the following two examples:Mozilla/5.0+(Linux;+U;+Android+2.3.4;+en-us;+DROID+BIONIC+4G+Build/5.5.1_84_DBN-74)+AppleWebKit/533.1+(KHTML,+like+Gecko)+Version/4.0+Mobile+Safari/533.1 Mozilla/5.0+(Linux;+U;+Android+4.0.3;+en-us;+Sprint+APX515CKT+Build/IML74K)+AppleWebKit/534.30+(KHTML,+like+Gecko)+Version/4.0+Mobile+Safari/534.30
From these long strings, all we really care about is “Android+2.3.4” or, to be precise, the “2.3.4” and “4.0.3” parts that appear after the word “Android”.
Reporting on just a portion of that big Agent string is called an “extraction” or, in Webtrends-lingo, “picking out.” Webtrends has a couple different ways to do an extraction and they’re right there in the Custom Dimension creation window when you click the “Advanced” button. When you click on “Advanced” you’ll see three new, kinda wordy radio buttons.
“Use Full String” is the default (it will give you the entire string above that we showed in italics).
The third radio button, using Regular Expressions to extract a substring, is powerful if you know how to write Regular Expressions. In Regular Expression, parentheses “( )” are the operators for extracting. If you don’t know Regular Expressions, find somebody who does — they tend to like puzzles and this happens to be a really easy one where they can look brilliant without spending a lot of effort.
Here are the individual steps to make the custom dimension:
1. Go to Administration > Report Configuration > Custom Reports > Dimensions and click on “New”
2. Give it a name, click on Next and choose “Agent” from the dropdown for the “Value to Base On” window. Then click the “Advanced” button (arrow).
3. The “Advanced” button will refresh the screen and show three radio button choices: “Use Full String,” “Fixed Pattern”, and “Regular Expression.” Select “Regular Expression” and enter:
4. Save and close.
5. Apply it to a new Custom Report with your favorite measures, and you’ll get something like this. (Don’t forget to add it to a Template so your users can find it easily).