Google Analytics and Help Center - Part 5: Capturing Help Center user data

Have more questions? Submit a request

44 Comments

  • Thomas Crowley
    Comment actions Permalink

    The above worked and it is resolved now. Thanks for the help.

     

    Does anyone know whether users landing on the homepage and then logging in are counted as Anonymous sessions, [logged in user role] sessions, or whether it duplicates the count of sessions and records one for the user while Anonymous and one for the user once logged in?

    0
  • Brett - Community Manager
    Comment actions Permalink

    Hey Thomas, 

    All of the hits that are in that session will be set to the role level assuming you've set up the Custom Dimensions per the article above.

    You'll want to take a look at the following article: Custom Dimensions and Metrics

    There's a section titled User Level Scope which will show a diagram that I believe you'll find useful. 

    Hope this helps!

    1
  • Taylor Goldsberry
    Comment actions Permalink

    Please help.  I have been trying to get this up and running for days and keep circling the drain. 

     

    This code does not show up in my script.js

    $(document).ready(function() {
    0
  • Ryan McGrew
    Comment actions Permalink

    Hey Taylor,

    Looks like you guys have a custom theme (looks really good, btw) and have implemented some custom JavaScript. Looking at how things are structured your script.js file, it would appear you need to add the code around line 21 after the 

    $(function () {

    This should be the right place. Give it a shot, otherwise you may wanna get in touch with the folks who worked on your theme.

     

    Thanks!

    0
  • Taylor Goldsberry
    Comment actions Permalink

    Thank you, Ryan. 

     

    This seems to work. I am pulling User Name and Role, but email is still not coming through. 

     

    any thoughts?

    0
  • Ryan McGrew
    Comment actions Permalink

    Hey Taylor,

    Looks like your Help Center now requires authentication so I can't see exactly what's going on but each data point you wanna track like user name and role should be it's own separate custom metric and you'll need to set them. So the code will need to look something like what I've entered below. Like I said earlier, it may also be worth a chat with the folks who worked on the theme you have, as they'll be much more familiar with the setup. Also remember that we won't be able to send a user name or email, if the current user isn't logged in. So you may see some traffic without that information.

    var userRole = HelpCenter.user.role;
    var userName = HelpCenter.user.name;
    var email = HelpCenter.user.email;

    ga('set', 'dimension1', userRole);
    ga('set', 'dimension2', userName);
    ga('set', 'dimension3', email);
    ga('send', 'pageview');
    0
  • David Bastedo
    Comment actions Permalink

    Has anyone noticed that if you follow the instructions above that each page load in your help center triggers two page views being sent to Google Analytics? One triggered by Zendesk's built in GA integration, and another triggered by the custom code this document recommends you insert into script.js

    If you have Google Analytics enabled in your Guide admin panel and have put in your tracking ID, then that will trigger a page view being sent off to GA for each page load. This page view does not include the custom dimension.

    If you then follow the instructions in this article, and insert ga('send', 'pageview'); in your script.js, then that will trigger an additional page view being sent off to GA. This page view includes the custom dimension.

    Making this change would effectively double the page views we would see in Google Analytics.

     

    Has anyone else observed this behavior? Is there a workaround in place so that one could capture these custom dimensions in GA without triggering a second GA page view for each page load?

    0
  • Taylor Goldsberry
    Comment actions Permalink

    @David B,

    I encountered the same issue. Remove the custom code from any script.js, and keep the Tracking ID enabled within the Admin panel and you will be good to go. 

    The tracking id captures everything you need unless you want to implement Google Tag Manager to track very specific actions. 

    0
  • Brett - Community Manager
    Comment actions Permalink

    Thanks for sharing Taylor! 

    0
  • Ian Lintner
    Comment actions Permalink

    Just my $.02 any time you are moving data outside of a system that is PII (personally identifiable Information) e.g. if you are sending data to GA you may want to make sure you are in compliance with Google Analytics policies as well as company and governmental rules and regulations.

    My best practice is to only use non-identifiable value from zendesk and associate your data further downstream if needed. 

    https://support.google.com/analytics/answer/7686480?hl=en

    0
  • Korak Purkayastha
    Comment actions Permalink

    I noticed that I do not get 100% sessions data with custom dimensions. Is it because I enabled GA in Guide Settings and also added JS code?

    0
  • Nicole - Community Manager
    Comment actions Permalink

    Hi Korak -

    I believe this is due to the way that Google Analytics does data sampling. Here's an article from their knowledge base that should help explain it: About Data Sampling

    1
  • Paul Moran
    Comment actions Permalink

    @David Bastedo Yes, I found the same thing. @Taylor if you remove the custom code, it won't send the custom dimension to ga. That's because the custom dimension is being set after the 'send' 'pageview' had already executed. 

    The only solution I can see is to turn off the google analytics option in 'admin' and just use custom code. Not ideal!

    Anyone find a better way?

    0
  • Chris Stock
    Comment actions Permalink

    Paul Moran could you send the data as an event rather than a pageview? Something like:

    ga('send', 'event', 'Help Center', 'User', {
    'dimension1': HelpCenter.user.role,
    'dimension2': HelpCenter.user.name,
    'dimension3': HelpCenter.user.email,
    nonInteraction: true
    });

    Taking into account the points made above about transferring PII.

    0

Please sign in to leave a comment.

Powered by Zendesk