Forums/Community/Support tips & notes

Advanced Customer Metrics with Google Analytics (Web Portal)

Adam L.
posted this on August 20, 2012 16:23

Note: This article describes the process of adding Google Analytics to your Web Portal. If you have Help Center (released on August 21, 2013), please see the following articles:

Setting up Google Analytics with your Help Center
Google Analytics and Help Center - Part 1: Asking the right questions (Guide for creating events to track specific actions in Help Center)

 

Google Analytics is one of the most useful tools available for those in the customer service industry.  What makes it even more amazing is that it is totally free! With Google Analytics, you can simultaneously increase the amount of data that you are able to capture, while also tracking where your customers are coming from and going to. You can even track what they are clicking on! Of course, this naturally means that Google Analytics and Zendesk are a match made in metrics heaven.

To get started with Google Analytics for Zendesk, sign in to Google Analytics, or create a new account by going to http://www.google.com/analytics/ and selecting "Create an account".

 

Once you're logged in, start the setup for tracking for your Zendesk by clicking 'Admin' in the top right, and then 'New Account' from the left-side of the new page.

 

Next, chose an account name, and then enter your Zendesk URL under Website's URL. You'll probably also want to choose your time zone and industry, then go ahead and accept the terms and conditions.  

Note: The data sharing settings are absolutely optional, although the With other Google products only option can greatly enhance your metrics experience if you have additional Google services (e.g., AdWords).

When configured as desired, click Create Account

Now, on the next screen, copy the UA code displayed near the top under Tracking ID. This is the last step you'll need to take within Google Analytics!

Now it is time to jump back into your Zendesk. Once there, if you are in Classic, navigate to Settings > Extensions > Widgets > Add Widget; if you're using Zendesk Lotus, select the Manage icon (manage_icon.png) from the sidebar, then select Extensions > Widgets > Add Widget.

Next, select 'Google Analytics'. 

Now, paste your tracking/UA code in the Web Property ID section of the widget edit screen. 

Note: If you use host mapping, please follow the link under GA tracker domain to see if you need to update this field or leave it as none, and follow the steps accordingly, otherwise leave that setting as 'none'.

Now, just save the widget by clicking Create widget and you should be all set!

Important! It can take up to 72 hours for data to start syncing properly. You can safely ignore the setting in your Google Analytics account that claims tracking is not installed. This setting will properly update (automatically) once data has started synching.

So, now that you have Google Analytics set up, you are probably wondering what you can do with it. With the Zendesk + Google Analytics widget installed, not only can you now determine whether your page views are from new or returning users, but you can also track mobile site visits, how many interactions your customers had with your site, and which browser/operating systems are being used to access your site. You can even determine which languages your visitors speak, how engaged they are with your site, and which pages they visited (and in what order they did so). This complements the forum and search analytics features in Zendesk and can help you to increase ticket deflection by promoting the articles that your customers visit most often.  

Google Analytics provides a stunning amount of traffic data that you can subsequently use to better serve your customers. 

Additionally, you can learn much more about the getting the most out of Google Analytics at the following links:

 

Comments

User photo
Caitlin Davies
verbasoftware

Do I need to use https:// when tracking my Zendesk website? 

November 16, 2012 16:17
User photo
Justin Seymour
Zendesk

Shouldn't be required, Caitlin. 

November 19, 2012 06:32
User photo
Hagop Hagopian

Can I track tickets clicks and view on Google Analytics?

February 21, 2013 10:18
User photo
Adam L.
Zendesk

Absolutely, Hagop!  

February 21, 2013 10:19
User photo
Hagop Hagopian

Amad, is there a link to the explanation on how to do that?

February 21, 2013 10:21
User photo
Adam L.
Zendesk

Unfortunately, not from our side - I'd recommend going through their docs here:
http://www.google.com/analytics/learn/index.html 

February 21, 2013 10:22
User photo
Dynamics Golf
dynamicsgolf

Hi, how would I add a tracking codes to every page which isn't Google Analytics i.e I have another solution which tracks traffic and customer actions.

March 23, 2013 05:53
User photo
Adam L.
Zendesk

It totally depends on a number of factors.  For instance, what kind of code is it - Javascript?  If so, you could use a global javascript widget.  Any additional details you can provide would be much appreciated!  Thanks!  

April 04, 2013 09:43
User photo
Samuel Fewster
sportingpulse

Hi - is it possible to see figures on unique visitors that submit requests separately to UVs on the Knowledge Base?

June 24, 2013 00:00
User photo
Adam L.
Zendesk

I'm not sure you can fully separate those, but you definitely should be able to see, on an individual level, which users ultimately submitted a request vs. which users simply visited the forums. 

June 24, 2013 08:06
User photo
Larisa Moore
RealNetworks, Inc.

For some reason Google Analytics is only picking up site visits by our support agents. While interesting, that's not the data I really want to track. We do have a redirect set up for our site--i.e. customers go to a different URL and are then redirected to our zendesk.com URL. Would this affect the Google Analytics?

Also, since we do have language specific forums, I was wondering if it is possible to specify locale-id when using Google Analytics?

July 08, 2013 14:56
User photo
Adam L.
Zendesk

Hi Larisa,

The redirect shouldn't really make a difference, but you can always track both locations, if you'd like.  

However, I jumped into your account and noticed the Google Analytics widget is set to available only for 'people who have logged in, and are agents' - change that  (in the dropdown on the widget) to 'anyone including people who have not logged in' and you should be golden!

As for the locale id, there's not a way to set that specifically, as far as I know, but if the widget is set properly, as described above, it should catch all that traffic and then you can break it down within Google Analytics to see forum-specific traffic!

July 08, 2013 15:02
User photo
Larisa Moore
RealNetworks, Inc.

Oh! OK I thought that setting meant who could *access* the widget, not which users the widget tracks! I'll go change that now that I know. Thank you!

July 08, 2013 15:10
User photo
Adam L.
Zendesk

Yep, understandable.  You should be set now, but let us know if you run into any further issues!

July 08, 2013 15:13
User photo
Marci Abraham
nrocnetwork

Understandable mistake, Larisa! I'm actually glad you mentioned it, because I was about to do the same thing. @Adam, I think the instructions should be updated to reflect this. The example above (screenshot) shows the drop down with "people who have logged in, and are agents", which implies it should be left that way.

July 09, 2013 14:00
User photo
Adam L.
Zendesk

@Marci

Very good point!  Sorry about that.  Just updated it! 

July 09, 2013 14:22
User photo
Buck

Hi - I'm obviously missing something because I followed the instructions and GA isn't tracking anything zendesk related. We already had GA active on our website, tracking visitors, clicks, conversions, etc. Following the zendesk KB article, I input our site's UA- analytics code as requested and finished the steps. That's all I should need to do, right? 

We do not use zendesk for a forum or anything like that on our site. We use an embedded zendesk form as our "contact us" form to capture visitor questions and create tickest, etc. I need GA to know when someone submits one of those forms and add that bit of tracking info to that visitor's history on our site (basic GA stuff). But that's not happening, nothing is happening. Any ideas? (I have the 'users' set to anyone). Thanks!

September 04, 2013 16:11
User photo
Adam L.
Zendesk

Hi Buck,

How long has it been since you installed the tracking?  Does tracking show as active in your GA account?  Thanks and sorry for your troubles here.

September 04, 2013 16:28
User photo
Buck

Hi Adam, I'm slightly confused by the wording "installed the tracking". All I did was follow the instructions above which, if you already have a tracking ID from GA, just involves entering the code onto the widget page and clicking "submit". Right? Is there an "installation" step that I'm missing? 

"Does tracking show as active in your GA account?": not sure I understand what you mean by that. We use GA on our website, it tracks everything including purchases by our customers. What it doesn't show is anything having to do with zendesk. 

Here's a screen cap showing our implementation of zendesk on our site: http://screencast.com/t/vmVPMKuJP6

Let me know if you need more info from me. Thanks.

September 04, 2013 16:39
User photo
Buck

Hi Adam,

We inserted into the TAB's code, the code you provided in the block, verbatim except that we substituted our own UA code. We did this on Sep 5 and have been waiting to see if anything showed up in GA and nothing has. So I figured it was about time to follow up for some more help.

A friend who knows a little bit about GA showed us how to look at the source code for the FORM that's generated by the TAB and there is nothing related to GA on the form - no GA script whatsoever, so we're not sure how it could be passing info to GA if there are no scripts on the form to do that.

I've double checked and can confirm that the code that you provided IS within the TAB code on our site's pages. 

Thanks in advance for your continuing help.

September 12, 2013 15:02
User photo
Adam L.
Zendesk

Hi Buck,

Just to verify, you substituted your own dropbox id, etc., right?  The info should be passed to GA by the code block (which should be tracking interactions within the tab) - I've verified it works on my side, so all that comes to mind is something such as dropbox ID being improper, etc. 

September 12, 2013 15:10
User photo
Buck

Yes, we used our own codes. Here is the exact code on our site. The only thing I've removed is our domain and other identifying codes and replaced them with ***************.

 
  <!-- zendesk -->
  <script type="text/javascript" src="//asset0.zendesk.com/external/zenbox/v2.2/zenbox.js"></script>
  <style type="text/css" media="screen, projection">
  @import url(//asset0.zendesk.com/external/zenbox/v2.2/zenbox.css);
  </style>
  <script type="text/javascript">
  if (typeof(Zenbox) !== "undefined") {
  Zenbox.init({
  dropboxID: "********",
  url: "https://**********.zendesk.com",
  tabID: "ask_us",
  tabColor: "#a7be16",
  tabPosition: "Left"
  });
  }
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
   
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
   
  ga('create', 'UA-********-*', 'zendesk.com');
  ga('send', 'pageview');
   
  </script>
  <!-- end zendesk -->
September 12, 2013 16:29
User photo
Adam L.
Zendesk

Hi Buck,

I don't see any reason why this would work with mine, but not yours - the only difference I see is that you're using v2.2 of the tab, but the current version is 2.6 - otherwise can you verify if you see *any* data in the real time area of of your Google Analytics instance?

September 13, 2013 09:12
User photo
Buck

Hi Adam,

We have *NO* zendesk related data in analytics. The thing is that if you look at the form that's created by clicking our 'ask us' tab (even though we have inserted the code you gave us into the tab's own code), there is no GA code showing up on the FORM, so there would be no way for it to pass data to GA.

When you look at the source code for the form generated by YOUR tab, do you see GA code in THAT FORM'S source?

Can you provide me the code needed to replace the code we're using in order to move to the current version, or is it just a matter of typing "2.6" everywhere "2.2" is currently?

Thanks.

September 13, 2013 09:24
User photo
Adam L.
Zendesk

Hi Buck,

For the version, you should indeed just be able to update any references to 2.2 to 2.6 or you can generate a new tab under channels > feedback tab.

For the GA tracking - you were right - my method was flawed.  I did find a way to get this working, but just as my previous suggestion it's not officially supported (just as a warning).

You can probably inject it into the CSS by editing your tab, clicking 'advanced customization' and then adding the following:

</style>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-********', 'zendesk.com');
ga('send', 'pageview');
</script>
<style>

Just replace the code with your GA code, and then 'preview and grab code snippet, then replace your feedback tab code with the new code.

I also removed the misleading info above - sorry for any confusion this might have caused. 

September 13, 2013 10:42
User photo
Adam L.
Zendesk

I just wanted to emphasize, while this may hack work, it is not officially supported, so we cannot make any guarantees here.

September 13, 2013 10:45
User photo
Buck

So that I'm sure I understand what just happened... you're saying that regardless of us updating the tab code to v2.6, adding the tracking code you suggested will NOT send data to GA and so we shouldn't bother continuing down that path and that you're looking for a way for us to do this. Did I get that right?

If I did get that right, then the 2nd part to my question (not yet asked) is "ok, so it won't work with the TAB" can we get GA to work with the embedded zendesk created form on our Contact Us page - that's a form that's just sitting there all the time, waiting for inputs - not being generated by some other action (like clicking on a tab). Can you provide code that will send data to GA from within the form's frame? The problem is that our regular GA on our site tells us when people visit the page but we have no way of seeing in GA who/when/if a form is being submitted. And that's critical data.

I'm having a hard time understanding why this is so difficult. It seems to me that GA tracking is standard operating procedure for everyone and every website at this point. We're late-comers to Zendesk. Surely this has already been solved. I need to track people with GA as they travel through my ecommerce site and that includes when they click on the support tab and submit a help ticket or when they use our contact us page and submit a ticket. This has got to be "standard", doesn't it?

Thanks again.

September 13, 2013 10:45
User photo
Adam L.
Zendesk

Hi Buck,

I just created a ticket for you, so we can troubleshoot this - let's continue our conversation there!  Thanks!

September 13, 2013 10:52
User photo
Buck

Definitely. Thank you.

September 13, 2013 10:59
User photo
Sascha A. Carlin
impossible

Hi Adam, hi people

I was looking into setting up a goal in Google Analytics to track the number of requests made by our customers.

(It's simply more convenient to have that metric tracked in GA, because all our metrics go there.)

I'd like to set up the goal as a funnel. The destination would be "/requests", and the only step in the funnel "/requests/new".

Does that make sense to you?

Thanks
Sascha

January 08, 2014 06:44
User photo
Laura D.
Zendesk

Hi Sascha, 

We don't have any details about doing this that I am aware of but I think there could be some issues with this - the "/requests/new" will show wether or not someone submits a ticket - i.e., someone could go to that page then decide not to submit a ticket. I think the only way to gauge if this is a reasonable way to go (I haven't seen anyone do this before) would be to see what your GA total is and compare that to your Zendesk total for a given time period. You might also want to check with Google to see if they have any recommendations for this kind of goal. 

I'm curious what you find out, please let us know how it goes!

January 08, 2014 16:39
User photo
Mattias Wahlberg
freefloat

Do you have plans on updating the Analytics Widget to relfect the update Google has made on tracking Demographics and Interests? 

Source: https://support.google.com/analytics/answer/2444872?hl=en&utm_i...

January 13, 2014 00:23
User photo
David Blondeau
collaborativedrug

Is there a way to configure the Google analytics widget to use the new universal analytics tracking code? https://developers.google.com/analytics/devguides/collection/upgrade/

 

Thank you,

David

February 24, 2014 17:37
User photo
Matt Gentry
idashboards

Greetings,

Does anyone have an example of a click event on an attachment?

Thanks,

Matt

March 03, 2014 18:45
User photo
Renaat Sioncke

Google analytics is not in my zendesk widgets, how can I add the ID?

April 04, 2014 09:50
User photo
Isreal WebCons

I don't see the Widgets under the Extensions setting either - how do we add the UA code from Google, please?

April 08, 2014 10:24
User photo
Jason Maynard
Product Manager

@David/Matthias - We are going to upgrade the Google Analytics integration for help center to Universal Analytics. Unfortunately, this upgrade came out right after we were rolling out the feature, so we didn't do the initial launch on Universal Analytics. Unfortunately, the Universal Analytics Upgrade will require updates to any Google Analytics custom events that have been added to the javascript. We will post an announcement once we have upgraded help center asking customers to update any custom tracking code to use the analytics.js tracking code.

We will not update the Web Portal Google Analytics Widget to support Universal Analytics.

April 10, 2014 09:59
User photo
Laura D.
Zendesk

Renaat & Isreal WebCons, 

My bet is that you are both on Help Center. If so please see this article for information about adding Google Analytics to your account. In Help Center Google Analytics is available in the General settings area. 

April 10, 2014 10:11
User photo
Renaat Sioncke

Thanks Laura, I installed the Analytics ID in the help center, very easy if you know where to look.

April 10, 2014 11:10
User photo
Laura D.
Zendesk

Happy to help and yes, it's a bit easier than it used to be in Web Portal :)

April 10, 2014 11:32