Cross-Domain Tracking for Webflow & Web Apps

How to keep attribution intact when visitors move from a Webflow site to a web app or vendor subdomain.

  • When visitors move from a Webflow landing page to an app, booking tool, or checkout, the gclid and UTMs are lost and conversions get credited to the wrong domain.
  • GA4's cross-domain setting (one measurement ID plus configured domains, producing a _gl parameter) keeps sessions together but does NOT pass the gclid to your app and fails if redirects or vendors strip _gl.
  • Fix it yourself in four moves: capture gclid/gbraid/wbraid/fbclid/msclkid and UTMs on the landing page via head code, append them to every outbound link to the app, populate hidden form fields, and read them on the app's first page.
  • The most important step is storing click IDs and first-touch UTMs (with a timestamp) on the lead or user record at signup, so attribution no longer depends on a cookie surviving.
  • Upload offline conversions to Google Ads using the stored click ID (gclid, or gbraid/wbraid for some iOS traffic) plus conversion name, time, value, and an order/lead ID to prevent double counting; the click must be within 90 days.
  • If you collect an email, enhanced conversions for leads can match on a hashed email when no click ID exists.
  • For vendor domains you can't tag, use the vendor's GA4/GTM or UTM pass-through settings, a return URL to a thank-you page on your domain, or webhooks to send the conversion from your server.
  • Add vendors to GA4's unwanted referrals list so returning visitors aren't credited to them, and run the click ID storage script under the same consent category as your ad tags since it stores an identifier in the browser.

When a visitor leaves a Webflow landing page for an app or vendor subdomain, the gclid and UTMs are lost and the conversion is credited to the wrong domain.

If you want attribution to survive the move from a Webflow site to a web app, a booking tool or a checkout, carry the click IDs and UTMs across yourself and store them with the lead. GA4’s cross-domain setting helps, but it only covers part of the problem.

Where Attribution Breaks

Setup What Happens
example.com to app.example.com Same root domain, so GA4 cookies are shared. Breaks only if the app uses a different GA4 property or doesn’t load the tag.
example.com to exampleapp.io Different domain. A new session starts with your own site as the referrer.
example.com to a vendor domain (booking, checkout, forms) You often can’t add your tag at all. The conversion happens where you can’t see it.
Any of the above The gclid stays behind in the landing page URL, so Google Ads can’t match the conversion to a click.

Step 1: Use One GA4 Property & Configure Domains

  1. Load the same GA4 measurement ID on the Webflow site and the app.
  2. In GA4, go to Admin > Data streams, open the stream, then Configure tag settings > Configure your domains.
  3. Add every domain a visitor can pass through.
  4. Click from the site to the app and confirm the URL gains a _gl parameter.

This keeps the session together in GA4. It doesn’t pass the gclid to your app, and it doesn’t work if a redirect or the vendor strips the _gl parameter.

Step 2: Capture Click IDs on the Landing Page

Save the click IDs and UTMs the moment the visitor arrives. Add this to the Webflow site’s head code:

<script>
(function(){
  var keys = ['gclid','gbraid','wbraid','fbclid','msclkid','utm_source','utm_medium','utm_campaign','utm_term','utm_content'];
  var params = new URLSearchParams(location.search);
  var saved = {};
  try { saved = JSON.parse(localStorage.getItem('attribution') || '{}'); } catch (e) {}
  var found = false;
  keys.forEach(function(k){
    if (params.get(k)) { saved[k] = params.get(k); found = true; }
  });
  if (found) {
    saved.landing_page = location.href.split('?')[0];
    localStorage.setItem('attribution', JSON.stringify(saved));
  }
  window.attribution = saved;
})();
</script>

This stores an identifier in the browser, so run it under the same consent category as your ad tags.

Step 3: Carry Them Across the Boundary

Local storage doesn’t cross domains, so the values have to travel in the link. This adds them to every link that points at the app:

<script>
document.addEventListener('DOMContentLoaded', function(){
  var a = window.attribution || {};
  document.querySelectorAll('a[href*="app.example.com"], a[href*="exampleapp.io"]').forEach(function(link){
    var url = new URL(link.href);
    Object.keys(a).forEach(function(k){
      if (k !== 'landing_page' && !url.searchParams.has(k)) { url.searchParams.set(k, a[k]); }
    });
    link.href = url.toString();
  });
});
</script>

For forms, add hidden fields named gclid, utm_source and so on, and fill them from window.attribution the same way.

Step 4: Store Them With the Lead

On the app side, read the parameters on the first page and save them to the user or lead record at signup. This is the step that matters most. Once the gclid is in your database or CRM, attribution no longer depends on a cookie surviving.

  • Save gclid, gbraid and wbraid in their own fields.
  • Save the UTMs as first touch values and don’t overwrite them.
  • Save the timestamp of the click or signup.

Step 5: Send Offline Conversions to Google Ads

When the lead becomes a real conversion (a paid account, a qualified lead, a booked call that happened), upload it to Google Ads with the stored click ID:

  • The gclid, or gbraid / wbraid for some iOS traffic
  • The conversion name, time and value
  • An order or lead ID, so the same conversion isn’t counted twice

The click has to be within 90 days. If you collect an email, enhanced conversions for leads can match on a hashed email when there’s no click ID.

Google Ads now optimizes toward conversions that happened in your app, not form fills on the landing page.

Vendor Domains You Can’t Tag

  • Use the vendor’s own settings. Most booking and checkout tools accept a GA4 ID or GTM container, and pass through UTM parameters.
  • Send a return URL. Redirect back to a thank you page on your domain and fire the conversion there.
  • Use webhooks. Have the vendor post the completed booking or payment to your server, then send the conversion from there.
  • List the vendor as an unwanted referral in GA4, under Configure tag settings > List unwanted referrals, so returning visitors aren’t credited to it.

Related: UTM attribution, web to app cross-device attribution and broken attribution in HubSpot.