Tracking
Tracker configuration
Configure the Talivia tracker with data attributes.
The tracker reads configuration from data-* attributes on the script tag.
<script
defer
src="https://talivia.com/script.js"
data-website-id="YOUR_WEBSITE_ID"
data-auto-track="true"
></script>Available attributes
| Attribute | Description |
|---|---|
data-website-id | Required website id. |
data-host-url | Override the collection host. Usually not needed on Talivia Cloud. |
data-auto-track | Set to false to disable the first automatic page view. |
data-domains | Comma-separated hostnames allowed to send data. |
data-do-not-track | Set to true to respect browser Do Not Track. |
data-exclude-search | Set to true to remove query strings before sending URLs. |
data-exclude-hash | Set to true to remove hash fragments before sending URLs. |
data-tag | Attach a tag to every event from this script. |
data-before-send | Name of a global function that can edit or cancel payloads. |
data-fetch-credentials | Fetch credentials mode. Defaults to omit. |
data-performance | Set to true to collect Web Vitals. |
beforeSend
<script>
window.taliviaBeforeSend = (type, payload) => {
if (payload.url?.includes('/internal-preview')) return null;
return payload;
};
</script>
<script
defer
src="https://talivia.com/script.js"
data-website-id="YOUR_WEBSITE_ID"
data-before-send="taliviaBeforeSend"
></script>Return null or undefined to cancel the event.
Domain allowlist
<script
defer
src="https://talivia.com/script.js"
data-website-id="YOUR_WEBSITE_ID"
data-domains="example.com,app.example.com"
></script>This is useful when the same layout can render on staging, preview, and production domains.