๐งช Test Page - Trace Analytics
This page demonstrates the trace analytics script in action.
๐ Quick Start
Embed this script on your website:
๐ง Current Testing Setup
<script>
// Currently using trace.js for both local and production testing
const script = document.createElement('script);
script.src = '/latest/trace.js?v=' + Date.now();
document.head.appendChild(script);
</script>Testing Phase: Using trace.js for both environments to verify functionality
Production vs Development
Development:
<script>
// Override for local development (optional)
window.traceAnalyticsConfig = {
apiBaseUrl: 'http://localhost:3000',
debugMode: true
};
const script = document.createElement('script');
script.src = '/latest/trace.js';
document.head.appendChild(script);
</script>Optional local override, defaults to production
Production:
<script>
// Production configuration
window.traceAnalyticsConfig = {
apiBaseUrl: 'https://trace.nokhaos.com',
debugMode: false
};
// Production script from CDN
const script = document.createElement('script');
script.src = 'https://trace.nokhaos.com/latest/trace.min.js';
document.head.appendChild(script);
</script>Production API endpoints, optimized
๐ How to Monitor Tracking
- Open your browser's Developer Tools (F12)
- Go to the Network tab
- Look for a POST request to
/api/track - Click on it to see the tracked data payload
๐ฏ UTM Parameter Testing
Try visiting this page with UTM parameters to test attribution tracking:
๐ Data Collected
The tracker automatically collects:
๐ Page Information
- URL and path
- Page title
- Referrer
- Domain
๐ Browser Data
- Browser type & version
- Operating system
- Language settings
- User agent
๐ฑ Device Info
- Device type
- Screen dimensions
- Viewport size
- Timezone
๐ฏ Marketing
- UTM parameters
- Attribution data
- Campaign tracking
- Session data
๐ง Troubleshooting
If you don't see tracking requests:
- Check that your Supabase credentials are configured in
.env.local - Ensure the
web_eventstable exists in your database - Look for any JavaScript errors in the Console tab
- Verify the tracker script is loading (check Sources/Elements tab)