"The only analytics dashboard I open every day"

Script configuration

The tracker is configured with data-* attributes on its script tag. All of them are optional except data-website-id.

AttributeDefaultDescription
data-website-id—Your website id (required).
data-domaincurrent hostnameRoot domain. Cookies are scoped to it so all its subdomains share a visitor; links to other domains are tracked as exit links.
data-api-url<script origin>/api/eventsWhere events are sent. Set it when you proxy the script under a path of your own domain.
data-allow-localhostfalseTrack visits on localhost and *.local hosts.
data-cookielessfalseDon't set any cookie. See cookieless mode.
data-allow-file-protocolfalseTrack pages opened from file:// (Electron, local HTML). Events are accepted when data-domain is your website domain.
data-disable-scrollfalseDisable scroll goals.
data-debugfalseLog tracker decisions in the browser console.

Single-page apps

The script listens to history.pushState, history.replaceState and popstate, and sends a pageview whenever the path changes. You don't need any router integration. Changes to the query string or hash alone don't create a new pageview.

Clicks on links to other domains are recorded automatically as an outbound_link event with the target URL and the link text. They show up in Path → Exit link.

Calling the API before the script loads

The script is loaded with defer, so calls to window.dataeasy() made earlier would be lost. Add this stub before the script tag: calls are queued and replayed once the tracker loads.

<script>
  window.dataeasy = window.dataeasy || function () {
    (window.dataeasy.q = window.dataeasy.q || []).push(arguments);
  };
</script>

Cookies

CookieLifetimePurpose
dataeasy_visitor_id1 yearRandom visitor id, used for unique visitors and revenue attribution.
dataeasy_first_seen1 yearDate of the first visit (new vs returning visitors).
dataeasy_session30 minutesSession id and last activity time (sliding expiry).

All cookies are first-party, SameSite=Lax, and Secure on HTTPS. Depending on where your visitors are, you may need their consent before loading the script: see the privacy policy and the DPA.

Cookieless mode

Add data-cookieless="true" to the script tag and the tracker stores nothing in the browser: no cookies and no local storage. The server derives an anonymous visitor id from a hash of the visitor's IP address, user agent, your website and the current day (with a secret salt). The IP address is never stored, and the id changes every day, so a visitor can't be followed across days.

<script
  defer
  data-website-id="YOUR_WEBSITE_ID"
  data-domain="yourdomain.com"
  data-cookieless="true"
  src="https://dataeasy.app/js/script.js"
></script>

Trade-offs to know about:

  • A visitor coming back on another day counts as a new visitor, so unique visitors over long periods are higher.
  • Sessions are grouped in 30-minute windows instead of a sliding 30-minute timeout.
  • Revenue attribution can't read a dataeasy_visitor_id cookie at checkout, so payments are not linked to a source in this mode.
  • Visitors behind the same IP address with the same browser on the same day count as one visitor.

✍️ Something missing? Tell us.

🧭 New to DataEasy? Start with the introduction