Cool Custom Report: Versions of Android

Want to know Android visitors’ version number? Quick custom dimension how-to for Webtrends Analytics.

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:


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:

 Android ([0-9]+\.[0-9]+\.[0-9]+)


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).









Cross-Reference Your Custom Reports + Profiles in a Matrix, Using Excel

You can have a matrix of how your Webtrends custom reports are assigned to your various profiles. Essential.

A print of this spreadsheet is hanging on my office wall.  I use it constantly.  It is a MUST-HAVE for anybody doing custom reports in Webtrends.

The housekeeping of Webtrends Custom Reports involves a whole lot of clicking and waiting and copying and pasting.   “Johnny Mitchell” has solved most of the drudgery with an Excel macro he published on the Webtrends Developers Forum.  It is amazing for:

  • Making sure all the right custom reports are in each profile
  • Reducing redundant use of custom reports that are in too many profiles (for OnDemand users, this will drive up your custom report token use)
  • Instantly showing what profile you should open if you are looking for a particular custom report

The spreadsheet is a grid showing all your profiles (in the columns) and all your custom reports (in the rows).  Each cell in the grid is colored, or not, depending on whether that report appears in that profile.

It is incredibly easy to use.  Everything is done with an Excel macro.  Open the downloaded spreadsheet, run the macro, supply your Webtrends On Demand credentials, and stand back.

Oh, and a nice touch is that, for each custom report and profile, it displays the name plus the UID.

The original post on the Webtrends Developers Forum has a little more detail as well as a link to download the Excel workbook that contains the macro.

All Hail “Johnny Mitchell” !