๐ฏ Trace Analytics
Your lightweight web tracking system is up and running!
๐ Quick Start
Embed this script on your website:
๐ Smart Auto-Detection (Recommended)
<script>
// Automatically use trace.js for localhost, trace.min.js for production
const script = document.createElement('script');
script.src = window.location.hostname === 'localhost'
? '/latest/trace.js'
: '/latest/trace.min.js';
document.head.appendChild(script);
</script>Smart: Automatically chooses the right version
๐ฏ Manual Selection
Development:
<script src="/latest/trace.js"></script>Readable, debuggable
Production:
<script src="/latest/trace.min.js"></script>51.6% smaller, faster
๐ก Pro Tip: Replace with your full domain URL when deploying to production
๐งช Test & Analyze
Test the tracking and visualize the data:
๐ What Gets Tracked
- โ Page views with event_type = "$pageview"
- โ UTM parameters and marketing attribution
- โ Browser, OS, device information
- โ Screen dimensions and viewport data
- โ Session tracking with persistent IDs
- โ Entry point and referrer data
๐ง API Endpoints
/api/track- Tracking endpoint for data collection/latest/trace.js- JavaScript trace script
๐ก Pro Tip: Open your browser's DevTools โ Network tab when testing to see the tracking requests.