Canopi Forums
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 03 Nov 2018 04:13 PM by Greg McLoughlin-Wilden
Setting up Google Tag Manager on Janison CLS
�0 Replies
You are not authorized to post a reply.
Author Messages

Greg McLoughlin-Wilden

New Member

New Member

03 Nov 2018 04:13 PM

    Google Analytics provides amazing insights into your learning data, and in conjunction with Google Tag Manager you can get even more insights in the activity on your learning portal.

    Since release 1821.2 (October 2018) the excellent people at Janison have provided very easy to setup, full integration for Google Analytics and Google Tag Manager in the CLS product.


    What you'll need to start

    1. A Google Analytics tracking number like UA-12345678-1
    2. A Google Tag Manager tracking code like GTM-7654321
    3. Release 1821.2 or greater of Janison CLS
    4. You may need to add the Google setup menu item in CLS
      1. Login tinot you CLS account as an admin
      2. Got to the Settings > Menu page
      3. Add '' to the Custom menu setting in the settings section

    I wanted a custom setup that gave me more insights than the out of the box Google setup, so this script has a few extra bits, these are mainly:

    1. Because we use subdomains, I wanted to see the full URL of the page visit rather than just the path.
    2. I wanted to see every page of learning as a page hit, and by default each module in a course is seen only as one page by Google. Each page of the course is then loaded into this one page, so by default Google only sees this as one visit. This is called a Single Page Application, so I wanted to get around that to get more insights.

    Setting up the CLS

    1. Login as an admin into the Janison CLS
    2. Select 'Settings > Google Tracking Settings'
    3. If you use sub-domains (most excellent feature) then select the sub-domain you want to configure
    4. Select 'Use Google Tag Manager'
    5. Enter your GTM code, and hit 'Save Settings'

    Setting up Google Tag Manager

    Login to your GTM account and select your Workspace


    Create a basic page view tag and trigger


    1. Select 'Tags' and add a new tag
    2. Select 'Tag configuration' and select a tag type of 'Google Analytics - Universal Analytics'
    3. Set 'Track type ' to 'Page View'
    4. Leave the GA settings at ' Select Settings Variable' and enable the overides setting
    5. Enter your sites Google Analytics tracking code, for example 'UA-12345678-1'
    6. Go down to the triggers section and add a trigger for all pages.
    7. Save this as 'Google Analytics - Universal Analytics'
    8. Close the blade and 'Submit' you new settings, I tend to just use the time as the release name.
    9. If you check your site now it should be recording page hits in the format '/mylearning/dashboard/index'

    Add Single page tracking and domain to the path

    OK, so now into the big stuff, making it fire on every page of a course and adding the domain.

    1. Back in Google Tag Manager, select 'Variables'
    2. Add a new 'User defined variable' at the bottom of the page
    3. Select a Variable type of 'Custom Javascript'
    4. In the custom Javascript add:

      function() {
        return window.location.pathname + + window.location.hash; 
    5. This add the pathname and extra hash bits (for course page tracking) to the Google analytics view. You can modify this anyway you want if you're a bit of a javascript gun.
    6. Save this as 'get path with fragment' 

    Add a trigger for when the Course pages change

    1. Select 'Triggers' from the left hand menu
    2. Select 'new' and then click on the blank tile to select a new trigger type
    3. Choose a 'History change' trigger. These fire when a course page changes, ie a when a local anchor is selected in the course player
    4. Save this as 'Event - History Fragment Change'
    5. Now select the 'Triggers' menu item again and select 'Configure' on the top 'Built in Variables'
    6. Scroll down to the History section and enable 'New Hisotry Fragment' and 'History Source'
    7. Close the blade and you should now see them in the list of 'Built in Variables'

    Add the new trigger to your page view tag

    1. Now head back to your 'Tags' section and select the 'Google Analytics - Universal Analytics' tag
    2. Use the pencil to edit the existing trigger at the bottom of the page, we're going to add a new one
    3. Select the '+' symbol
    4. Select your 'Event - History Fragment Change' trigger that you created above
    5. Save your tag
    6. Now select the 'Google Analytics - Universal Analytics' tag again
    7. Select the pencil to edit the tag configuration
    8. Open up 'More settings' and 'Field to set'
    9. Choose 'page' in the field name, and click the little lego block to choose {{get path with fragment}}
    10. Scroll down to the 'Advanced settings' and change the 'Tag firing options' to 'Unlimited'
    11. Save your settings
    12. 'Submit' your changes for publication to the live site

    Checking that it all works

    OK, so if the above instructions are correct :) and you followed all of the instructions above then you should now be tracking in Google Analytics. To test this login into your GA account and open up you 'Accounts > propoerties > Views' for the website you want to look at. You might have to setup a new view if you don;t have one already but let me know if you instructions for thaqt, or just google it.

    If all went well you should be able to got to 'REAL-TIME > Content' and see all of the action happening.

    My Favourite way to check things is to look at 'Pageviews (last 30 Minutes)' and then on the right of the screen filter by one of your course codes.

    you should a list of all of the page views for that curse, and see everyone going from one page to the next. Pretty amazing hey.




    So you now you have one tag that will fire when any page in your website is hit, but it will also fire when a course page changes.


    Some notes

    OK for me there were a couple of things I found helpful:

    1. There is an extension for Chrome that can show you tags firing. It's called 'Tag Assistant' and I'd suggest installing it.
    2. The Preview mode in Google Tag Manager is pretty good as well, when you're in preview mode you can also see the tags and variables firing which is great
    3. Adding each page of a course as a recroded event should drive your pageview numbers up a lot, which is partly why I did this, plus I think it will give me some insights later on.

    What's next

    Ok, so this was all about getting the date into Google Analytics and I think it achieves it in a format that I want, if not then I'll come back and ammend this article.

    The next step for me is to develop some insights into the data and ultimately insghts into the learners behaviour, so here are the next steps for me.

    1. Cross domain tracking. We have a number of clients who use Single SignOn to get people into ntheir learning, so I'd love to see the conversions rates from their main websites, into learning activity. Do we loose people from the 'Marketing' effort into the enrolment and learning actvity.
    2. Conversions rates. How many come to the site but never register? How many people register and Browse Learning, but then don't enrol. How many enrol but never start? How many Start but never finish? these are burning questions for operators of learning sites and Google Anaytics should give us a lot of tools and insights into this behviour
    3. Learning interactions. There a whole lot of cool tools int he Janison system, but are some better than others and understanding how learners engage with this would be useful. We make extensive use of video's for example, but do people watch the whole things? Do that watch 100% of a 3 minutes but only 50% of a 6 Minute video? I think these are key questions for learnign deisgners and we should be able to get these insights from Google Analystics

    So, this is the first article and get's us all gathering the core data we need. We'll develop some tools to see if we can achieve the above and post the instructions to this forum. 

    If you have any questions or want to make suggestions then Register here and post a reply





    You are not authorized to post a reply.