How to Integrate Google Analytics in WebHelp Responsive Output
To enable your WebHelp Responsive system to benefit from Google Analytics reports, follow these steps:
- Create a new Google Analytics account (if you do not already have one) and log on.
- Choose the Analytics solution that fits the needs of your website.
- Follow the on-screen instructions to obtain a Tracking Code that contains
your Tracking ID.A Tracking Code looks like this:
<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-XXXXXXXX-X', 'auto'); ga('send', 'pageview'); </script> - Save the Tracking Code (obtained in the previous step) in a new HTML file called
googleAnalytics.html. - In Oxygen XML Editor plugin, click the
Configure Transformation
Scenario(s) action from the toolbar. - Select an existing WebHelp Responsive transformation scenario (depending on your needs, it may be with or without feedback) and click the Duplicate button to open the Edit Scenario dialog box.
- Switch to the Parameters tab. Depending on where you want to
display the button, edit one of the parameters that begin with
webhelp.fragment. Set that parameter to reference thegoogleAnalytics.htmlfile that you created earlier. - Click Ok.
- Run the transformation scenario.