Skip to main content

Server-Side Setup Guide

This guide shows you how to set up a backend to collect and manage DataGlue attribution and journey data. Choose the approach that best fits your stack.

Architecture Overview

Data Flow Diagram


Option 1: N8N Webhooks + Supabase (Easiest)

Best for: Non-developers, rapid prototyping, visual workflows

Architecture

Setup Steps

1. Create Supabase Project

2. Create N8N Workflows

Workflow 1: Identify User
Workflow 2: Track Event
Workflow 3: Sync Complete Journey

3. Configure DataGlue

Pros & Cons

Pros:
  • ✅ No code required (visual workflows)
  • ✅ Built-in error handling & retries
  • ✅ Easy debugging (see every request)
  • ✅ Can add multiple outputs (Slack, email, etc.)
  • ✅ Supabase has generous free tier
Cons:
  • ❌ N8N costs $20/month (or self-host)
  • ❌ Slightly slower than custom server
  • ❌ Limited to N8N’s capabilities

Option 2: Serverless Functions (Vercel/Netlify)

Best for: Next.js/React apps, developers who want simplicity

Architecture

Setup Steps

1. Install Dependencies

2. Create API Routes

File: pages/api/glue/identify.js (Next.js)
File: pages/api/glue/track.js

3. Configure DataGlue

Pros & Cons

Pros:
  • ✅ No server management
  • ✅ Auto-scaling
  • ✅ Generous free tiers (Vercel: 100GB bandwidth)
  • ✅ Fast cold starts
  • ✅ Easy to deploy
Cons:
  • ❌ Requires coding
  • ❌ Limited execution time (10-60 seconds)
  • ❌ Cold starts can add latency

Option 3: Custom Server (Node.js + Express)

Best for: Developers who want full control, high-volume apps

Architecture

Setup Steps

1. Install Dependencies

2. Create Server

File: server.js

3. Deploy

Pros & Cons

Pros:
  • ✅ Full control over logic
  • ✅ Can handle high volumes
  • ✅ No cold starts
  • ✅ Custom optimizations
  • ✅ Direct database access
Cons:
  • ❌ Requires server management
  • ❌ Need to handle scaling
  • ❌ More code to maintain
  • ❌ Security considerations

Cross-Device Identity Resolution

The Challenge

Solution: Email-Based Merging


Analytics Queries

User Journey

Attribution Report

Conversion Funnel


Comparison Table


Start simple, scale later:
  1. Begin with N8N + Supabase (fastest)
  2. As you grow, migrate to Serverless Functions
  3. At scale, move to Custom Server
  4. Your data stays in Supabase/PostgreSQL throughout

Next Steps

  1. Choose your approach based on the comparison table
  2. Create database tables in Supabase/PostgreSQL
  3. Set up your webhook/API endpoints
  4. Configure DataGlue with your endpoint URL
  5. Test with a form submission
  6. Query your data to see user journeys
  7. Build analytics dashboards on top of the data
Need help? Check out: