Forum Discussion
Rise & Google Analytics?
I haven't gotten the chance to ask if I could simply share my tutorial document yet, but can at least try pasting some code here.
Required Code in Head Section for Tracking Google Analytics
From Windows Explorer, right click on the published story.html file and select Open With DreamWeaver (or whatever HTML editor you use)
For the event codes to connect to Google Analytics and show, you must add the following code in the head section after the </title> tag:
Add a few lines after the </title> tag before pasting the following text exactly as it is here, other than replacing YOUR GA UUID HERE with your own Google Analytics unique identifier.
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-YOUR GA UUID HERE-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
Via Storyline Triggers:
Create an Execute JavaScript when the User clicks trigger in Storyline for the button you would like to track the event on.
Click the Script input box to bring up an entry box to enter the code below.
_gaq.push(['_trackEvent', 'Example_Module', 'downloaded', 'course-button-xxx']);
Code Explanation
'Example_Module' = the name of the module you are tracking events in
Note: this should be a unique name of each module you are tracking. If you have several in a series that have the same module name, you would want to add a 1, 2, 3 after each module name to differentiate between modules you are tracking.
'downloaded' – This refers to the type of event you are tracking. This could be downloaded, clicked, viewed, resource, etc. The example in this tutorial is for downloading a course. You would adjust it accordingly to your needs by way of something that makes sense to the event you are tracking, as this is how it will show in Google Analytics when you look for the reports.
xxx in 'course-button-xxx' = the name of the module they are downloading, to learn more
Below is an example from a test module to track a module called 'ga-test-course', with a button to track downloads 'downloaded', for a content called 'CIG-button'
_gaq.push(['_trackEvent', 'ga-test-course', 'downloaded', 'CIG-button']);
Hopefully this at least helps you get started. I will ask my manager about permission to publish my document here that also has screenshots.