What Does Google Analytics Do?

GA_LogoGoogle Analytics is a free (and paid) web service provided by Google that allows a site’s owner (webmaster) to view statistical data on site usage and activity. A Google account is required for use with Google Analytics, and more info on the service can be found in their introduction here.  The service provides a tracking code (that’s how the pages are identified), that you embed in the web pages (HTML5 topics in Flare) that you’re trying to analyze.


How Do I Add Google Analytics to My Project?

We’ve previously showcased how easy it is to integrate Google Analytics into your Flare WebHelp target, but this post covers the process using the new responsive HTML5 target from Flare 10. Here’s how to embed the Google Analytics script into the Master Page of your HTML5 Target.  If you’re using more than one Master Page in your project, you’ll need to embed the Google Analytics code into all Master Pages used in the HTML5 output you’re trying to track.

  1. Create a Google Analytics account (if your HTML5 output lives in www.MyCompany.com/data/help, set up Google Analytics to point to www.MyCompany.com).
  2. In your Flare Project, create a Master Page (here’s how to do it).
  3. Open the Master Page in the Internal Text Editor and paste the Tracking Code provided in your Google Analytics account before the </head> tag and save.
  4. Open With Dialog

    Right click select -> Open with -> Internal Text Editor


    See the code pasted just before the closing tag

  5. In your Target | Advanced Tab, set the Master Page to the one that you just created (here’s how to do it).


    Select the MasterPage you’ve embedded your GA code in the Target you want to track

  6. Build and publish HTML5 Help to the location that you defined in the Google Analytics settings.

Please note that it takes time for the data to get into Google from your Help System.
If you do not like script ‘bloat’ added to your content you can create a JS file with the tracking code provided by Google, save it to the Resources Folder and just add a call to that file from your Master Page.

Is Google Analytics enough?

MadCap Pulse Box

The stats provided by Google Analytics can be a great resource for a basic understanding of what users are viewing on your site and where they’re coming from. If you are looking for additional capabilities such as Social Collaboration, User Profiles and Comments, Ratings, and in-depth User Activity Reports, such as search terms that yield too many, too few, or no results, we recommend MadCap Pulse. It provides a great and thorough way to understand how users are interacting with your content.


You can watch our “Meet MadCap Pulse” video here:

Venafi Logo

Check out a recent case study from our client Venafi that highlights how they created a social community around their documentation here.


Have you embedded the Google Analytics tracking code into your published help system? Please share your experiences, and post any questions or comments below!

About The Author

Jose Sermeno

About Jose Sermeno

With over 10 years of experience in the software industry, Mr. Sermeno brings a wealth of knowledge and expertise to the product evangelist team, helping introduce new users to everything MadCap Software. In his spare time, Jose is the Project Director for San Diego City Robotics, the San Diego community college systems robotics program, and enjoys working in software design and open source hardware development. Prior to joining MadCap in late 2010, Jose ran a Drupal development shop, and was an application manager for Temple University Health System.

Last Modified: October 17, 2014

This entry was posted in MadCap Software, Tips & Tricks. Bookmark the permalink.


  • Denice Swinnen April 27, 2016 at 3:47 PM

    I’m not using Master pages in my HTML 5 Top Nav project. Can I still use Google Analytics? Or do I need a master page? How do I apply a master page to hundreds of topics after they are created??

    • Jennifer Morse Jennifer Morse April 27, 2016 at 4:09 PM

      Hi Denice,
      Yes, you will need a master page. You can create it as mentioned above, and then easily associate it at the target level even though you have a ton of topics. That way, it is applied to all topics in your output. After you create your masterpage, go into the target file, navigate to the advanced tab, select your new masterpage, and build. I hope this helps. If I can clarify anything else let me know.

  • Elizabeth November 9, 2017 at 9:32 AM

    Hi Jose,
    This is great! Thanks for sharing these tips with us. We used them to start tracking our page usage with Google Analytics (GA), and were successful!

    I’m now trying to implement GA Search Terms. This feature worked with our projects that use the Top Navigation skin because when you search for a term, Flare uses the ?q= search parameter in the URL, which is the same one Google recommends. However, the TriPane projects use #search- as the search parameter in the URL, and that didn’t seem to work in Google Analytics. Were getting 0 search terms returned for those projects. Do you know how to make Search Terms work in GA with a Flare TriPane project? What would be the correct search term parameter to use?

    Thank you so much,


  • Keith Bates May 18, 2018 at 7:01 AM

    Using Flare 2018, I followed the instructions you gave but got the following error, even though I cut and pasted the tracking code directly from Google Analytics: ‘src is an unexpected token. The expected token is ‘=’. Line 5. position 17.

    window.dataLayer = window.dataLayer || [];
    function gtag(){dataLayer.push(arguments);}
    gtag(‘js’, new Date());

    gtag(‘config’, ‘XX-XXXXXXXXX-X’);

  • Jim Gilliam July 16, 2018 at 5:25 PM

    Keith, “async” has been the issue for me. Try removing that.

  • Smriti October 16, 2018 at 2:13 PM

    Using Flare 2018. I faced the same problem. I removed async. However, I am not getting any real-time details. I’m publishing my output using Madcap Central. Does that make any difference?

    • Jennifer Morse Jennifer Morse October 17, 2018 at 9:13 AM

      There shouldn’t be any issues hosting on Central, so there may be something else going on. I would encourage you to call into support so that we can look into this with you. You have phone support with your Central subscription, feel free to give us a call: +1 858-320-0387 or +1 888-623-2271 (Toll free – US and Canada only) and select option 3.

Have Something to Say?

Your email address will not be published. Required fields are marked *