Quickstart
This guide gets you from zero to tracking revenue attribution in 5 minutes.
Prerequisites
Section titled “Prerequisites”- A website or web app
- A Stripe account (for revenue tracking)
- Docker (for self-hosting) or use Zori Cloud
Step 1: Deploy Zori Backend
Section titled “Step 1: Deploy Zori Backend”Option A: Docker (Recommended)
Section titled “Option A: Docker (Recommended)”git clone https://github.com/ZoriHQ/zori.gitcd zoricp example.env .envdocker-compose up -dOption B: Manual Setup
Section titled “Option B: Manual Setup”See the Manual Setup Guide for detailed instructions.
Step 2: Add the Tracking Script
Section titled “Step 2: Add the Tracking Script”Add this to your website’s <head>:
<!-- Initialize queue first --><script> window.ZoriHQ = window.ZoriHQ || [];</script>
<!-- Load script asynchronously --><script async src="https://cdn.zorihq.com/script.min.js" data-key="your-publishable-key"></script>The script will automatically track:
- Page views
- Clicks
- Sessions
- UTM parameters
- Referrers
Step 3: Connect Stripe
Section titled “Step 3: Connect Stripe”- Go to your Zori dashboard
- Navigate to Settings > Integrations
- Click “Connect Stripe”
- Authorize the connection
Step 4: Pass Visitor ID in Payments
Section titled “Step 4: Pass Visitor ID in Payments”When creating a Stripe checkout or subscription, include the zori_visitor_id in metadata:
// Get the visitor ID from Zoriconst visitorId = await window.ZoriHQ.getVisitorId();
// Pass it to your backend, then include in Stripe checkoutconst session = await stripe.checkout.sessions.create({ // ... your checkout config metadata: { zori_visitor_id: visitorId }});This is the critical step that connects revenue to traffic sources.
Step 5: See the Truth
Section titled “Step 5: See the Truth”Once payments start flowing, you’ll see exactly which channels drive revenue:
| Source | Visitors | Revenue |
|---|---|---|
| Twitter Ads | 10,241 | $0 |
| Blog Post | 847 | $12,400 |
| 3,102 | $4,200 |
Next Steps
Section titled “Next Steps”- Self-Hosting Guide - Full deployment options
- Tracking Script Reference - All tracking features
- Stripe Integration - Detailed payment setup
- How It Works - Understanding the attribution model