How to integrate Google Analytics in WebHelp Classic output

You can use Google Analytics to track and report site data for your WebHelp Classic output.

To integrate Google Analytics into your WebHelp Classic output using a transformation scenario, follow this procedure:

  1. Create a new Google Analytics account (if you do not already have one) and log on.
  2. Choose the Analytics solution that best fits the needs of your website.
  3. Follow the on-screen instructions to obtain a Tracking Code that contains your Tracking ID.

    Follow the on-screen instructions to obtain a Tracking Code that contains your Tracking ID.

    <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>
  4. Save the Tracking Code (obtained in the previous step) in a new XML file called googleAnalytics.xml. Note that the file should only contain the tracking code.
  5. Within oXygen XML Editor, go to the Document > Transformation menu.
  6. Select an existing WebHelp Responsive transformation scenario and click the Duplicate button to open the Edit Scenario dialog box.
  7. Switch to the Parameters tab and edit the webhelp.footer.file parameter to reference the googleAnalytics.html file that you created earlier
  8. Click OK and run the transformation scenario.