# Web Analytics Source: https://docs.loops.fi/guides/analytics Track visitor behavior and identify users with the Loops analytics script Using data from the Loops analytics script, we can tell you what pages on your site are the most effective at converting visitors into customers. ## Step 1: Get Your Tracking Script Visit the dashboard to get the specific tracking script for your organization. Get Tracking Script ## Step 2: Install the Tracking Script Add the script to your website's `` section: ```html theme={null} ``` That's it! The script will automatically track page views and be available as `window.loops`. ## What Gets Tracked Automatically Once installed, the script tracks: * **Page views** - Every page visit * **UTM parameters** - Campaign source, medium, and content * **Referrers** - Where visitors came from * **Device info** - Browser, OS, screen size * **Facebook cookies** - `_fbc` and `_fbp` for Meta ad attribution * **Google cookies** - `_gcl_aw`, `_gcl_au`, and `_ga` for Google Ads attribution You can view this data on the analytics page in the dashboard. Analytics Page ## Step 3: Identify Users (SDK) Besides tracking page views, the Loops script can also be used to identify users and track custom events. When a user signs up or logs in, call `identify` to link their activity to their account: ```javascript theme={null} loops.identify('user_123', { email: 'john@example.com', name: 'John Doe' }); ``` This connects their browsing history to their user profile, enabling accurate attribution. ## Step 4: Track Custom Events (Optional) Track specific actions on your site: ```javascript theme={null} loops.track('purchase', { product: 'Premium Plan', amount: 99.99 }); ``` # Conversion Tracking Source: https://docs.loops.fi/guides/conversions Track payment and booking conversions to attribute revenue to your marketing Loops can track conversion events from multiple sources, which helps you attribute revenue and improve marketing effectiveness. Conversion Events ## Stripe (Payment Conversions) Connect your Stripe account to automatically track payments as conversions. This enables you to see which ads and marketing channels are driving actual revenue. ### What Gets Tracked Once connected, Loops automatically captures these Stripe events: * **checkout\_completed** - Checkout session completions * **payment\_completed** - Successful payments * **subscription\_created** - New subscriptions * **subscription\_updated** - Plan upgrades and renewals * **invoice\_paid** - Paid invoices * **charge\_succeeded** - Successful charges Each event includes revenue data, allowing you to calculate ROI across your marketing channels and identify which campaigns are driving the highest LTV customers. ### Step 1: Connect Your Stripe Account Use the OAuth flow on the Integrations page in the dashboard. Stripe Connection Page ### Step 2: Verify Connection Once connected, you'll see Stripe's status change to "Receiving payment events" with your recent revenue displayed. Loops automatically syncs this data to the dashboard, so you can view your revenue attribution in the dashboard. ## Meta Pixel (Conversions API) The Meta Pixel integration sends server-side conversion events to Meta's Conversions API (CAPI). This improves ad attribution accuracy, especially for iOS users affected by App Tracking Transparency. ### What Gets Tracked When Stripe events occur, Loops automatically forwards them to Meta CAPI: | Stripe Event | Meta Event | | ------------------------------- | --------------------- | | `checkout.session.completed` | Purchase | | `customer.subscription.created` | Subscribe | | `invoice.paid` | Purchase | | `invoice.payment_failed` | PaymentFailed | | `customer.subscription.deleted` | SubscriptionCancelled | ### Prerequisites Before connecting Meta Pixel, you'll need: * A Meta Pixel ID (15-17 digits) * A Conversions API access token ### Step 1: Get Your Meta Pixel Credentials 1. Go to [Meta Events Manager](https://business.facebook.com/events_manager2) 2. Select your pixel and go to **Settings** 3. Copy the **Pixel ID** (15-17 digits) 4. Scroll to the **Conversions API** section 5. Click **Generate access token** and copy it ### Step 2: Connect Meta Pixel in Loops 1. Go to the **Integrations** page 2. Find **Meta Pixel** in the Conversions section 3. Click **Connect** and enter: * A friendly name (e.g., "Website Pixel") * Your Pixel ID * Your Conversions API access token ### Step 3: Enhance Attribution with Customer Metadata For better attribution matching, include Meta tracking data when creating Stripe customers. Loops will automatically forward this data to Meta CAPI. **Collect Facebook cookies on your frontend:** ```javascript theme={null} function getCookie(name) { const value = `; ${document.cookie}`; const parts = value.split(`; ${name}=`); if (parts.length === 2) { return parts.pop().split(';').shift(); } } // Get Meta tracking cookies const fbc = getCookie('_fbc') || null; const fbp = getCookie('_fbp') || null; ``` **Include tracking data in Stripe customer metadata:** ```javascript theme={null} const customer = await stripe.customers.create({ email: customerEmail, metadata: { client_ip: req.ip || req.headers['x-forwarded-for'], client_user_agent: req.headers['user-agent'], fbc: fbc || '', fbp: fbp || '', } }); ``` This metadata enables Meta to match conversions back to the original ad clicks. ## Cal.com (Booking Conversions) Track Cal.com meeting bookings as conversion events. This is useful for B2B companies where a booked demo or sales call is a key conversion. ### What Gets Tracked * **booking\_created** - When a meeting is booked * **booking\_cancelled** - When a booking is cancelled Each booking includes details like attendee email, event type, and scheduling information. ### Step 1: Connect Cal.com in Loops 1. Go to the **Integrations** page 2. Find **Cal.com** in the Conversions section 3. Click **Connect** and enter a name for this integration 4. Copy the generated **webhook secret** — you'll need this next ### Step 2: Configure the Webhook in Cal.com 1. Go to your [Cal.com Settings → Webhooks](https://app.cal.com/settings/developer/webhooks) 2. Click **New Webhook** 3. Configure the webhook: * **Subscriber URL**: Paste the webhook URL shown in Loops * **Secret**: Paste the webhook secret you copied * **Event Triggers**: Select `BOOKING_CREATED` and `BOOKING_CANCELLED`, or just leave all selected 4. Save the webhook Cal.com Webhook Configuration ### Step 3: Enable Attribution (Optional) To link bookings back to website visitors, Loops can assign users an anonymous ID to be tracked across the conversion event. Please contact us at [support@loops.fi](mailto:support@loops.fi) to set this up. # Top of Funnel Source: https://docs.loops.fi/guides/top-of-funnel Connect your ad platforms to see which campaigns drive the most revenue Connect your top of funnel data to Loops to get insights into what ads are driving the most revenue. ## Google Ads Connecting to your Google Ads account requires you to sign in with your Google account and to give Loops read access to your Ads account. ### Step 1: Connect Your Google Ads Account to Loops To connect, go through the OAuth flow with an account that has Standard or Admin access. You will need to approve the `https://www.googleapis.com/auth/adwords` scope so Loops can read your campaign data. ### Step 2: View Your Google Ads Data You can view your ad performance in concordance with the rest of your marketing data on the Loops page. Loops Metrics ## Meta Ads Some manual setup is required to connect your Meta Ads account to Loops. ### Prerequisites Send us your Meta Ads account ID and accept Loops' request to become a partner to your account. This allows us to fetch your campaign performance. You can find your account ID: In your Meta Business Portfolio, under ads accounts: Meta Ads Account ID in Business Portfolio Or, in your Meta Ads account, in the account selector: Meta Ads Account ID in Ads Account ### Step 1: Connect Your Meta Ads Account to Loops 1. Go to the Integrations page in your Loops dashboard. 2. Click on the **Connect Account** button. Make sure you are signed in as an Admin or Advertiser to the Meta account you wish to connect. Meta OAuth Flow ### Step 2: Sync Your Meta Ads Data Now you can sync your Meta Ads data to the Dashboard. If you have a very large campaign, this might take a while. You can change how much data is synced by using the date range filter. ### Step 3: View Your Meta Ads Data Once synced, you can view your campaign performance in the graph and table. Meta Ads Data in Dashboard # Getting Started with Loops Source: https://docs.loops.fi/introduction Learn how to setup your Loops account Loops is an analytics platform that gives you unique insights on where your most valuable customers are coming from. To get started, we need to connect your marketing and conversion data. Integrations Page ## What You Can Connect Connect Google Ads and Meta Ads to see which campaigns drive the most revenue. Install the Loops tracking script to understand visitor behavior and identify users. Track payments from Stripe, bookings from Cal.com, and send events to Meta CAPI. Once connected, you'll be able to see the full customer journey from ad click to conversion, helping you optimize your marketing spend. # Support Source: https://docs.loops.fi/support We love to support customers, quickly. Reach out anytime. Thank you for reaching out and helping us make Loops & our docs better. We greatly appreciate it! ## Email You can reach us at [support@loops.fi](mailto:support@loops.fi)