Resource icon

Track Usergroups in Google Analytics

AzzidReign

Well-known member
Hi @DBA I'm coming back to this now. Why is there a "1" after the </xen:if>?

And why do we need it to look like:
'Registered-2',

And now just "Registered"?
 
Last edited:

DBA

Well-known member
Hi @DBA I'm coming back to this now. Why is there a "1" after the </xen:if>?

And why do we need it to look like:
'Registered-2',

And now just "Registered"?
99% sure that this doesn't work with the new Google Universal Analytics.
 

DBA

Well-known member
Tracking the usergroups? Or just putting "Registered"?

I haven't switched to universal as nothing has really convinced me to yet.
I was referring to the code in general, its been completely changed for Universal.
 

DBA

Well-known member
DBA updated Track Usergroups in Google Analytics with a new update entry:

Updated to work with Google Universal Analytics

Finally updated it to work with Universal.

In Google Analytics go to the Admin tab and select Custom Definitions under your Property. Add your new Custom Dimension's, I only did a Logged-In and Guest.

View attachment 139661

Add the new code to the google_analytics template on your website like this (be sure that your dimension numbers match with the code on Google Analytics):
PHP:
    ga('create', '{$xenOptions.googleAnalyticsWebPropertyId}', 'auto');
<xen:if is="{$visitor.user_id}">...
Read the rest of this update entry...
 

kaieivindm

Active member
@DBA how long after I change the Google_Analytics template, add the code, and the custom Dimensions in GA will it start to track the different user Groups? Hours, days, weeks?
 

DBA

Well-known member
@DBA how long after I change the Google_Analytics template, add the code, and the custom Dimensions in GA will it start to track the different user Groups? Hours, days, weeks?
It should start tracking right away however I think it took a few hours before it showed up in the same day report.
 

ProCom

Well-known member
Wow, it's been a year since this was last replied to... time goes by so quickly!

Is this still a viable way to track usergroups in Google Analytics?

@DBA & @AzzidReign
 

ProCom

Well-known member
I keep hoping that @DBA or another master-coder will come up with a great way to segment / track guests, members, and other user-groups in Google Analytics.
 
Top