Use this guide to install Dashtics, track custom actions, and record ecommerce without cookies or cross-site fingerprinting.
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
Place the script in the <head> of every page. If you use WordPress, the Code Snippets plugin is a simple way to add it once and load it site-wide.
Example: static HTML site
<script src="https://dashtics.eu/static/script.js"
data-site="YOUR_SITE_TOKEN"
async></script>
WordPress: Code Snippets plugin
Create a new PHP snippet, set it to run everywhere, and hook the script into wp_head. That keeps the tag in the <head> without editing your theme files.
<?php
add_action('wp_head', function () {
echo '<script src="https://dashtics.eu/static/script.js" data-site="YOUR_SITE_TOKEN" async></script>';
});
2. Track custom actions
Use window.analytics.track() for actions that are not pageviews. Pass properties when you want to filter or segment later.
Example 1: CTA click
window.analytics.track('cta_click', {
location: 'hero',
label: 'Start free trial'
});
Example 2: form submission
window.analytics.track('lead_form_submit', {
form: 'contact',
plan: 'pro'
});
Example 3: download or content action
window.analytics.track('pdf_download', {
title: 'Tracking Guide',
format: 'pdf'
});
3. Track ecommerce
Call window.analytics.purchase() on the order confirmation page or right after payment succeeds. Fire it once per order.
Example 1: one-time purchase
window.analytics.purchase('ord_12345', 49.95, 'EUR');
Example 2: subscription upgrade
window.analytics.purchase('sub_98765', 29.00, 'EUR', {
product_name: 'Pro Plan'
});
Example 3: order with extra product data
window.analytics.purchase('ord_55555', 149.00, 'EUR', {
product_name: 'Agency Bundle',
product_id: 'bundle_agency',
quantity: 3
});
collect.POST /collect returns 202 Accepted.