Skip to content

Tracking Tag

padams edited this page Dec 2, 2026 · 1 revision

Each Observation Profile that observes a website has its own tracking tag. The tag loads the Profile's tracker with the settings on its Tracking tag screen, so a saved change reaches your pages without pasting the tag again.

To open the screen, select Settings → Profiles → the Profile; its page opens on the Tracking tag tab.

A Profile's Tracking tag screen, with its Status and the top of Tracker Settings

Adding the Tag to Your Site

  1. Under Add the tag to your pages, at the bottom of the screen, copy the tag.
  2. Paste it into the <head> of every page, once.
  3. Visit one of the pages, then reload the screen. The Events row under Status shows when the first event arrived.

The tag looks like this, with your OWA server's address:

<link rel="preconnect" href="https://analytics.example.com">
<link rel="dns-prefetch" href="https://analytics.example.com">
<!-- Start Open Web Analytics Tracker -->
<script>var owa_cmds = owa_cmds || [];</script>
<script async src="https://analytics.example.com/public/tracker/REPLACE_WITH_YOUR_SITE_ID.js"></script>
<!-- End Open Web Analytics Code -->

To send what the tracker cannot see for itself, such as the section of the site a page belongs to, who is signed in, or a purchase, a page adds commands before the tag.

The Classic Tag

Classic tag format, under the tag, opens a second tag. It writes the Profile's settings into the page, as they are when you copy it, for configuring the tracker by hand or building it into a site's own code. It does not follow later changes on this screen: copy it again, or edit your copy, after changing the settings.

Status

Row What it shows
Profile ID What the tag and the API identify this Profile by
Events When the Profile last received an event, or None received yet.
Tracker Whether the Profile's tracker is published, and the address it is served from
Updates Whether browsers fetch a changed tracker on their next page view. Shown once the server has checked
Tracking What the tracker records, as saved in Tracker Settings: Page views, Clicks, Forms and so on

When the Tracker row does not say Published, wait a minute for the scheduler to publish the saved change; if it stays, see Troubleshooting.

When the Updates row does not say Changes reach visitors on their next page view., give the tracker files the Cache-Control: no-cache header.

Tag Settings

The groups under Tracker Settings decide what the Profile's tracker records. Each is closed until you open it.

The Scroll depth group open, with Scroll Thresholds overridden for this Profile

Control What it does
A group's heading Opens or closes the group
The value shown beside a setting The value this Profile follows, and the level it is set at, such as Set at the install level.
Override Sets the value for this Profile alone. Off again, the Profile follows the inherited value
Save and republish Saves the settings. The scheduler publishes the Profile's tracker within a minute
Group Control What it does
Page views Track Page Views Sends a page view when the page loads. On by default
Track Route Changes For single-page applications: sends a page view when the URL changes without a page load. Off by default
Clicks and downloads Track Clicks Sends a click event for each click, with the element clicked and where the link led. On by default
Download File Extensions A click on a link to a file with one of these extensions is a download. Separate them with commas
Forms Track Forms Sends an event when a visitor starts and when they submit a form. On by default
Scroll depth Track Scroll Depth Sends an event at the deepest scroll threshold reached on a page. On by default
Scroll Thresholds The scroll depths, in percent of the page, that are reported. 25, 50, 75, 90 by default
Site search Track Site Search Sends a search event when a page's URL carries one of the site search parameters. On by default
Site Search Parameters The URL parameters that carry a search term on your site. q, s, search, query, keyword by default
JavaScript errors Track JavaScript Errors Sends an exception event for each uncaught JavaScript error, once per page view for each message, source file and line. On by default
Visits and cookies Session Cookie Lifetime (days), Visitor Cookie Lifetime (days) See Cookie lifetimes
Tracker Cookie Domain See Cookie domain
Privacy signals Honor Privacy Signals Leaves a browser that sends Do Not Track or Global Privacy Control untracked. On by default
Page interaction recording Record Page Interactions, Recording Sample Rate (%) See Page interaction recording

Each setting is also in the Settings reference.

Where Each Setting Is Set

Level Screen Settings shown
Installation Settings → Server configuration → General Every tag setting
Property Settings → Property → Details Every tag setting
Profile The Profile's Tracking tag tab Every tag setting except Visitor Cookie Lifetime (days) and Tracker Cookie Domain

How a lower level overrides a higher one is on Settings.

Cookie Lifetimes

Session Cookie Lifetime (days) and Visitor Cookie Lifetime (days) take 0 to 400 days, counted from the visitor's last visit, and are 364 by default. 0 ends the cookie when the browser closes. At 0 for the visitor cookie, every browser session is a new visitor, and returning visitors and attribution across visits are mostly lost.

Cookie Domain

Tracker Cookie Domain empty sets the tracker's cookies on the page's own domain. Set a domain such as example.com to share them across its subdomains: a visitor moving between www.example.com and shop.example.com is then one visitor.

Page Interaction Recording

With the Domstream module active, Tracker Settings has a Page interaction recording group. Record Page Interactions, off by default, adds the recorder to the tracker, and Recording Sample Rate (%), 100 by default, sets the share of page loads it records.

Publishing the Tracker

The scheduler publishes a Profile's tracker within a minute of a saved change, while the scheduler's cron entry runs. After changing OWA_PUBLIC_URL in owa-config.php, run php cli.php cmd=publish-trackers. Settings → Server configuration → System health lists every Profile's tracker under Tracker bundles, as current or not.

Roles and Permissions

To Who
Open a Profile's Tracking tag screen, change its settings and copy its tag Administrators

Changes from 1.x

  • 1.x tags keep working. They load the generic tracker with their own commands and do not follow the Profile's tag settings. To have a page follow them, replace its 1.x tag with the tag on the Tracking tag screen.
  • Old tracker paths. modules/base/js/owa.tracker-combined-min.js and modules/base/dist/owa.tracker.js are redirected to public/base/dist/owa.tracker.js by OWA's .htaccess. On a web server that does not read .htaccess, add the same redirects.
  • First trackers. cmd=core-update-schema publishes a tracker for every Profile during the upgrade from 1.x.
  • cookiePersistence. Replace setOption cookiePersistence false with stateStoreExpirations {v: 0, s: 0}.

Clone this wiki locally