Google Analytics and Help Center - Part 3: Tracking customers' actions Follow



  • Avatar
    Nigam Parikh (Edited )

    @Zendesk -,Product Team

    Reg,: Analytics/Tracking Click Results

    How to know how many Clicks done on each Help Center Questions/Articles on same page without creating separate URL for each questions?

  • Avatar

    @Nigam - if I'm understanding you correctly, you're asking if Google Analytics can analyze how many times someone clicked on each individual article, which is possible. You shouldn't need any extra set-up. Here's a screenshot of it in Google Analytics to show you where to look:

  • Avatar
    Sandra Weigl (Edited )

    Hello. Regarding 'Where do customers give up and submit a ticket?', is there a way I can find out in GA how often users actually submit a request? Currently, it seems that as soon as someone clicks on the 'Submit request' button, the action is recorded which makes it difficult to analyse how many people do actually submit a request of the ones who have (perhaps accidently) clicked on the 'Submit request' button.

  • Avatar
    Andrew Dietrich

    Hi Sandra! This is what I was able to come up with for tracking clicks of the 'Submit' button:

     // Track Submit button clicks
      $('#new_request footer input').on('click',function(e) {
        ga('send', {
      hitType: 'event',
      eventCategory: 'Submit Button',
      eventAction: 'Click',
      eventLabel: 'New Request'

    It isn't perfect - for example, it'll register an event even if the submission isn't successful - but hopefully it can get you started.

  • Avatar
    Tony Roma

    That's a good point, Sandra. The "Capture submit request event"/'Submit Request' would be better labeled "Capture initiate request event"/'Initiate Request'. Thanks for the code, Andrew.

  • Avatar
    Claus Tjørndal

    Those examples (still) looks broken. I’m unable to get them to work unless I update and use them as suggested by Dom.

    // Download tracking
    $('.attachments a').on('click', function(e) {
        var $this = $(this),
        path = window.location.pathname;
        attachment = $this.text();
        ga('send', 'event', 'Download', path, attachment);

    Notice the “ga(‘send’...” command. It shouldn’t be an array, as per

  • Avatar
    Charles Nadeau

    You are correct, the ga() function no longer takes an array. The syntax in the article has been updated.


  • Avatar

    Hi there, 

    I tried copying this code but the events aren't being captured. I really know nothing about javascript -- am I meant to replace any of the code with page-specific information?


  • Avatar
    Jessie - Community Manager

    Hi Brittany!

    I see you're getting help with this issue in a ticket. Please feel free to come  back and share your solution when you've got everything sorted out!

  • Avatar

    The majority of the results I am seeing after having added the tracking of search events code are "(not set)." Even the search terms I am checking myself don't populate in the search events but I assume are being added as (not set). How can I make sure all the search terms are being captured?

  • Avatar

    Hi Emma - 

    Interesting question here! To better troubleshoot this I would likely need to take a look at your Help Center and ensure the scripts for Google Analytics have been configured correctly. I am going to pull this into a ticket and will reach out to you soon!

  • Avatar
    Steve Morrell

    Is it possible to use the deflection tracking event to track when someone clicks on a suggested article, and also if they went on the submit a request in the same session?

    If one could record that someone was going to submit a ticket, but clicked on a suggestion, and then didn't, that could be taken a near-certain ticket deflection.

  • Avatar
    Andrew Dietrich

    Hi Steve,

    When an end-user is deflected from the article suggestions, they are sent there within the same window. None of our provided GA methods track the overall session of a user, only click events, so creating a 'link' between two different events wouldn't be possible.

    In looking at Google's GA documentation, there's the potential for session cookie tracking which might accommodate what you're looking for:

  • Avatar

    Hi there, i

    Is it possible to reference the Google Analytics Client Id to find out which HC he is?

  • Avatar
    Daniel Yousaf

    Hi David,

    Thanks for your question!  I'm creating a support ticket with you, since exploring this may involve some questions about your account.  I'll be in touch soon!


    Daniel | Customer Advocate - Tier 1 |

  • Avatar
    Sue Ann Seet

    Hello, I've copied the code in the JS section, but am unable to see the real-time events even after a few tries. are there any other possible reasons why I am unable to track on Google Analytics, the Events as described?

  • Avatar
    Dennis Lynn

    Hi Sue! It looks as though you have a support ticket open already, and our team is assisting with your specific code implementation. Generally speaking, however, so long as you are using this code and there is no additional conflicting JS, it should be fine. :)

  • Avatar
    Nicole Nguyen (Edited )

    I was putting in the search events tracking code and it is NOT tracking any of my search events unless I change 

    {{search submit=false instant=true class='search search-full'}}


    {{search submit=true instant=true class='search search-full'}}

    in the homepage file. For that reason, the code listed does not work. It seems that even if you press Enter, that doesn't count as a "submit". You would need to set submit=true and then re-style the submit button as well as the magnifying glass search icon.

    If you don't want to do that, you can track when users press Enter to search with the following code:

     $('form[role="search"]').on('keydown', function(e) {
    if(e.which == 13) {
    var $this = $(this);
    var query = $this.find('input[type="search"]').val().toLowerCase();
    ga('send', 'event', 'ZD Search', 'Submit', query);

    Other suggestions:

    I'd love it if we could also have event tracking code snippets for top article suggestion search result clicks and show the link of the clicked article in Google Analytics (Instant Search is built with Zendesk custom elements that are not viewable so I do not have anything to select).

    I believe these would be helpful for everyone in having more insight into optimizing our Help Centers.

  • Avatar
    Nicole - Community Manager

    Hey Nicole - 

    Thanks for the feedback! I encourage you to re-post it in the Product Feedback topic in the Community so that our Product Managers will see it. 

  • Avatar
    Grace Kim

    Is there a way to track if someone searched in the Help Center and then instead of pressing "enter" on their keyboard, they clicked on one of the top suggested articles within the search bar? Right now, the code only captures if you fully completed the search by pressing "enter". 

  • Avatar
    Nicole - Community Manager

    Hi Grace - 

    That's probably a question for Google Analytics, but my guess is going to be that you'd need a third party tool like Pendo to track that kind of activity. 

  • Avatar
    Brook Lenox

    I'd like to set up an event that fires when someone clicks on "Yes" or "No" for "Was this article helpful?" 

    How do I do that?



  • Avatar
    Nicole - Community Manager

    Hey Brook -

    You would need to play with the code, but you could use a javascript listener to pick up on when someone clicks those, and then have a custom form or whatever you'd like show up.

    What kind of event are you trying to create?

  • Avatar
    Brook Lenox

    Hi Nicole...I was trying to create an event that would fire every time someone clicked "Yes" or "No" for "Wast this article helpful?".

    Then I could look in Google Analytics for our top 25 most trafficked support pages and understand which are helpful and which are not.

  • Avatar
    Nicole - Community Manager

    Hi Brook - 

    I checked in with some of our Guide experts, and they said that you should be able to achieve this with some javascript. We can't advise on the code specifically, but if you can find someone who's good at that stuff, you should be able to accomplish what you're trying to. 

Please sign in to leave a comment.

Powered by Zendesk