On this page
  1. Required
  2. Pageviews
  3. Interactions recorded automatically
  4. Privacy and environment
  5. Other feature switches
  6. How long until changes apply

Everything the script does is controlled by attributes on its tag; there is no initialisation code to write. All attributes go on the same tag:

<script defer src="https://static.pathclue.com/client.js"
  data-site="YOUR_SITE_KEY"
  data-exclude="/admin/*,/preview"
  data-forms="true"></script>

Values are strings. Switches take "true" or "false".

Required

AttributeNotes
data-siteYour site key, copied from the SDK code page in the console. Safe to publish

Pageviews

AttributeDefaultNotes
data-hashoffKeeps the part after # and records a pageview on every hash change. For hash routing such as /#/pricing
data-excludeemptyPaths that don't record pageviews, comma-separated. Rules with * are wildcards, others must match exactly, e.g. /admin/*,/preview. Matches the path only, not the query string
data-auto-trackon"false" turns off all automatic collection; only your manual calls are recorded. Rarely needed

About data-auto-track="false": it also switches off time on page, outbound and download clicks, page performance and 404 tracking, and none of those can be added back by hand. To skip a few pages, use data-exclude instead.

Interactions recorded automatically

AttributeDefaultNotes
data-outboundonClicks on links to other sites. "false" to turn off
data-downloadsonClicks on links ending in common document, archive or installer extensions
data-formsoff"true" records form submissions — form id, name and action only, never what was typed
data-404offAdd it only on your 404 template, to count broken links
data-vitalsonLoad performance (largest contentful paint, interaction delay, layout shift and more), sent once when the visitor leaves the first screen
data-errorsoff"true" loads the error monitor, which records JavaScript errors on the page

Privacy and environment

AttributeDefaultNotes
data-respect-dntrespectedWith Do Not Track or Global Privacy Control on, the script doesn't run. We advise against changing this
data-allow-localoffAllows sending from localhost and other local addresses. For local testing only
data-apiautomaticCustom collection address. Without it the address is derived from the script's own domain; you rarely need it

Other feature switches

AttributeDefaultNotes
data-autocapturefollows project"false" stops autocapture on that page. It can only switch off: if the project has autocapture disabled, "true" does nothing
data-attributionnot loadedThe attribute's presence (value may be empty) loads the source reader, used to pass a visitor's landing source into your sign-up form
data-chatfollows project"false" keeps the live chat widget off. Analytics is unaffected

How long until changes apply

Attributes are read by the browser, so a change applies once your site is republished and visitors reload the page. If you use a CDN or caching plugin, clear it. Project rules — exclusions, sessions, the site search parameter — are read by the collector and apply as soon as you save.

Next in this topicSingle-page apps and hash routing