Dashtics
Home Installation

Installation Guide

Add Dashtics to any website in under two minutes. No build step, no cookies, no consent banner required.

1

Add the snippet to your <head>

Copy your site's tracking snippet from Settings → Tracking token and paste it inside <head>…</head> on every page. Replace YOUR_SITE_TOKEN with the token shown in your dashboard.

HTML
<script src="https://dashtics.eu/static/script.js"
        data-site="YOUR_SITE_TOKEN"
        async></script>

The script is <2 KB, loads asynchronously, and never blocks your page render.

2

Content Security Policy (if your site sets a CSP header)

If your site sends a Content-Security-Policy header the browser will block the tracking script unless https://dashtics.eu is whitelisted. Add it to both script-src and connect-src.

nginx

nginx.conf
add_header Content-Security-Policy
  "script-src  'self' https://dashtics.eu ...;
   connect-src 'self' https://dashtics.eu ...;" always;

Apache (.htaccess)

.htaccess
Header always set Content-Security-Policy \
  "script-src  'self' https://dashtics.eu ...; \
   connect-src 'self' https://dashtics.eu ...;"

The browser console will show "Content-Security-Policy blocked a script" if this step is missing. This is the most common reason the script appears to load but sends no events.

3

Verify it's working

Open your site in a browser, then open DevTools (F12) → Network tab and filter for collect. You should see a POST /collect returning 202 Accepted.

Then go to your site's Setup page in Dashtics — the "Listening for events…" indicator turns green within a few seconds once a pageview lands.

+

Custom events (optional)

Track any user action beyond pageviews using window.analytics, which is available after the script loads.

JavaScript
// Named event with optional properties
window.analytics.track('signup', { plan: 'pro' });

// Ecommerce purchase
window.analytics.purchase('order-123', 49.95, 'EUR');
+

Single-page apps (React, Vue, Next.js…)

Pageview tracking works automatically for history-based routing — the script listens to history.pushState and popstate and fires a new pageview on each navigation. No extra configuration needed.

What is never tracked

  • No cookies set — ever
  • IP addresses are discarded after country/city lookup — not stored
  • Visitors with Do Not Track enabled are excluded
  • Your own visits can be excluded via IP filters in Settings

Ready to start? Create your free account and add your first site.

Get started free →