Integration Guides

Google Tag Manager

Deploy the Otus tracking script through Google Tag Manager without touching your site's code.

If you already use Google Tag Manager (GTM), you can deploy Otus through it without editing your site's HTML.

A dedicated GTM template is on the way. In the meantime, the Custom HTML tag method below works today.

Add Otus as a Custom HTML tag

  1. Open your Google Tag Manager container.
  2. Go to Tags → New → Tag Configuration → Custom HTML.
  3. Paste your Otus snippet into the HTML field:
    <script defer
      id="otus-script"
      data-site-id="123"
      data-endpoint="https://ingest.otusanalytics.com/e"
      src="https://cdn.otusanalytics.com/otus.js"></script>
    
  4. Under Triggering, choose All Pages (the Initialization or All Pages trigger) so the script loads on every page.
  5. Save, then Submit / Publish your container.

A note on accuracy

Because GTM itself is a script that loads after the page, deploying Otus through a tag manager can slightly undercount visitors who leave very quickly or who block tag managers. For the most accurate numbers, the direct script tag in your <head> is preferred.

Tracking custom events from GTM

You can fire Otus custom events from GTM tags once the tracker is loaded. Add a Custom HTML tag with the appropriate trigger (for example a button-click trigger):

<script>
  if (window.otus) {
    window.otus.track('signup_click', { plan: 'growth' });
  }
</script>

Custom event names must be lowercase letters, numbers and underscores (max 64 characters). See the Tracking API for details.

Next step

After publishing, verify your installation.