Help Center user segmentation using Google Analytics custom dimensions



Posted Sep 04, 2014

Many customers ask how they can segment out their Help Center activity metrics based on user role. While this isn’t currently possible using the Help Center dashboards, it is quite easy to do using the Zendesk Google Analytics integration and custom dimensions.

Step 1: Enable Google Analytics Site Search Tracking on your Help Center

If you haven’t enabled Site Search Tracking for Google Analytics, follow the steps in this article to enable it on your Help Center.

Step 2: Configure custom dimensions

Google Analytics Custom Dimensions are a way to capture custom information on a user when they visit your Help Center or anywhere where you have Google Analytics tracking enabled.

First of all you must configure your Custom Dimensions in Google Analytics properly. This must be configured in the Analytics User Interface.

Go to the Admin section of Google Analytics and then to Custom Definitions > Custom Dimensions. Create two new Custom Dimensions. Custom Dimensions have the following configuration values:

  • Name – the name of the custom dimension as it will appear in your reports.
  • Scope – specifies to which data the custom dimension or metric will be applied. Learn more about Scope.
  • Active – whether the custom dimension or metric value will be processed. Inactive custom dimensions may still appear in reporting, but their values will not be processed.

 

You should create a custom dimensions named User Role and User Locale that have a Session scope and are active.

 

The first custom dimension is called User Role and tracks the Role of the user using the HelpCenter.user.role value (eg. manager, end_user, anonymous, etc) in Slot 1.

 

The second custom dimension is called User Locale and the tracks the locale of a user using the HelpCenter.user.locale value (en-US, en-UK, etc) in Slot 2.

 

These will allow me to segment all of the activity and search metrics by these two custom dimensions.

 

Step 3: Set a custom dimensions for visitors

Once the custom dimensions are defined you can see which dimension they are assigned to ( dimension[0-9]+) and you can use in code. In my example account they are dimension1 and dimension2. You can then use this dimension in the code

 

  • name—The name for the custom dimension. Required. This is a string that identifies the custom dimension and appears in your reports. (dimension[0-9]+)
  • value—The value for the custom dimension. Required. This is a string that is paired with a name. You can pair a number of values with a custom dimension name. The value appears in the table list of the UI for a selected variable name. Typically, you will have two or more values for a given name. For example, you might define a custom variable name gender and supply male and female as two possible values.

In this example, I have included two Help Center custom dimensions on the Session level. These must sent along as part of a custom event. It is important that we define this as a non-interaction event so that it does not contribute to bounce rates or other important metrics. This will eventually look something like this when it's all put together:

 

ga('send', 'event', 'Help Center', 'User', {

   'dimension1': HelpCenter.user.role,

   'dimension2': HelpCenter.user.locale,

   nonInteraction: true

});

 

 

Step 3: Look at your Google Analytics metrics sliced by custom dimensions

It may take an hour or so for the new custom dimensions to be available in your Google Analytics project. Once the custom dimensions have synced with your Google Analytics project, you can segment your metrics by the custom dimensions.

In this example, I have broken out page views by User Locale by navigating to Reporting > Behavior > Site Content > All Pages and selecting Secondary Dimension > Custom Dimension > User Role.

 


0

42

42 comments

Thanks Jennifer and team for updating!  This is indeed a Happy New Year gift!

I've followed the instructions and tested to ensure it no longer breaks the java script and will wait a few hours to see if results start populating.

Question on the article.  Is there a place we should be adding the javascript detailed out by the Google Analytics custom dimension referenced in step 2?


Or do we only need to add the javascript as indicated in step 3?

0


Hi Corrin and Happy New Year!

Just wanted to let you know that this article was updated! 

0


Hi Corrin,

I'm not sure about the specific HC reports that will be in Explore. The two teams are currently in the process of planning those out. But I expect that the first version of the dashboards might be more focused on content and not that type of user segmentation. If you want to check back in mid-January, I might know more them.

0


Thanks Jennifer,

We are unable to pull a report on solely customer or soley agent site search activity currently.  I signed up for early access to explore so haven't seen more than a demo of BIME Analytics.  Are you aware of whether we will be able to pull a high level Customer vs Agent site search trends via Explore?

0


Sorry, Corrin, but I don't have good news here. I haven't been able to find anybody who can update this one...yet... 

0


Any news on updating this so we can track user role in site search?

0


Thanks Jennifer!  Excellent news!  I look forward to being able to leverage this!

0


Hi Corrin!

Thanks for reporting back and providing this detailed info! We're going to work on updating the article.

thanks!

0


Adding the final comment from Zendesk support pointing to the resources for updating this script.  As a novice in java script I am not able to create the script based on the instruction and shell alone.  Hopefully this provides all that is needed to update this article as this is a valuable information perspective to capture:

"As you can see here the use of the _gac object has been deprecated by Google and is something that we don't load in Help Center. Thus, when you utilize this old code, the JavaScript on the page fails as _gac is undefined as seen here. When this exception occurs all JS on the page fails to run, and it is necessary for the JS on the page to run as you have a theme that relies of JS to show the Submit button once someone clicks into the comment area.

Thus, to continue using what you were using I recommend you use the new code that Google supports which can be found here.

The new tracking uses the following syntax ga('send', 'pageview');, you can find more info about transition from the old code to the new in this Google article.

Once you have the proper (new) Google Analytics code in place and no JS fails on your Help Center, you should not have the issue you were experiencing earlier.

I can provide some guidance regarding this, however please not that I'm not versed in Google Analytics.

As the old ga.js is legacy code and can still be used I would first try to see if pasting the code found here and replacing UA-XXXXX-X with your web property ID, resolves the issue for you. You can paste this code in the Document Head section of your Help Center. This would be the easiest way for you to get things working as it was. However, please note that this may break in the near future.

If you would like to migrate to the new Universal Analytics by Google Analytics you'll have to make some backend changes in your Google Analytics as stated here. The Custom Variables found on the old platform has been changed to Custom Dimensions. As you can see the generic code for custom dimension is ga('set', 'dimension1', 'Paid');, if you compare this to the old ga.js it's as follows:

I hope this helps you out get started with getting things working for your Help Center and Google Analytics again."

0


Thanks so much Jessie!  I'm a novice with java script so the update will be truly appreciated!

0


Sign in to leave a comment.

Didn't find what you're looking for?

New post