Skip to content

Quickstart

This guide gets you from zero to tracking revenue attribution in 5 minutes.

  • A website or web app
  • A Stripe account (for revenue tracking)
  • Docker (for self-hosting) or use Zori Cloud
Terminal window
git clone https://github.com/ZoriHQ/zori.git
cd zori
cp example.env .env
docker-compose up -d

See the Manual Setup Guide for detailed instructions.

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
  1. Go to your Zori dashboard
  2. Navigate to Settings > Integrations
  3. Click “Connect Stripe”
  4. Authorize the connection

When creating a Stripe checkout or subscription, include the zori_visitor_id in metadata:

// Get the visitor ID from Zori
const visitorId = await window.ZoriHQ.getVisitorId();
// Pass it to your backend, then include in Stripe checkout
const 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.

Once payments start flowing, you’ll see exactly which channels drive revenue:

SourceVisitorsRevenue
Twitter Ads10,241$0
Blog Post847$12,400
Google3,102$4,200