Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make Content Grouping work in Google Analytics?

I am trying to group my content using the Content Grouping feature in Google Analytics. My website has two main groupings - "Red Products" and "Orange Products".

Under each grouping my products are divided into groups like "Pressing", "Diagnostics" under "Red Products" and "Power Tools", "Saws" under "Orange Products".

I went to the Google Analytics dashboard and in the admin tab I created two groupings for "Red Products" and "Orange Products" with slots 1 and 2 respectively. On each page under every group I am sending a "_setPageGroup" from my script. For my "Pressing" category every page under it sends this:

_gaq.push(['_setPageGroup', '1', 'Pressing']);

My "Saws" category sends this:

_gaq.push(['_setPageGroup', '2', 'Saws']);

I created a custom dashboard in Google Analytics where I put my "Red Products" grouping as a dimension and PageViews as a metric for this dimension. I did the same for the "Orange Products" category. I visited some of the pages and after some time I checked my custom dashboard. It didn't categorize my content.

Content Grouping

At first I thought that I am not sending the category correctly and I decided to check with my Chrome Google Analytics debugger plugin. Here is what it shows:

_gaq.push processing "_setPageGroup" for args: "[1,Pressing]"

The debugger plugin also shows:

Screen Resolution        : 1920x1080
Browser Size             : 1899x971
Color Depth              : 24-bit
Page Group               : 1:Pressing
Cachebuster              : 1887104810

I think this is an indicator that it correctly categorizes my "Pressing" group under slot 1.

Why it doesn't show anything in my custom dashboard in Google Analytics? How much time does it take to update the metrics?

like image 711
Tosho Toshev Avatar asked Feb 10 '15 15:02

Tosho Toshev


1 Answers

It looks like you're calling _gaq.push(['_setPageGroup', '1', 'Pressing']); after the pageview call has been sent. When you're setting something in GA, you need to send it with a pageview or an event. Take a look at the Modify your ga.js snippet dropdown on Create/edit Content Groups. You're best bet would be to set this before the base pageview call, similar to how you're setting the custom variable for "IsAuthenticated".

like image 139
Blexy Avatar answered Nov 11 '22 16:11

Blexy