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.
Using Oxygen XML Editor/Author
To integrate Google Analytics into your WebHelp Classic output using a
transformation scenario from within Oxygen XML Editor/Author, follow this procedure:
- Create a new Google Analytics account (if you do not already have one) and log on.
- Choose the Analytics solution that best 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 XML file called googleAnalytics.xml. Note that the file should only contain the tracking code.
- In Oxygen XML Editor/Author, click the Configure Transformation Scenario(s) action from the toolbar (or the . menu
- Select an existing WebHelp 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 and edit the
webhelp.footer.file
parameter to reference the googleAnalytics.xml file that you created earlier. - Click Ok and run the transformation scenario.
Using a Script Outside of Oxygen XML Editor/Author
Important: Running WebHelp transformations from a script outside of Oxygen XML
Editor/Author requires an additional license and some additional setup:
- You must have a valid license for the Oxygen XML WebHelp Plugin (https://www.oxygenxml.com/buy_webhelp.html).
- The Oxygen XML WebHelp Plugin must be installed and integrated.
To integrate Google Analytics into your WebHelp Classic output using a script outside of Oxygen XML
Editor/Author, follow this procedure:
- Create a new Google Analytics account (if you do not already have one) and log on.
- Choose the Analytics solution that best 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 XML file called googleAnalytics.xml. Note that the file should only contain the tracking code.
- Use the
webhelp.footer.file
parameter in your transformation script and set its value to reference the googleAnalytics.xml file that you created earlier. -
Execute the transformation script.