Skip to content

Tag attributes

Every behavior of the analytics tag can be controlled by attributes on the <script> element. No JavaScript required.

data-api-key (required)

Your sb_live_* business key. The tag will not initialize without it.

html
<script
  src="https://cdn.periscale.app/analytics.min.js"
  data-api-key="sb_live_..."
  defer
></script>

data-tenant

Optional friendly tenant identifier — useful when you want events tagged with a specific subdomain regardless of the URL the visitor is on. The backend resolves the real tenant from your API key, so this is purely informational.

html
<script
  src="https://cdn.periscale.app/analytics.min.js"
  data-api-key="sb_live_..."
  data-tenant="my-store"
  defer
></script>

data-collector

Override the ingest URL. You will only need this for self-managed deployments or staging environments.

html
<script
  src="https://cdn.periscale.app/analytics.min.js"
  data-api-key="sb_live_..."
  data-collector="https://your-collector.example.com/ingest"
  defer
></script>

data-no-init

Disables the tag's auto-initialization. Use this when you want to call init() manually after some condition is met (e.g. cookie consent).

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

data-autocapture, data-pageview

Set to "false" to disable specific built-in behaviors.

html
<script
  src="https://cdn.periscale.app/analytics.min.js"
  data-api-key="sb_live_..."
  data-autocapture="false"
  defer
></script>
AttributeDefaultWhat it controls
data-autocapturetrueClick / submit / viewport listeners that fire events from data-p-* markers.
data-pageviewtrueThe initial $pageview fired on init.

© Periscale