Installation
How to install Ometra on any website — Webflow, WordPress, Shopify, Squarespace, Wix, Framer, Next.js, or Google Tag Manager — plus SPAs and how to verify it's working.
Ometra is a single, lightweight script. Add it once to the <head> of your site.
The snippet
Copy your site's snippet from Settings → Install:
<script defer src="https://ometra.io/js/<your-site-token>.js"></script>
The token in the URL identifies your site, so the same snippet keeps working even if you change domains, or serve the same site from both example.com and www.example.com.
Legacy attribute snippet
We also support the classic attribute style, if you prefer to key on the domain:
<script defer data-domain="yourdomain.com" src="https://ometra.io/om.js"></script>
Platforms
Ometra works on any site where you can add a script to the <head>. Where to paste your snippet on common platforms (see Integrations for 30+ more, including Drupal, Joomla, Craft CMS, Adobe Experience Manager, Sitecore, WooCommerce, BigCommerce, Magento, Nuxt, Vue, and Astro):
- Webflow: Site settings → Custom code → Head code. Save, then publish. To pin every publish on your traffic chart, see Webflow analytics.
- WordPress: use a header-code plugin (such as WPCode) and paste the snippet into the site-wide Header section. You can also add it to your theme's
header.phpbefore</head>, but a theme update can overwrite that. - Shopify: Online Store → Themes → ⋯ → Edit code →
layout/theme.liquid, and paste the snippet just before</head>. Shopify's own checkout pages don't load theme code, so they aren't tracked this way. - Squarespace: paste the snippet into Code Injection → Header in your site settings. Code injection requires a paid Squarespace plan.
- Wix: Settings → Custom code → Add custom code, paste the snippet, apply it to All pages, and place it in the Head. This requires a premium plan with a connected domain.
- Framer: Site settings → General → Custom code, and paste the snippet into the end-of-
<head>field. Then publish. - Next.js: add it to your root layout with
next/script:
Route changes are tracked automatically (see Single-page apps).import Script from "next/script"; <Script src="https://ometra.io/js/<your-site-token>.js" strategy="afterInteractive" /> - Any other site: paste the snippet into your HTML template's
<head>.
Google Tag Manager
If you manage tags through Google Tag Manager, add Ometra as a Custom HTML tag:
- In your GTM workspace, go to Tags → New → Tag Configuration → Custom HTML.
- Paste your snippet:
<script defer src="https://ometra.io/js/<your-site-token>.js"></script> - Under Triggering, add a trigger and choose All Pages (or Initialization - All Pages) so it loads on every page.
- Save, then Submit to publish your container.
GTM injects the tag itself, so the defer attribute is ignored — that's fine, it loads asynchronously either way. Because Ometra sets no cookies, you don't need to gate it behind consent, though you can attach a consent trigger if your setup requires one.
Single-page apps
The script automatically tracks route changes in single-page apps (using the History API), so you don't need to do anything extra for client-side navigation.
Excluding pages
To stop tracking certain paths, add a data-exclude attribute — a comma-separated list of path patterns, where * is a wildcard. This is especially useful when a marketing site and its app live on the same domain: because the script follows client-side (SPA) navigation, excluding the app paths keeps them out of your analytics.
<script defer
src="https://ometra.io/js/<your-site-token>.js"
data-exclude="/app*, /admin*, /account/settings"></script>
No pageviews or events are sent while a visitor is on a matching path.
Custom events API
Once the script is loaded, a global function is available for custom events:
window.ometra("Signup", { props: { plan: "pro" } });
Verifying it works
- Open Settings → Install — the status turns to "Receiving data" after your first event.
- Note that the script ignores traffic from
localhostby default. To test locally, add thedata-localattribute to the script tag. - The script also respects the visitor's Do Not Track and Global Privacy Control signals, and filters out known bots.
Do I need a cookie banner?
Because Ometra sets no cookies and stores no personal data, most sites won't need a consent banner for our analytics. Privacy law is fact-specific, though — confirm your obligations for your situation.