Integration Guides

WordPress

Add Otus Analytics to a WordPress site via your theme header or a header-scripts plugin.

There are two easy ways to add Otus to WordPress. Use whichever fits your setup.

A dedicated Otus WordPress plugin is on the way. Until then, the methods below work on any WordPress site.

If you'd rather not touch theme files, install a small plugin that injects code into the <head>, such as WPCode or Insert Headers and Footers.

  1. Install and activate the plugin.
  2. Open its settings and find the Header / Scripts in header box.
  3. Paste your Otus snippet:
    <script async src="https://cdn.otusanalytics.com/otusanalytics/otus.js"></script>
    <script>
      window.otus=window.otus||function(){(otus.q=otus.q||[]).push(arguments)},otus.init=otus.init||function(i){otus.o=i||{}};
      otus.init({ siteId: 123, endpoint: "https://ingest.otusanalytics.com/e" })
    </script>
    
  4. Save. The snippet will now load on every page.

Option 2: Edit your theme header

If you're comfortable editing theme files, add the snippet to your theme's header.php just before </head>.

Use a child theme so your change isn't lost when the parent theme updates.
header.php
<head>
  <!-- ... -->
  <script async src="https://cdn.otusanalytics.com/otusanalytics/otus.js"></script>
  <script>
    window.otus=window.otus||function(){(otus.q=otus.q||[]).push(arguments)},otus.init=otus.init||function(i){otus.o=i||{}};
    otus.init({ siteId: 123, endpoint: "https://ingest.otusanalytics.com/e" })
  </script>
</head>

Caching

WordPress sites often sit behind a page cache or CDN. After adding the snippet, clear/purge your cache so the updated HTML is served, then verify your installation.

Next step

Verify your installation, then explore your reports.