Available Client-Side Tools
Analytics Script
Lightweight JavaScript snippet for any website
React
React component for analytics and embeds
Next.js
Next.js integration with App Router support
How It Works
Client-side tracking enables end-to-end conversion attribution:Features
All client-side tools provide:- Automatic Click Tracking - Stores click IDs from Dub short links
- First-Party Cookies - Uses your domain for better privacy and tracking
- Conversion Events - Track leads, sales, and custom events
- Privacy Compliant - No third-party tracking or PII storage
- Lightweight - Minimal performance impact on your site
Installation Methods
Choose the installation method that fits your tech stack:Vanilla JavaScript
Add the analytics script to any HTML website:React/Next.js
Install the@dub/analytics package:
Google Tag Manager
Add the Dub script through GTM for centralized tag management.Tracking Conversions
After installing the client-side script, use the server-side SDK to track conversions:Cookie Storage
The Dub script stores click IDs in a first-party cookie:- Cookie Name:
dub_id - Domain: Your website domain
- Duration: 30 days (configurable)
- SameSite:
Lax - Secure:
true(HTTPS only)
Privacy Considerations
- No personal data is stored in cookies
- Only anonymous click IDs are tracked
- Fully compliant with GDPR and privacy regulations
- First-party cookies for better browser compatibility
Next Steps
Choose your implementation method:Analytics Script
Add to any HTML website
React Component
Use in React applications
Next.js Integration
Integrate with Next.js
Track Conversions
Learn about conversion tracking