Google Analytics custom filtering

I have a client with a sort of complex setup. We host most of their site, so we can manage URLs and page titles. However, their press releases are hosted offsite, where we have very limited control. Unfortunately those are files on which they need very specific reporting. They need to see aggregate page views to these pages as well as be able to look up views to specific press releases. The page URLs are unintelligible, and the names have nothing in common, but all of these pages are in the same folder on this offsite host.I can get aggregate numbers in the Content Drilldown report, since they're all in the same folder. However, in the Content by Title report, the client gets frustrated at having to search for the desired page name, because there are so many other page names on the site--and since the press release page names don't have anything in common, we can't do a search for the common term to reveal all of the press releases.To get around this, I needed to create a profile and filter that preserves the folder structure of the press releases, but replaces the file name in the URI with the page title. This will let us use the Content Drilldown report for everything, and when we navigate into that press release folder, we can see the page names instead of the unintelligible URLs. Bam. Best of both worlds. Here's the filter I set up to make this happen:Step by step, here's what the filter's doing:

  1. Field A: ^/portal/site/PR/ - Starting at the beginning of the URI, looking at the URI and matching it with the folder that houses my press releases. We don't care about any other content, so that's the only one we'll mess with.
  2. Field A: ( and ) - Putting that value into a variable called $A1.
  3. Field B: (.*) - Getting the whole page title, and putting that into the variable $B1.
  4. Constructor: $A1$B1 - Putting the two together.
  5. Override Output Field: Yes - Rewriting the page's URI with the new, modified one.

A few things to keep in mind:

  • Before you do anything like this, create a new profile. You don't want to muck up the master profile, because once you do, you can't go back.
  • Since we're rewriting the URL, you can't click through to source pages from reports anymore. GA has the wrong record of the URL. It's a good sacrifice here but could be a pain in other circumstances.

I think that's it--any questions, let me know!

Previous
Previous

A (posthumous) shoutout to Joe Williams

Next
Next

Could Ben Taylor please be cooler?