Google Analytics tracking
February 11, 2008 12:04 PM   Subscribe

Google Analytics: Can I track the different content sections of my site, even though the sections aren't part of the URL?

I run a network of topical blogs, each of which writes in one of ten categories. The categories aren't part of the URL (or the title), so at the moment I have no way to filter or track pageviews by those categories. Is there a technique I haven't found? Campaigns doesn't seem to be the right thing, but maybe I'm wrong.

It would be especially great if the solution can handle it when the blog posts are assigned to more than one category.
posted by crickets to Computers & Internet (6 answers total) 1 user marked this as a favorite
 
You would have to setup multiple sites and use a different identifier across each one. It's the only way I can think of.
posted by purephase at 12:21 PM on February 11, 2008


Best answer: I had a similar problem. At first I thought Google's custom fields would handle it, but those get attached to visitors, so if you set a custom field of "category-1", and a visitor then looks at something in category 2, the second page view still shows up under the "category-1" report. I don't understand why Analytics doesn't have some way to attach reportable meta-data to specific page views.

What I ended up doing was creating a subdomain for each category, including that subdomain with analytics code in a 1-pixel iframe moved off-page with CSS, and attaching a separate analytics report to each subdomain. To get useful information about the pages, I repeat the current URL in calling the iframe, and then use mod-rewrite to point all requests on the subdomains to the same page. If you search the source of this page for "iframe", you can see an example of how this works.

That's only a solution if you have a host with plenty of subdomains and you don't mind creating a new one for each category. If anyone has a simpler solution, I'd also love to hear it. You might also submit a feature request to Google and hopefully they'll make this easier soon.
posted by scottreynen at 1:45 PM on February 11, 2008


You can force "custom events" into GA using javascript calls. You define virtual directories and then add a virtual page view.

For instance using the download onclick javascript I log PDF downloads into virtual folders called "/custom_events/downloads/pdf/filename.pdf". Then I use a filter in GA to only display these virtual page hits.

You could use this javascript "onBodyLoad", or could try the GA javascript event tracker code instead - just run it once per category on the page load.
posted by the_very_hungry_caterpillar at 2:41 PM on February 11, 2008


Response by poster: scottreynen & the_very_hungry_caterpillar: Won't both of these register an extra pageview that would inflate my numbers? I can't live with that, unfortunately.
posted by crickets at 3:10 PM on February 11, 2008


Won't both of these register an extra pageview that would inflate my numbers?

I think the_very_hungry_caterpillar's suggestion would (though you could maybe create a custom report excluding the duplicates - I might switch to that myself). Creating a subdomain for each category does not inflate your numbers. It still shows up on your original report only once; it just also shows up on the new report for the category subdomain. The two reports are completely unrelated as far as Analytics is concerned.
posted by scottreynen at 3:22 PM on February 11, 2008


crickets you are correct, but (after a little digging) you can add an exclude filter to ignore these extra virtual page views:

user defined > exclude > Requested URI > ^/custom_events/

Voila! Looks good - I will test it out.
posted by the_very_hungry_caterpillar at 9:05 AM on February 13, 2008


« Older Need to know who I'm president of!   |   Lodging in Calistoga? Newer »
This thread is closed to new comments.