Install the browser SDK
Verify each hostname in Settings → Ownership & hostnames, select the pages you want to measure in Pages, and copy that website’s installation code from Settings → Install SDK. An alias needs its own verification. Browser recognition stays separate on each hostname.
Add the script
Section titled “Add the script”Place the script once in your shared website template. Replace YOUR_PUBLIC_SITE_ID with the public site ID from the installation screen; do not use an account ID or secret.
This example targets production. Copy your own website's snippet from its Installation screen and replace the public example site ID.
<script async src="https://cdn.darktraffic.app/sdk.js" data-site="YOUR_PUBLIC_SITE_ID" referrerpolicy="no-referrer"></script>For this environment, allow https://cdn.darktraffic.app in your approved script policy and https://collect.darktraffic.app in connect-src. Follow your website's normal nonce or strict-dynamic mechanism when applicable.
The selected environment must be published before its script can be served. Production uses https://cdn.darktraffic.app/sdk.js and https://collect.darktraffic.app. Staging uses https://cdn.darktraffic.dev/sdk.js and https://collect.darktraffic.dev. Protected staging may refuse a script embedded on an ordinary website; do not put staging credentials in website code. For local development, use the repository’s local SDK website rather than sending test traffic to these hosts.
For the production example, keep your existing Content Security Policy. Add https://cdn.darktraffic.app to script-src (and script-src-elem if specified), and https://collect.darktraffic.app to connect-src. A policy using nonces or strict-dynamic needs your normal approved script-loading mechanism. No unsafe-eval, inline-script exception, third-party consent service or external font is required by the SDK.
The stable script URL selects the published release and caches for five minutes. Operators can pin an immutable version/hash URL from that release’s manifest for a controlled rollout. An already open tab keeps its loaded code; current website and permission controls still govern collection.
Permissions and storage
Section titled “Permissions and storage”The SDK does not show a consent banner. Connect your existing system through the custom permission interface. Measurement and browser recognition are separate purposes. In permission-waiting mode, an applicable allowed state is required. Default mode follows the website’s configured default; explicit denial or withdrawal, GPC and Do Not Track stop the applicable activity.
Permitted recognition uses a site-scoped, first-party, host-only Secure cookie with SameSite=Lax, Path=/ and a fixed backend expiry. Browser restrictions may shorten or refuse it. The SDK does not use fingerprinting or another persistent store to replace a refused cookie. Repeat-browser status then remains unknown. Short-lived visit/context state is separate and does not identify a person.
Check this browser
Section titled “Check this browser”Open your website’s developer console and read:
window.darkTraffic?.diagnostics?.();Diagnostics read memory and send no request. They report the SDK/protocol/configuration, local permission states, effective recognition availability, storage status, a bounded reason and pending retirement. They do not include tokens, credentials, full addresses or titles. registering is unresolved, measured means this response recorded an opening, active means foreground activity without another opening, and waiting, paused or unavailable explain why the SDK did not proceed. A blocked script cannot provide diagnostics. The browser’s Network panel can distinguish a blocked script, CSP refusal, offline request or unsupported configuration.
The SDK changes the current address only after a durable eligible result. It puts one active token parameter first and preserves unrelated query values, fragments and router state without reloading or adding a history entry. A parameter conflict leaves your address unchanged; ask the website Admin to resolve the configured name. Native consent-provider adapters for Cookiebot, CookieYes, OneTrust and Complianz remain Planned. A detected provider or dismissed banner is not a grant.
Interpret activity carefully
Section titled “Interpret activity carefully”Open Settings → Setup & status for saved setup, observed activity and browser-local diagnostic instructions. Configure visitor permission and recognition in Collection & recognition.
A token is not a confirmed share, a browser is not a person, and the graph represents observed propagation. A copied address before registration, stripped parameter, blocked script, expired context or forwarded original message can hide a step. Installation, verification, accepted activity and permission evidence are separate. Refreshes and qualifying page navigations are openings; ordinary foreground activity within an active visit adds no opening or graph node. Background timers and retries do not extend a visit.
Modern desktop Chrome, Firefox, Edge, Brave and Safari are the initial support target. Privacy controls remain decisive. Engine automation and mobile viewport checks do not establish physical-device behavior; older engines, blocked storage, prerender and BFCache availability can reduce observation. Keep your website usable when collection is unavailable.