Journey Tracking
DataGlue now tracks complete user journeys - every session, every event, every step from first visit to conversion. All data is stored inlocalStorage as a backup, and optionally synced to your server.
Features
- ✅ Complete history - Every session and event from first visit
- ✅ Offline-first - Works without server, data stored in localStorage
- ✅ JSON format - Two simple collections:
usersandevents - ✅ Auto-identification - Detects email from forms or URL params
- ✅ First & last touch - Attribution tracking built-in
- ✅ Form-friendly - Works with native forms, Fillout, Typeform, etc.
Quick Start
Step 1: Add Profile Endpoint
Step 2: That’s It!
DataGlue automatically:- Tracks page views, clicks, form submits
- Stores everything in
localStorage(3 keys):glue_user_profile- User infoglue_sessions- All sessionsglue_events- All events
- Auto-identifies users when they fill email fields
- Sends data to your API endpoint
How It Works
User Journey Flow
Data Structure
localStorage Keys
glue_user_profile
glue_sessions
glue_events
JavaScript API
View Journey Data
Manual Tracking
Server Sync
Server-Side API
Your server needs to handle these endpoints:POST /glue/identify
Linksglue_user_id to email address.
Request:
POST /glue/track
Records individual events. Request:POST /glue/sync
Receives complete user data (all sessions + events). Request:Configuration Options
Script Tag Attributes
| Attribute | Default | Description |
|---|---|---|
profile-endpoint | - | Your API base URL |
auto-identify | true | Auto-identify from email fields/URL params |
auto-sync | false | Automatically sync data to server |
track-events | pageview,form_submit | Events to auto-track (comma-separated) |
Event Types
Auto-trackable events:pageview- Page viewsclick- Link and button clicksform_submit- Form submissions
Query Examples
Get User Journey
Conversion Funnel
Attribution Report
Best Practices
- Let forms redirect with query params - Easiest way to pass data between pages
- Use meaningful event names -
video_playednotevent_1 - Keep properties simple - JSON-serializable values only
- Implement server endpoints - Don’t rely solely on localStorage
- Test with different form providers - Fillout, Typeform, native HTML
Troubleshooting
Check localStorage Data
Debug Mode
Export Journey
FAQ
Q: Does this work with iframes? A: Yes! For embedded forms, they redirect with query params. DataGlue on the next page auto-identifies from URL. Q: What if my server is down? A: All data stays in localStorage. When server comes back up, callglue.sync.syncAll().
Q: How much localStorage space does this use?
A: ~10-50KB per user. DataGlue limits to 1000 events and 100 sessions automatically.
Q: Can I use this with Segment/Mixpanel?
A: Yes! Use glue.journey.track() and send to both DataGlue and your analytics tool.
Q: How do I handle multiple devices?
A: Each device has its own glue_user_id. When email is captured, your server links all IDs to one user.