Last week I ran into an interesting situation. I wanted to create a profile for a specific subfolder in Google Analytics. And I only wanted the events that where launched from pages within that subfolder to be reported there. This graphic shows you the situation:
A visitor lands on the homepage, he than goes to the French subfolder (what is a virtual folder because the entire site is working with AJAX). And than he decides to read some Dutch texts to have a good laugh about the weird language. On both pages he prints out the text he found there, what is being measured with Google Analytics' event tracking system.
Nothing strange now right?
Well, when I created the French profile with a specific "Include request URL" filter on it:
But the Event Tracking report stayed empty? As a Google Analytics technology nerd I wanted to get to the bottom of this.
To which pages are events attached?
The first question I needed to find out is to which pages the events are attached to. If you take a good look at the request that is being send to Google you will see this:
In the UTME parameter are the event values: the category and the action. And as you can see: in the UTMP parameter is the URL that was in the browsers' address bar (%2F stands for /). Not the last virtual pageview URL, not the last real URL, but the actual URL in the address bar.
So the conclusion is: if you want to filter events, you need to filter the pages they were fired from. And if you're working with virtual pageviews you definitely have a problem.
It could be that your site reports 100 URL's in the Top Content report. But there could also be an extra 100 'hidden' URL's that weren't tracked with a trackPageview but did fire a trackEvent. You can find these url's in the Event reports:
Click on the 'Page' item and see which URL's are attached to the events. It could be that these URL's are not in the Top Content report at all. If I created a filter that would only include these URL's it could be that the profile would show 0 pageviews and 100 visits.
Is there a solution?
Well, not really. In most cases a filter on the right folder will work perfectly. Because most events are fired after a trackPageview call that used the URL from the address bar. But if you have a Flash/AJAX site, or some Game/Campaignsite that only uses events on special URL's you need to work out a proper solution.
In my opinion Google should attach events to the last URL that was being send with the trackPageview command. What are your thoughts?