Add tracking code to your registration forms

Business intelligence is critical to decision making. To help you understand your customers better, you should add JavaScript tracking code to the registration forms. This article will provide you mor

About tracking code on OutStem

You can add custom Javascript to your OutStem forms using the Sysadmin application. You can add scripts in two locations of the page: in the <head> section and in the <body> section. The code is appended to the end of both sections. The code you add to the custom injection should be in correct JavaScript syntax, or the script will not correctly behave.

Because forms.outstem.io is a single page application, we emulate the page load effect desired by analytics tools like Google Analytics by removing your script and loading it again every time the user navigates to a new page.

Tracking code you add is loaded on the following pages:

  • Forms Portal Page

  • Program Details Page

  • All Registration forms (events, workshops, and programs)

Loading external scripts in JavaScript

If your analytics vendor requires you to load some external javascript using the following syntax:

<script src="https://some-tracker.com/tracking.js"></script>

You need to change that syntax to the following format before adding it to Sysadmin.

var script = document.createElement('script');
script.src = "https://some-tracker.com/tracking.js";

script.onload = function () {
    // Perform initialization with the tracker script
};

document.head.appendChild(script); //or something of the likes

Common analytics scripts

Google site tag (gtag.js)

var script = document.createElement('script');
script.src = "https://www.googletagmanager.com/gtag/js?id=<YOUR_SITE_ID>";

script.onload = function () {
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', '<YOUR_SITE_ID>');
};

document.head.appendChild(script); //or something of the likes

Last updated

Was this helpful?