Skip to main content
Add DATALYR to your ClickFunnels pages to track visitors, conversions, and revenue from paid ads.

Use Cases

Sales Funnels Track every step of your funnel from ad click to purchase. See which traffic sources convert best. Lead Generation Funnels Capture opt-ins and attribute leads back to specific ad campaigns on Meta, Google, or TikTok. Webinar Funnels Track registrations, attendance, and conversions. See which ads drive the most qualified leads. Product Launches Monitor launch funnel performance and identify where visitors drop off.

Before You Start

  • You have a DATALYR account
  • You’ve created a workspace
  • You have a ClickFunnels account (Classic or 2.0)
  • You have access to edit your funnel pages

Step 1: Get Your Tracking Code

  1. Log in to your DATALYR dashboard
  2. Go to Settings → Tracking
  3. Copy your tracking script:
<script
  defer
  src="https://track.datalyr.com/dl.js"
  data-workspace-id="YOUR_WORKSPACE_ID">
</script>

Step 2: Add to ClickFunnels (Classic)

For Individual Pages

  1. Open your funnel in ClickFunnels
  2. Click on the page you want to track
  3. Click Settings (gear icon)
  4. Go to Tracking Code tab
  5. Paste your DATALYR script in Head Tracking Code
  6. Click Save
  7. Repeat for all pages in your funnel

For All Funnel Pages

  1. Go to your funnel settings
  2. Click Settings at the funnel level
  3. Go to Head Tracking Code
  4. Paste your DATALYR script
  5. Click Save
This adds tracking to every page in the funnel.

Step 3: Add to ClickFunnels 2.0

  1. Open your funnel in ClickFunnels 2.0
  2. Click Settings in the left sidebar
  3. Scroll to Tracking & Analytics
  4. Click Add Tracking Code
  5. Paste your DATALYR script
  6. Set placement to Header
  7. Click Save

Step 4: Verify Tracking Works

  1. Visit your published funnel page in a new browser tab
  2. Go to your DATALYR dashboard
  3. Click Events in the sidebar
  4. You should see a page_view event within 10 seconds
If you see events, you’re done!

What Gets Tracked Automatically

Once installed, DATALYR automatically captures:
  • Page views on all funnel pages
  • Visitor IDs (persistent across sessions)
  • UTM parameters from ad campaigns
  • Ad click IDs (fbclid, gclid, ttclid)
  • Referrer and traffic source
  • Device and browser information

Track Opt-in Forms

Track form submissions on your opt-in pages:
  1. Edit your page in ClickFunnels
  2. Click Settings
  3. Go to Tracking Code tab
  4. Add this to Footer Tracking Code:
<script>
  document.addEventListener('DOMContentLoaded', function() {
    // Find the form submission button
    const form = document.querySelector('form');
    if (form) {
      form.addEventListener('submit', function() {
        if (window.datalyr) {
          datalyr.track('lead_form_submission', {
            funnel_name: 'Lead Magnet Funnel',
            page_name: document.title
          });
        }
      });
    }
  });
</script>
Replace 'Lead Magnet Funnel' with your actual funnel name.

Track Order Bumps

Track when users select order bumps:
<script>
  document.addEventListener('DOMContentLoaded', function() {
    // Track order bump selection
    const orderBumpCheckbox = document.querySelector('input[name="order_bump"]');
    if (orderBumpCheckbox) {
      orderBumpCheckbox.addEventListener('change', function() {
        if (this.checked && window.datalyr) {
          datalyr.track('order_bump_selected', {
            product_name: 'Bonus Training',
            funnel_step: 'checkout'
          });
        }
      });
    }
  });
</script>

Track Purchases

Track purchase events on your order confirmation page:
  1. Go to your Thank You or Order Confirmation page
  2. Click Settings → Tracking Code
  3. Add this to Footer Tracking Code:
<script>
  if (window.datalyr && window.CFOrderInfo) {
    datalyr.track('purchase', {
      order_id: CFOrderInfo.id,
      revenue: parseFloat(CFOrderInfo.amount),
      currency: 'USD',
      product_name: CFOrderInfo.product_name,
      funnel_name: 'Main Sales Funnel'
    });
  }
</script>
Note: CFOrderInfo availability depends on your ClickFunnels setup. Test to verify it works.

Track Upsell Acceptance

Track when users accept upsells:
<script>
  if (window.datalyr) {
    datalyr.track('upsell_accepted', {
      product_name: 'Premium Upgrade',
      revenue: 97.00,
      currency: 'USD',
      funnel_step: 'upsell_1'
    });
  }
</script>
Add this to your upsell confirmation page.

Identify Users

After form submission, identify users for cross-device tracking:
<script>
  // After collecting email on opt-in page
  if (window.datalyr) {
    datalyr.identify('[email protected]', {
      email: '[email protected]',
      funnel: 'Lead Magnet Funnel',
      source: 'opt_in_page'
    });
  }
</script>
You can dynamically populate the email using ClickFunnels merge tags if available.

Track Funnel Steps

Track progression through your funnel:
<script>
  if (window.datalyr) {
    datalyr.track('funnel_step_viewed', {
      funnel_name: 'Main Sales Funnel',
      step_name: 'Checkout Page',
      step_number: 3
    });
  }
</script>
Add different step numbers to each page in your funnel.

Troubleshooting

Not seeing events? Check that:
  • Your tracking script is in Head Tracking Code (not Footer)
  • You’ve saved and published your funnel
  • Your workspace ID is correct
  • Ad blockers are disabled
  • You’re testing on the live funnel URL (not editor preview)
ClickFunnels 2.0 tracking not working? Make sure the script is set to Header placement, not Footer. Some ClickFunnels 2.0 pages require header placement. Form tracking firing multiple times? Make sure you only have one instance of the tracking script. Check both funnel-level and page-level tracking code. CFOrderInfo not defined? This variable may not be available on all ClickFunnels setups. Inspect your Thank You page with browser dev tools (F12) to check what variables are available.

Next Steps

Need Help?

Having trouble with ClickFunnels tracking? Check our troubleshooting guide or contact support.