• Docs
  • MCP
  • Pricing
Live demo
Get started
  • Get started in 3 steps
  • Track custom goals
  • Use tracking parameters
  • Filter your data
Installation guides
  • All guides
  • Next.js
  • React, Vite and React Router
  • Vue.js
  • Astro
  • WordPress
  • Shopify
  • Webflow
  • Framer
  • Squarespace
  • Wix
  • Google Tag Manager
  • Lovable, Bolt and v0
Revenue attribution
  • Connect a provider
  • Attribution guide
  • Stripe Checkout API
  • Stripe PaymentIntent API
  • Stripe Payment Links
  • Stripe other methods
  • Polar Checkout API
  • Polar Checkout Links
  • Polar other methods
  • Lemon Squeezy Checkout API
  • Lemon Squeezy Payment Links
  • Lemon Squeezy other methods
  • Paddle Checkout API
  • Paddle Overlay Checkout
  • Paddle other methods
  • Dodo Payments
  • Payment API
Proxy guides
  • Get started
  • Next.js
  • Vercel
  • Netlify
  • Cloudflare
  • Nginx
  • Managed proxy
Advanced features
  • Script configuration
  • GDPR and cookieless tracking
  • User identification
  • Exclude visits
  • Error tracking
  • Session replay
  • Bot traffic tracking
  • Export data
  • Public embed
  • Metrics explained
  • Cross-domain tracking
MCP
  • Get started
  • Tool reference
  • OAuth reference
API reference
  • Get started
  • Authentication and scopes
Account
  • Get account
Websites
  • List websites
  • Get website
Analytics
  • Get metadata
  • Get overview
  • Get time series
  • Get realtime
  • Get realtime map
  • Get goals
Breakdowns
  • Get pages
  • Get referrers
  • Get campaigns
  • Get countries
  • Get regions
  • Get cities
  • Get browsers
  • Get operating systems
  • Get devices
Errors
  • List errors
Bot traffic
  • Get bot traffic summary
  • Get bot traffic pages
  • Report a crawler request
Visitors
  • List visitors
  • Get visitor
Payments
  • Create a payment
  • Delete a payment
Troubleshooting
  • Fix CSP blocking the script
  • No data showing
  • Duplicate payments
Docs menu
Get started
  • Get started in 3 steps
  • Track custom goals
  • Use tracking parameters
  • Filter your data
Installation guides
  • All guides
  • Next.js
  • React, Vite and React Router
  • Vue.js
  • Astro
  • WordPress
  • Shopify
  • Webflow
  • Framer
  • Squarespace
  • Wix
  • Google Tag Manager
  • Lovable, Bolt and v0
Revenue attribution
  • Connect a provider
  • Attribution guide
  • Stripe Checkout API
  • Stripe PaymentIntent API
  • Stripe Payment Links
  • Stripe other methods
  • Polar Checkout API
  • Polar Checkout Links
  • Polar other methods
  • Lemon Squeezy Checkout API
  • Lemon Squeezy Payment Links
  • Lemon Squeezy other methods
  • Paddle Checkout API
  • Paddle Overlay Checkout
  • Paddle other methods
  • Dodo Payments
  • Payment API
Proxy guides
  • Get started
  • Next.js
  • Vercel
  • Netlify
  • Cloudflare
  • Nginx
  • Managed proxy
Advanced features
  • Script configuration
  • GDPR and cookieless tracking
  • User identification
  • Exclude visits
  • Error tracking
  • Session replay
  • Bot traffic tracking
  • Export data
  • Public embed
  • Metrics explained
  • Cross-domain tracking
MCP
  • Get started
  • Tool reference
  • OAuth reference
API reference
  • Get started
  • Authentication and scopes
Account
  • Get account
Websites
  • List websites
  • Get website
Analytics
  • Get metadata
  • Get overview
  • Get time series
  • Get realtime
  • Get realtime map
  • Get goals
Breakdowns
  • Get pages
  • Get referrers
  • Get campaigns
  • Get countries
  • Get regions
  • Get cities
  • Get browsers
  • Get operating systems
  • Get devices
Errors
  • List errors
Bot traffic
  • Get bot traffic summary
  • Get bot traffic pages
  • Report a crawler request
Visitors
  • List visitors
  • Get visitor
Payments
  • Create a payment
  • Delete a payment
Troubleshooting
  • Fix CSP blocking the script
  • No data showing
  • Duplicate payments
Datasense

Cookieless analytics with live visitors, console errors and exports, served from your own domain.

Product

  • Features
  • Error tracking
  • AI crawler tracking
  • Revenue attribution
  • Ad-block proxy
  • Pricing
  • Live demo

Docs

  • Get started
  • Install guides
  • Growth guides
  • Ad-block proxy
  • MCP server
  • REST API

Compare

  • vs Google Analytics
  • vs Plausible
  • vs DataFast
  • vs Fathom
  • All alternatives

Company

  • FAQ
  • Terms
  • Privacy
  • Refunds
  • Cookies
  • DPA
© 2026 DatasenseNo cookies were set on this page.

Script configuration reference

Every data- attribute the Datasense script reads, the window.datasense JavaScript API, and what the script ignores.

The script is one file under 4 KB, plain ES5, with no dependencies. Load it with defer so it never blocks rendering.

Builds

Script Visitor recognition
/js/script.cookies.js First-party datasense_vid (400 days) and datasense_sid (30-minute session) cookies. The default for new sites.
/js/script.js Nothing stored on the device. See cookieless tracking.

Attributes

Attribute Default What it does
data-website-id required Your site ID from the dashboard.
data-api next to the script Where events go. Defaults to /api/e beside the script, which is what makes the proxy work with no config. data-api-url works too.
data-allowed-hostnames none Comma-separated other domains of yours. Links to them carry the visitor along: see cross-domain tracking.
data-disable-payments false Set to true to stop reading payment link success URLs (session_id, checkout_id, order_id, payment_id). See duplicate payments.
data-allow-localhost false Set to true to record visits on localhost while you test.
data-track-errors true Set to false to turn off error tracking.
data-respect-dnt false Set to true to ignore browsers that send Do Not Track.
data-replay false Set to true to load the session recorder.
data-replay-api next to the script Where replay chunks go, if not /api/replay beside the script.

JavaScript API

Call What it does
datasense("signup", { plan: "pro" }) Records a custom goal.
datasense("identify", userId, traits) Ties the visitor to your user. See user identification.
datasense("reset") Starts a new visitor and session (cookie script). Call it on sign-out.
datasense("payment", { email }) Credits the payment with that customer email to this visit. See revenue attribution.
datasense.sessionId() The current session ID, for revenue attribution.
datasense.visitorId() The visitor ID (cookie script only; null on the cookieless one).

Single-page apps

history.pushState, history.replaceState and the back button count as pageviews, once per URL. When the visitor moves on or hides the tab, the script reports the visible time they spent on the page, capped at 30 minutes.

What the script ignores

  • localhost, 127.*, [::1], 0.0.0.0 and file: pages, unless data-allow-localhost="true".
  • Automated browsers: WebDriver, Cypress, PhantomJS and Nightmare.
  • Excluded visits.
Read this page as markdownllms.txt
PreviousManaged proxyNext GDPR and cookieless tracking

On this page

  • Builds
  • Attributes
  • JavaScript API
  • Single-page apps
  • What the script ignores
Sign in