Adding Web Analytics, Conversion Tracking, Completion Tracking or Custom Javascript

Follow

Many instructors wish to add their own analytics and tracking systems to their Skilljar courses. You can do this on the Theming page in the instructor dashboard: http://dashboard.skilljar.com/theme/

In this article we'll cover:

  • Global tracking codes
  • Conversion tracking codes
  • Advanced javascript for conversion tracking codes
  • Completion tracking codes

 

 

Global Tracking Codes

To add the code to ALL pages, paste your snippet into the field titled "Global code snippet". Here are links to locate common snippets:

Conversion Tracking Codes

You can also add custom tracking to registrations. This is frequently used to track conversions from marketing campaigns or to send lead data to CRMs. Just paste the snippet into the field titled 'Conversion code snippet'.

Please note that you may need to add <script> </script> tags around the snippet if they are not present by default. Here are links to locate common conversion tracking snippets:

Conversion Tracking Codes - Advanced Javascript

For advanced users, we include several Javascript variables within the page which you can use as optional parameters within your code snippets. Here are the variables we currently support. Please let us know if you would like to see additional fields tracked.

Note: The lesson parameter is only present within the skilljarCourse object when viewing a lesson page.  To include lesson information in your tracking, you'll need to make sure it exists in the skilljarCourse object first. Additionally, the skilljarUser variable only exists when a user is signed into the system. Pageviews by unauthenticated users will not contain a skilljarUser variable.

var skilljarUser = {
    id: '2qd4gf6abc7d8',
    email: 'jane@example.com',
    name: 'Jane Doe'
};
var skilljarCourse = { id: 'x24tgec3bed2', title: 'Your Course Title', tags: ["Tag name 1", "Example Tag 2", "Example Tag3"], lesson: { id: 'y35uhfd4cgf2e', title: 'Your Lesson Title' } };
var skilljarPurchase = { type: 'COURSE_ENROLLMENT', quantity: 1, orderId: '41X6G94W', currencyCode: 'USD', price: 25.00 };

If a user bulk-purchases a course, the skilljarPurchase's type attribute will be type: 'BULK_PURCHASE' and the quantity attribute will represent the number of registrations purchased.

Browser and document Javascript objects are also supported, such as page URL.

An example Segment.io event might look as follows:

<script>
   analytics.track('Purchase', {
       course: skilljarCourse.title,
       pricepaid: skilljarPurchase.price
   });
</script>

 

Completion Tracking Codes

You can also add custom tracking to course completions. Just paste the snippet into the field titled 'Completion code snippet'. 

The course completion code snippet is run by injecting it into the page that the student is on when a course is completed successfully. When the browser runs this javascript snippet, it has access to the skilljarUser and skilljarCourse variables on the page:

var skilljarUser = {
    id: '2qd4gf6abc7d8',
    email: 'jane@example.com',
    name: 'Jane Doe'
};
var skilljarCourse = { id: 'x24tgec3bed2', title: 'Your Course Title', tags: ["Tag name 1", "Example Tag 2", "Example Tag3"], lesson: { id: 'y35uhfd4cgf2e', title: 'Your Lesson Title' } };

 

 

 

Have more questions? Submit a request

Comments

Powered by Zendesk