Associating Authenticated Zendesk Users into Google Analytics
RespondidaWe have just enabled Google Analytics to track metrics against our closed Help Center. We would like to map our Authenticated Users within Zendesk to the analytics within Google Analytics. Out of the box Google Analytics tracks by IP Address but it does appear there is a way to associate all the analytics to a passed 'UserId' via this article:
https://developers.google.com/analytics/devguides/collection/analyticsjs/user-id#example
Tracking by IP Address has many limitations to actually segment out users at a single location. There could be many users at that external IP Address. The same user can be logging into the Help Center from different locations. Has anyone successfully implemented this feature within your closed Help Center? If you have, could you please provide insight of what you needed to do for this to work properly. We'd like to be able to view trends over specific user segments and users.
Thanks in advance for your help!
-
I would be interested in learning more about what people are doing in this situation as well.
-
For what it is worth, I tried to do this via passing the HelpCenter.user.id into a custom dimension but have not been able to get it working
-
Have you figured this out by any chance? I'd like to do this too.
-
Elliott B. over at Zendesk Support pointed me in a direction that I worked out about a year ago.
I inserted the following Ajax request above the $(document).ready(function() { line in the JS editor. We are now getting the user ID passed through to a custom dimension in GA.
//Pass through Zendesk User ID to Google Analytics
$.ajax({
url: "https://**ZendeskSubdomain**/api/v2/users/me.json",
type: 'GET',
dataType: 'json',
contentType: 'application/json',
success: function (data) {
ga('set', '**dimension#**', data.user.id);
ga('send', 'event', 'NonEvent', '**User_ID_label**', data.user.id,
{'nonInteraction': 1
});
},
});Replace items between ** with your own parameters..
-
Hey Tony -- nice to see you! Thanks for helping out!
-
Tony Roma Hi Tony, is this code still working for you or has it changed?
Iniciar sesión para dejar un comentario.
6 Comentarios