Associating Authenticated Zendesk Users into Google Analytics



  • Kyle Petsch

    I would be interested in learning more about what people are doing in this situation as well.

  • Dan McDade

    For what it is worth, I tried to do this via passing the into a custom dimension but have not been able to get it working 

  • Liri Raviv

    Have you figured this out by any chance? I'd like to do this too. 

  • Tony Roma

    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
    url: "https://**ZendeskSubdomain**/api/v2/users/me.json",
    type: 'GET',
    dataType: 'json',
    contentType: 'application/json',
    success: function (data) {
    ga('set', '**dimension#**',;
    ga('send', 'event', 'NonEvent', '**User_ID_label**',,
    {'nonInteraction': 1

    Replace items between ** with your own parameters..

  • Jennifer Rowe
    Zendesk Documentation Team

    Hey Tony -- nice to see you! Thanks for helping out!

  • Sarah Eshelman

    Tony Roma Hi Tony, is this code still working for you or has it changed?


Post is closed for comments.

Powered by Zendesk