Google Analytics and help center - Part 3: Tracking customers' actions

Return to top
Have more questions? Submit a request

53 Comments

  • Kate Valk

    Hi,

    I am having the same issue that Andrei Kamarouski was 1 year ago - I've attempted to implement the tracking of pages where requests are initiated, but I am not seeing any Events registered in Google Analytics (despite seeing the real-time traffic when I am on the site).

    The code was valid 1 year ago, but is it valid today? I'm using the pre-built Copenhagen theme for example, and see no instance of 

    $(document).ready(function() {

    in the script.js file. Only

    document.addEventListener('DOMContentLoaded', function() {

    has there been an update to the snippet required to track clicks on that Submit a request link?

    2
  • Emma

    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?

    1
  • Brent

    @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: http://screencast.com/t/DVtAWZVqX

    1
  • Nicole Nguyen

    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'}}

     to 

    {{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.

    1
  • Charles Nadeau
    Zendesk Documentation Team

    Hi Kate and Joey,

    You can replace the following jQuery opening:

    $(document).ready(function() {

    with the JavaScript equivalent:

    document.addEventListener('DOMContentLoaded', function() { 
    

    1
  • Clotilde Hovine

    Hi,

    Sorry if it's not in the correct thread or article but, at the beginning of the article, it is mentioned :

    There is a built-in ticket deflection feature that automatically suggests related articles from your Help Center when a customer attempts to submit a ticket.

    I wasn't able to find an explanation on how to implement that. Is there an article about this configuration, please?

    Thank you very much in advance!

     

     

     

     

    1
  • Sandra Weigl

    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.
    Thanks!

    1
  • Dan Cooper
    Community Moderator

    Hello Clotilde, 

    This functionality is built into the Zendesk Guide product.  When a customer fills in the subject line of a ticket, it works like a search field to auto-suggest potential articles in your help center that may resolve the issue they are about to submit.  This works out of the box without any configuration other than adding articles into the Help Center and retaining the subject field on your ticket form. 

    1
  • 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.

    0
  • Karlina Hendra

    Hi,

    Hoping someone can help me with the issue below.

    I'm trying to track the search events on a search box with instant search. I tried the suggestions on this comment https://support.zendesk.com/hc/en-us/articles/203664156/comments/360000209187

    However:

    1. Setting submit=true is not an option because I want to enforce submitting a query by pressing Enter instead of the Submit button
    2. Capturing the keydown, keyup, or keypress events on pressing Enter did not work for me

    Is there another workaround I can do to track the search?

    0
  • Jessie Schutz
    Zendesk team member

    Hey Andrei!

    Can you be more specific about what code you're using? Are you using all the code snippets in this article, or just specific ones? What do you mean by "live events firing", just that an action is taken and doesn't show up in GA? How are you testing whether these actions are being taken?

    0
  • Kate Valk

    Hi Charles,

    Thank you for the response - just want to make sure I'm following correctly as I'm not seeing any Events triggered on our GA still. Apologies if I'm being dense, but do you mean the code should be set up as follows? I have had it like this since I began working on this issue but still see no events registered, despite triggering them myself for a test.

    Thanks,
    Kate

     

    0
  • Nicole S.
    Zendesk Community Team

    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?

    0
  • Dan Cooper
    Community Moderator

    Pathfinder is great, but I got the email this week that it will not function after October 14.  It sounds like similar functionality will be added to the interaction history using Sunshine but a date was not provided. 

    You could take a look at the Sunshine Event APIs to generate the event data yourself.  Adding code into your help center article templates could allow you to write views to the user's event log and capture these.  

    0
  • Charles Nadeau
    Zendesk Documentation Team

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

    Reference: https://developers.google.com/analytics/devguides/collection/analyticsjs/events

    0
  • 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 perhttps://developers.google.com/analytics/devguides/collection/analyticsjs/events

    0
  • Jessie Schutz
    Zendesk team member

    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!

    0
  • 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?

    Thanks!

    Brook

    0
  • Raymond Brookes

    Hi - is there any way to track an individuals engagement with Guide articles? I am investigating whether we can report on the total number of articles a given user has accessed over a period of time. Is there a way of incorporating the Zendesk user id so that Google Analytics can provide this type of data?

    Is this possible? Thanks!

    0
  • 4C Insights

    I'm having the same issue as Kate above. I'm using the Copenhagen theme and I'm unable to find the instance of:

    $(document).ready(function() {

    Can you please assist? Thanks!

    0
  • Andrew Dietrich
    Zendesk team member

    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.

    0
  • Nicole S.
    Zendesk Community Team

    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. 

    0
  • Brett Bowser
    Zendesk Community Team

    Hey Karlina,

    Have you gone through this article for measuring the effectiveness of search? It may also be worth taking a look at Googles documentation for setting up site search tracking which I've linked for you.

    Hopefully others can jump in here and offer up some additional guidance for you as well :)

    Cheers!

    0
  • Brian Green

    Hi Andrei,

    Apologies for the wait. That code snippet is current and functional. I think we should take a look at your code together over a ticket. I'll see you there.

    0
  • 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?

    0
  • 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.

    0
  • 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.

    0
  • Thomas Hargreaves

    Hi There,

    Do you have any feedback or case about modification of the events tracking code you provide to make dataLayer pushes instead of sending data to GA directly?

    This way it could work perfectly with GTM: https://support.zendesk.com/hc/en-us/articles/115010634068-Using-Google-Tag-Manager-with-your-Help-Center

    Thanks

    0
  • Christy Lutz

    For anyone who is tracking ticket deflection through the auto-suggested articles in the chat widget:

    Does anyone have an average of what percent of tickets are deflected through the auto-suggested articles?

    0
  • Melody Wong

    Hello there,

    Seems like only chats are registering as first events in my events workflow. I have enabled the ticket deflection code snippet and it has tracked 3 unique events (and so I know it has actually it works), but it seems to not register as a first time event. How can I fix this?

    (Please see screenshot)

    Thanks,

    Melody W

    0

Please sign in to leave a comment.

Powered by Zendesk