Dashtics
Home Tracking Guide

Tracking Guide

Use this guide to install Dashtics, track custom actions, and record ecommerce without cookies or cross-site fingerprinting.

What Dashtics tracks automatically

Once the script is installed, Dashtics records pageviews automatically. You can then add custom events and ecommerce on top.

  • Pageviews

    Tracked on load and on SPA route changes.

  • Custom events

    Track clicks, form submissions, downloads, and more.

  • Ecommerce

    Record purchases, revenue, currency, and product metadata.

1. Install the script

Add Dashtics to every page

Place the script in the <head> of your site. Use the same snippet for static pages, server-rendered templates, and SPAs.

Example 1: static HTML site

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

Example 2: server-rendered base layout

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

Example 3: SPA root template

index.html
<body>
  <div id="app"></div>
  <script src="https://dashtics.eu/static/script.js"
          data-site="YOUR_SITE_TOKEN"
          async></script>
</body>

2. Track custom actions

Measure the actions that matter

Use window.analytics.track() for actions that are not pageviews. Pass properties when you want to filter or segment later.

Example 1: CTA click

JavaScript
window.analytics.track('cta_click', {
  location: 'hero',
  label: 'Start free trial'
});

Example 2: form submission

JavaScript
window.analytics.track('lead_form_submit', {
  form: 'contact',
  plan: 'pro'
});

Example 3: download or content action

JavaScript
window.analytics.track('pdf_download', {
  title: 'Tracking Guide',
  format: 'pdf'
});

3. Track ecommerce

Record purchases and revenue

Call window.analytics.purchase() on the order confirmation page or right after payment succeeds. Fire it once per order.

Example 1: one-time purchase

JavaScript
window.analytics.purchase('ord_12345', 49.95, 'EUR');

Example 2: subscription upgrade

JavaScript
window.analytics.purchase('sub_98765', 29.00, 'EUR', {
  product_name: 'Pro Plan'
});

Example 3: order with extra product data

JavaScript
window.analytics.purchase('ord_55555', 149.00, 'EUR', {
  product_name: 'Agency Bundle',
  product_id: 'bundle_agency',
  quantity: 3
});

Verify it is working

  1. Open your site in a browser and load a page.
  2. Open DevTools, go to Network, and filter for collect.
  3. Confirm that POST /collect returns 202 Accepted.