Trackly Documentation
Learn how to integrate Trackly's lightweight, privacy-focused analytics into your website in under 5 minutes.
Introduction
Trackly is a modern, privacy-first website analytics platform that helps you understand your visitors without compromising their privacy. Unlike traditional analytics tools, Trackly doesn't use cookies and is fully GDPR compliant out of the box.
Lightweight
Under 2KB script size. Won't slow down your website.
Privacy-First
No cookies required. GDPR & CCPA compliant.
Real-time
See your visitors as they happen, live on your dashboard.
Quick Start
Get up and running with Trackly in just 3 simple steps.
Installation
Add the Trackly script to your website. Works with any framework or static site.
Basic Installation
Add this script tag to your website's <head> section:
<script
defer
data-website-id="YOUR_WEBSITE_ID"
data-domain="https://your-domain.com"
src="https://your-domain.com/analytics.js">
</script>Important: Replace YOUR_WEBSITE_ID with the ID from your dashboard.
Framework Examples
Next.js
Add the script to your app/layout.tsx or use the Script component:
import Script from 'next/script'
export default function RootLayout({ children }) {
return (
<html>
<head>
<Script
defer
data-website-id="YOUR_WEBSITE_ID"
data-domain="https://your-domain.com"
src="https://your-domain.com/analytics.js"
/>
</head>
<body>{children}</body>
</html>
)
}React (Vite / CRA)
Add the script to your index.html:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<script
defer
data-website-id="YOUR_WEBSITE_ID"
data-domain="https://your-domain.com"
src="https://your-domain.com/analytics.js">
</script>
</head>
<body>
<div id="root"></div>
</body>
</html>Static HTML
Simply paste the script before the closing </head> tag:
<!DOCTYPE html>
<html>
<head>
<title>My Website</title>
<script
defer
data-website-id="YOUR_WEBSITE_ID"
data-domain="https://your-domain.com"
src="https://your-domain.com/analytics.js">
</script>
</head>
<body>
<!-- Your content -->
</body>
</html>Configuration
Customize Trackly's behavior using data attributes on the script tag.
| Attribute | Required | Description |
|---|---|---|
data-website-id | Yes | Your unique website ID from the dashboard |
data-domain | Yes | The Trackly server URL for data collection |
defer | Recommended | Loads script without blocking page render |
Features
Everything Trackly tracks automatically once installed.
Unique Visitors
Track unique visitors using privacy-friendly session IDs stored in localStorage.
Page Views
Automatic page view tracking for every page your visitors view.
Active Time
Measure how long visitors actively spend on your website.
Geolocation
See where your visitors are from - country, region, and city.
Device Info
Track device type, operating system, and browser information.
Referrer Tracking
Know where your traffic comes from - search, social, or direct.
UTM Campaigns
Track UTM parameters for marketing campaign attribution.
Entry & Exit URLs
See which pages visitors land on and where they leave.
API Reference
The Trackly script automatically sends data to our API. Here's what gets tracked.
Triggered when a visitor lands on any page.
{
"type": "entry",
"websiteId": "abc123xyz",
"visitorId": "unique-session-id",
"url": "https://example.com/page",
"referrer": "https://google.com",
"entryTime": 1737158400,
"utm_source": "google",
"utm_medium": "cpc",
"utm_campaign": "spring-sale"
}Triggered when a visitor leaves the page or closes the tab.
{
"type": "exit",
"websiteId": "abc123xyz",
"visitorId": "unique-session-id",
"exitTime": 1737158520,
"totalActiveTime": 120,
"exitUrl": "https://example.com/checkout"
}Dashboard
Your analytics dashboard provides real-time insights into your website traffic.
Overview Metrics
- Total unique visitors for selected date range
- Total page views across all pages
- Average and total active time on site
- Live visitor count in real-time
Analytics Views
- Hourly: View traffic patterns hour by hour
- Daily: Compare traffic across days
- Date Range: Select custom date ranges for analysis
Privacy & Compliance
Trackly is designed with privacy at its core. Here's how we protect your visitors.
🍪 No Cookies Required
Trackly uses localStorage for session management instead of cookies. This means you don't need a cookie consent banner for Trackly analytics.
🇪🇺 GDPR Compliant
No personal data is collected. Visitor IDs are anonymized and can't be used to identify individuals. IP addresses are only used for geolocation and never stored in full.
🔒 Data Security
All data is transmitted over HTTPS and stored securely. We never sell or share your analytics data with third parties.