Skip to content
LogZuno

Add the website tracking script

One script tag records pageviews, single-page app navigation and real-people engagement, and tracks clicks with HTML attributes.

Add this tag to every page, before </head>, with your project's ingest key:

<script defer src="https://platform.logzuno.app/sdk/logzuno.js"
        data-api-key="YOUR_INGEST_KEY"></script>

That's all for web analytics. The script records a pageview when the page loads and on every navigation in a single-page app (it watches history.pushState, replaceState and the back button), with the referrer, UTM tags, screen size and language.

How it tells people from bots

The script reports the first real interaction on each page: a tap, click, key press, scroll or wheel event that the browser marks as trusted. A visitor who interacts counts as a person; one who never does is unconfirmed. Browsers driven by automation (navigator.webdriver) never count as people, even with input. See web analytics for how the counts are reported.

Options

AttributeWhat it does
data-api-keyYour ingest key. Required
data-project-idYour project's slug. Optional: the key already names its project
data-user-idThe signed-in user's ID, so pageviews link to their profile
data-auto-track"false" stops automatic pageviews; call LogZuno.pageview() yourself
data-exclude-search"true" drops the query string from recorded URLs
data-domainsComma-separated hostnames to record on; other hosts (staging, localhost) are ignored
data-endpointAnother API address, for example a proxy on your own domain

Track clicks without code

Add data-pt-event to a link, button or form and LogZuno records an event when it is clicked or submitted:

<button data-pt-event="Pricing CTA clicked"
        data-pt-event-channel="marketing"
        data-pt-event-tags-plan="growth">
  Start free trial
</button>

Optional attributes: data-pt-event-channel, -description, -icon, -notify ("true"), and any number of data-pt-event-tags-{key}. Form fields named like passwords are never sent.

Track from JavaScript

The script exposes window.LogZuno:

LogZuno.track("Report exported", { channel: "product", properties: { format: "csv" } });
LogZuno.identify("user-123", { plan: "growth" });
LogZuno.group("acme", { name: "Acme Corp", userId: "user-123" });

Events from the browser are queued and sent in batches, and anything unsent goes out when the tab is hidden or closed.

Leave your own visits out

List your office or VPN addresses under Project settings → General → Your team's networks, and they are kept out of people and AI figures. On a single browser, run this once in the console to stop that browser being tracked:

localStorage.setItem("pt.disabled", "1");

Questions

Does the script set cookies?

One first-party cookie, pt.anonymousId, holding a random ID for 30 days (also kept in local storage), so a returning visitor counts once. No third-party cookies. Visitors' IP addresses are used at ingest and never stored.

Does it respect Do Not Track?

Yes. When the browser sends Do Not Track, the script records no pageviews and no engagement.