Canvas is a learning management system (LMS) developed by Instructure and adopted by more that 2,000 learning institutions worldwide.

A highly esteemed music college that uses Canvas got in touch with us. They wanted to discover as much as they could about how their students were accessing and making use of the platform and suspected that Google Analytics would give them the insights they were after. They asked if we could help them to install Google Analytics on Canvas.

We were initially a little wary. We often find that third party platforms of this sort are restrictive when it comes to adding analytics tools. However, from reading some of the discussion on the Canvas community boards, we could see that it was possible - and if it was possible then we were confident we could do it!

In fact, we were very pleasantly surprised by Canvas, and were able to accomplish more than we expected within the project’s budget.

If you’re reading this and want a hand setting up Google Analytics on Canvas then please get in touch.

Otherwise, if you’d prefer to do it yourself, here are a few of the things that we discovered, and that might help you along.

1. You can use Google Tag Manager

None of the documentation that we found online about Canvas and Google Analytics mentioned Google Tag Manager, which was slightly concerning.

When adding tracking tags to a website we always prefer to use Google Tag Manager. Especially when we’re working with Google Analytics and wanting to do something beyond just adding the plain tracking tags (which we were here - see #3 below).

In the end, installing Google Tag Manager on Canvas was reasonably straightforward:

  1. Sign up for a Google Tag Manager account and follow the instructions to create a container.
  2. You'll be told to add two chunks of code to your website. Grab the first one and paste it into a plain text file called something like canvas-gtm.js.
  3. Remove the <script> tags from the start and end of the container code.
  4. Upload your file in the Canvas theme editor. There are instructions for that here.

You can then add Google Analytics tags in Google Tag Manager and preview your container to check that everything's working as expected.

2. You need to be careful with PII

PII stands for 'personally identifiable information'. Google’s terms of service prohibits users from sending data to Google Analytics that would enable them to learn the identity of an individual website user - think names, social security numbers, and email addresses.

We found that some page titles in Canvas contain email addresses, which would be a no-no under Google’s terms. You’ll need to find a way to stop that sort of thing from being sent to your Google Analytics account, or risk having all your data deleted.

Having identified the offending pages, we used Google Tag Manager to replace the page title with something else.

3. You can send extra data from Canvas to Google Analytics

This was the exciting one for us.

When a user looks at a page in Canvas, Google Analytics records the URL of that page, along with the contents of the page's <title> tag. That's fine, but what if there's other information about that page that we want to collect?

Happily, Canvas makes certain information available that will super-charge the reporting that you’re able to do in Google Analytics.

Specifically, with each pageview we also sent:

  • The course name, if the person is looking at a page relevant to a particular course.
  • The course ID, just in case the course name changes at any point.
  • The user ID which, in case you're wondering, doesn't count as PII because Google isn't able to identify specific people from those ID numbers.
  • The user role, that is whether they're a student, teacher, or Canvas administrator.

Having those pieces of information in Google Analytics allows us to:

  • create dashboards that pull together all data around a particular course, which is very useful for course leaders, and
  • separate out the behaviour of students from that of teachers, as each are likely to use Canvas in very different ways.

All in all, we were very happy with how this project went, and enjoyed working with Canvas as a platform.

If you want a hand setting up Google Analytics on your Canvas installation then just get in touch and we'd be more than happy to help.