Google Analytics Tracking

Modified on Tue, 5 Sep, 2023 at 9:22 AM

Google Analytics  tracking code can be added into the Settings > Tracking Code page by a user with a System Administrator role.


Custom Variables

To send over custom information to GA, you can set up Custom Dimensions in GA


We have the following JavaScript variables that can be leveraged and sent to GA: 

  • CA_LMS_USER_CONTEXT_ROLES - JSON list of roles (i.e. urn:lti:role:ims/lis/Instructor, Learner, etc) 
  • CA_LMS_TEACHER_NAMES
  • CA_LMS_CONTEXT_ID
  • CA_CONSUMER_KEY

  • CA_COURSE_TITLE

  • CA_LMS_CONTEXT_TITLE


Please submit a ticket if you would like these variables to be enabled for you.


To determine if a user is a logged into CourseArc, the following code can be used: 

if (typeof PENDO_DATA == "object") { IS_CA_USER = true; }


Example Tracking Code

Get this code from analytics.google.com - Admin > Tracking Info.  

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-12349999-9"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'UA-12349999-9', { 'dimension5': CA_CONSUMER_KEY });
</script>









Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article