Cool Custom Dimension: Banish unneeded prefixes from Referring Sites reports
This dimension simplifies Referring Site reports that contain a lot of subdomains, server clusters, or data center identifiers (I’m calling them prefixes) at the beginning of the site name.
For the referrer Yahoo, for example, the Referring Site report can look like this if you are running ads on Yahoo’s network:
All that server cluster information at the beginning of the mail.yahoo.com subdomain makes it hard to see how many visits came from the Yahoo mail site. Here’s the same list with the Yahoo mail referrers highlighted below.
It’s a mess.
What we really would like to see instead of the above is a collapsed list that shows only three parts of the domain name, not all four or five: subdomain.domain.com, or in this case mail.yahoo.com, instead of all the us.mgxxx.mail.yahoo.com craziness. We want all the junk to the left gone, aggregated into a single line item like this:
This can be done with a custom dimension that strips off everything except the rightmost three parts of the site expression. Instead of what’s on the left, above, we want the consolidated version on the right.
Well, it’s quite easy to lop off all that junk. Here are the steps.
- Create a new custom dimension called “Referring Sites, limited to three elements” or whatever you want to call it.
- In the “Based On” screen, choose
“Referring Site (eg:http://www.yahoo.com).” - Click on the button called “Advanced”
- The Based On screen will refresh with more choices. Choose Regular Expression and enter this magnificent regex:

(([^/\.]*\.)?[^/\.]*\.[^\.]*)$

That’s it, save it.
(By the way, while you were in the Advanced version of Custom Dimensions, did you take a look around? That Advanced button gives two ways to show, in your reports, just a portion of a dimension value. Very handy. We’ve discussed the Advanced button before and also used it in the Display Google Organic Ranks post.)
Use this dimension instead of the out-of-the-box Referring Sites dimension whenever you want to limit the number of domain elements to subdomain.domain.com.
And before you get all impressed about what I, rocky, can do with regex … it was entirely Mister Peabody’s work and it took him about 3 minutes.
By the way, this simplified Referring Site dimension is great for evaluating the performance (i.e. the quality of the traffic) of all the Yahoo properties when you are showing ads on their network. Just use the simplified Referring Sites dimension as the primary one, and use something like Content Groups as the secondary one. Or a Scenario Analysis can be the second dimension; use anything that will tell you about key site actions.
Trust me, all Yahoo properties do NOT perform the same, not by a long shot.









2 comments
Well, you can play all modest about that Regex, but, Boy! I can’t even read it!! Great post. As with all other articles on this blog, I’ll file this one in my “Let’s Get Smarter with Webtrends” file.
Hi Jacques, it’s Mister Peabody magic. And it took him, as I said, about 3 minutes including testing. Someday we will learn how to do this.
Leave a Comment