Aww man! Another weblog? Ugh, I hope the Internet gets full soon.

How to capture and track user search terms in Google Analytics with MadCap Flare HTML output

May 24, 2017

Flare's search engine behaves in a way that Google Analytics doesn't expect. Most search engines use a URL query to perform a search, but Flare's engine uses hashes. It's easy enough to add Google Analytics to an HTML output, but if you want to track your user's search terms, you have to do a tiny bit more work.

  1. Create a Google Analytics account and generate your unique GA script.
  2. Add the script to the master pages in your Flare HTML project, just after the opening <body> tag. In order to get GA to work with Flare, you must add a link to Google's jsapi library before your custom GA code.
Your code should look exactly like this (except with your unique identifier instead of a blurry mess)
  1. In Google Analytics, go to ADMIN --> VIEW --> View Settings.
  2. For the Query parameter, add "Highlight". Check the box to strip query parameters from the URL.
  1. To view your user's search terms, go to REPORTING --> Behavior --> Site Search --> Overview.

And you're done. Now you can get analytical information about how your users use your help, AND you can track which search terms they're using which allows you to make the improvements your users need!

This solution was developed with the help of Paul Pehrson, owner of DocGuy Training and a certified MadCap Flare trainer.

Mike Kelley
Download sample project!
Mike has a love for technology and a strong desire to help others. He is a Certified MadCap Advanced Developer for Flare and loves being able to share his knowledge and experience with others on the MadCap forums and LinkedIn groups. By combining his technical expertise with his writing skills, Mike can develop clever and elegant solutions for any documentation project.