Quick Start
Get Your Website ID
Before installing the tracking script, you need to add your website to Loops on the dashbaord to get your tracking link:- Go to Loops Dashboard - Websites
- Click the “Add Website” button
- Enter your website name and domain
- Copy the provided script tag or note your
website-id
Installation
Add the copied script tag to your website’s<head> section:
window.loops.
Basic Usage
Identify a User
This should be called as soon as a user signs up or logs in to your website. This will associate the user with their events and allow you to track their behavior across their user journey.Features
- Facebook pixel cookies: Automatically captures
_fbcand_fbpfor ad attribution - Event tracking: Track custom events with any specific data you need
- Privacy-focused tracking: Built with privacy in mind for compliant analytics
- Debug mode: Optional debug logging for development
Configuration Options
You can configure the SDK using data attributes:data-website-id(required): Your unique website identifierdata-debug: Enable debug logging in console (default: false)data-auto-track: Automatically track page views (default: true)
API Reference
loops.identify(userId, data)
Identify a user and associate them with their events. Facebook pixel cookies (_fbc, _fbp) are automatically included.
userId(string, required): Unique identifier for the userdata(object, optional): Additional user propertiesemail(string): User’s email addressname(string): User’s full name- Any additional custom properties
loops.track(eventName, eventData)
Track a custom event with optional data.
eventName(string, required): Name of the eventeventData(object, optional): Event properties
loops.trackPageView(url, referrer)
Manually track a page view. Note: Page views are auto-tracked by default.
url(string, optional): Page URL (defaults to current URL)referrer(string, optional): Referrer URL
loops.isLoaded()
Check if the tracking script has loaded successfully.
Facebook Pixel Cookie Integration
The SDK automatically captures Facebook pixel cookies (_fbc and _fbp) and includes them with every identify() call. This enables accurate attribution for Facebook ad campaigns.
How it works
- User clicks a Facebook or Meta ad and lands on your site
- Facebook Pixel sets cookies:
_fbc(click ID) and_fbp(browser ID) - User browses your site and signs up
- You call
loops.identify(userId, { email, name }) - SDK automatically includes
_fbcand_fbpin the event - Your backend and Loops can use these cookies for server-side conversion tracking via Facebook CAPI
Cookie format
_fbc: Facebook click ID (e.g.,fb.1.1234567890.IwAR...)_fbp: Facebook browser ID (e.g.,fb.1.1234567890.123456789)
What Gets Tracked Automatically
Once installed, the SDK automatically tracks:- Page views: Every page visit on your site
- UTM parameters: Campaign source, medium, and content from URLs
- Referrers: Where visitors came from
- Device info: Browser, OS, screen size
- Facebook cookies:
_fbcand_fbpwhen available
Integrations Overview
Connect Loops with your revenue platforms and ad networks. Loops integrates with your e-commerce platforms, payment processors, and ad networks to provide complete revenue attribution and automated conversion tracking.Available Integrations
Revenue Platforms
Stripe - Track payments and subscriptions with automatic revenue attribution.- Payment sync with customer matching
- Subscription tracking
- Automatic conversion events
- Email-based attribution linking
Ad Networks
Meta Ads (Facebook/Instagram) - Send conversions back to Meta with CAPI (Conversions API) for improved attribution and ad optimization.- Server-side conversion tracking
- Browser-based click ID (fbclid) attribution
- Enhanced matching with customer data
- Real-time conversion postbacks
Meta Ads Integration
How It Works
Meta Ads integration uses the Conversions API (CAPI) to send server-side conversions back to Facebook, enabling accurate attribution even with iOS 14+ tracking restrictions.Revenue Attribution Flow
-
User Clicks Ad
-
User Browses Site
-
User Completes Purchase
-
Order Synced to Loops
-
Conversion Sent to Meta
Setup
-
Connect Meta Ads Account
- Navigate to Settings → Integrations
- Click “Connect” for Meta Ads
- Authorize Loops to access your ad account
- Select pixel/tag for conversion tracking
-
Configure Conversion Events
- Map conversion events (purchase, signup, lead)
- Configure conversion values
- Set up enhanced matching (email, phone hashing)
-
Verify Integration
- Create a test purchase with a known fbclid
- Check Event Stream for synced event
- Verify conversion appears in Meta Events Manager
- Confirm attribution is correct
Data Sent to Meta
Conversions:- Event name (Purchase, Lead, CompleteRegistration)
- Event time
- Conversion value and currency
- Click ID (fbclid) for attribution
- Email (SHA-256 hashed)
- Phone number (SHA-256 hashed)
- First name, last name
- City, state, zip code, country
Privacy & Compliance
- Customer data is SHA-256 hashed before sending to Meta
- Compliant with Meta CAPI requirements
- No plaintext PII sent to Meta
- GDPR-compliant with opt-out support
Stripe Integration
How It Works
Stripe integration syncs payments and subscriptions in real-time, automatically attributing revenue to the correct marketing source.Customer Journey
-
Anonymous Visitor
-
User Signs Up
-
User Subscribes
-
Attribution Complete
Setup
-
Connect Stripe Account
- Navigate to Settings → Integrations
- Click “Connect” for Stripe
- Authorize Loops to access your account
- Grant read permissions for payments and customers
-
Configure Sync Settings
- Select events to sync (payments, subscriptions, refunds)
- Configure attribution matching (email, customer ID)
- Set sync frequency (real-time webhooks or scheduled)
-
Verify Integration
- Create a test payment
- Check Event Stream for synced payment
- Verify customer attribution is correct
- Confirm revenue appears in dashboard
Data Synced from Stripe
Payments:- Payment intent ID
- Amount and currency
- Customer email and customer ID
- Payment method and status
- Created date
- Subscription ID
- Plan, price, and interval
- Customer email and customer ID
- Start date and status
- Renewal dates
- Email, name, phone
- Stripe customer ID
- Total lifetime value
- Created date
Webhooks
Real-time event processing for instant attribution:payment_intent.succeeded- Payment completedcustomer.subscription.created- New subscriptioncustomer.subscription.updated- Subscription changedinvoice.paid- Recurring paymentcharge.refunded- Refund processed
API Sync
Scheduled syncs run every 15 minutes for:- Historical payment data
- Missing webhook events
- Customer updates
- Subscription status changes
Attribution Matching
Email Matching
The most common method for linking Stripe customers to website visitors:Customer ID Matching
For platforms with customer accounts:- Stripe customer_id linked to Loops user_id
- All future payments automatically attributed
- Subscriptions attributed to original signup source
Integration Benefits
Accurate Revenue Attribution- Connect server-side payment data with client-side tracking
- No lost conversions from iOS 14+ tracking restrictions
- Cross-device attribution via email matching
- Server-side conversion tracking bypasses browser limitations
- Payments automatically trigger conversion events
- Subscriptions tracked from signup through renewals
- Refunds automatically update revenue metrics
- MRR (Monthly Recurring Revenue) calculated automatically
- Link anonymous visitors to paying customers
- Complete journey from ad click to subscription
- Cross-device attribution via email
- Lifetime value tracking per acquisition source
Troubleshooting
Orders/Payments Not Appearing?
Check:- Integration is connected and active
- Webhooks are configured correctly
- API credentials are valid
- Event Stream shows synced events
Conversions Not Attributed?
Verify:- Customer email matches visitor email
- Order within attribution window (default 30 days)
- Click ID present in visitor profile
- User identified via tracking
Conversions Not Sent to Ad Platform?
Ensure:- Ad account connected and authorized
- Conversion event mapped correctly
- Click ID present in order attribution
- Check integration logs for errors

