Skip to main content

Journey Tracking

DataGlue now tracks complete user journeys - every session, every event, every step from first visit to conversion. All data is stored in localStorage 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: users and events
  • 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 info
    • glue_sessions - All sessions
    • glue_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

Links glue_user_id to email address. Request:
Example Handler (Node.js):

POST /glue/track

Records individual events. Request:
Example Handler:

POST /glue/sync

Receives complete user data (all sessions + events). Request:
Example Handler:

Configuration Options

Script Tag Attributes

Event Types

Auto-trackable events:
  • pageview - Page views
  • click - Link and button clicks
  • form_submit - Form submissions

Query Examples

Get User Journey

Conversion Funnel

Attribution Report

Best Practices

  1. Let forms redirect with query params - Easiest way to pass data between pages
  2. Use meaningful event names - video_played not event_1
  3. Keep properties simple - JSON-serializable values only
  4. Implement server endpoints - Don’t rely solely on localStorage
  5. 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, call glue.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.