Skip to content

Privacy & consent

The analytics tag is designed so that you can stay compliant without writing extra code.

What's never auto-captured

  • Form input values. The tag listens for submit events but reads only attributes that you explicitly mark with data-p-*. Field contents (<input value>) are never transmitted automatically.
  • Personally identifiable information. Email, phone, name — none of these flow into events unless you pass them yourself via window.periscale.identify(...).
  • Anything inside [data-p-no-capture="true"]. That subtree is invisible to the tag's auto-capture.

Do Not Track

The tag honors the browser's navigator.doNotTrack signal automatically. When DNT is on, no events are sent.

Programmatic opt-out

Use optOut() to disable the tag for a specific visitor (e.g. after they decline a cookie banner):

js
window.periscale.optOut();

This writes a periscale_opt_out=1 cookie and localStorage entry. Subsequent track() and auto-capture calls are silently dropped. Reverse with:

js
window.periscale.optIn();

A typical pattern: load the tag with data-no-init="true" and only initialize after the visitor accepts.

html
<script
  src="https://cdn.periscale.app/analytics.min.js"
  data-no-init="true"
  defer
></script>
<script>
  myCookieBanner.onAccept(() => {
    window.periscale.init({ apiKey: "sb_live_xxx" });
  });
</script>

Anonymous identifier

Each browser is assigned a random distinct_id stored in localStorage and a periscale_did cookie. It is not a fingerprint — the same browser on a fresh profile generates a fresh id, and clearing site data resets it.

When you call identify(), that anonymous id is associated with the user id you supply, so the same person is recognized across visits.

Reset on logout

Always call window.periscale.reset() on logout to clear the identity and start a fresh anonymous session.

js
window.periscale.reset();

© Periscale