Stickybeak Docs Dashboard Get early access

Get started

Script reference

The Stickybeak analytics tracking code works unchanged on most sites. This reference explains the script and its options for special cases.

The analytics script

<script
  defer
  data-site="YOUR_SITE_ID"
  data-domain="example.com"
  src="https://app.usestickybeak.com/_cfw/s.js"
></script>

Keep the attributes on the element that loads the script. Do not use type="module".

Attributes

AttributeValueEffect
srcScript URLHosted /_cfw/s.js, an available first-party URL, or cookieless.js.
deferNoneRecommended. async also works.
data-siteSite IDRequired. Copy it from Settings.
data-domainexample.comRequired. Sets cookie scope and identifies internal links. Leading www. is ignored. Details.
data-privacytrueEnables privacy mode.
data-allow-localhosttrueRuns locally for testing; local events are still refused.
data-debugtrueRuns inside an iframe. It does not log.
data-endpointURL or pathOverrides the event endpoint. Relative paths resolve beside the script.
referrerpolicyno-referrerOptional standard HTML attribute for the script request.

Privacy-mode alias

/_cfw/cookieless.js always enables privacy mode, even with data-privacy="false". Install either it or s.js, not both; the first Stickybeak tag to run wins.

Queue calls made before load

<script>window.stickybeak = window.stickybeak || function () { (window.stickybeak.q = window.stickybeak.q || []).push(arguments); };</script>

Put this above the tag when your code may call window.stickybeak first. It queues up to 100 calls and remains harmless if the script is blocked.

Goal API

window.stickybeak(name, properties);
ArgumentRules
nameRequired. Lowercased and trimmed; 1–64 characters using a–z, 0–9, _, : or -. pageview is reserved.
propertiesOptional. Up to 10 string, number or boolean values, each cut to 255 characters. Personal-looking keys are dropped; privacy mode drops all properties.

The function returns nothing and never throws. Invalid calls are ignored. See Custom goals and Revenue.

Automatic events

TriggerEvent
Page load or supported route changePageview
Visible, active tab every 20 secondsPresence ping; not stored as an event
Element with data-goalNamed goal and allowed data-goal-* properties
mailto: or tel: linkemail_click or phone_click
External linkoutbound_link with destination origin
Marked or navigational internal linklink_click with section and destination path

Events use fetch to /_cfw/i beside the script, without cookies or a Referer header.

When it does not run

The script stops for missing required attributes, file:// pages, local addresses, iframes, stickybeak:ignore, or when another copy is already running. The localhost and iframe options above override only their matching checks.