calendar Last updated: 26 August 2026
integrate crm leads with windsor.ai
Data integration
How to's

How to integrate your CRM lead forms with Windsor.ai

Try It Now

Connect your data in 1 min. Free forever plan

Got insights from this post? Give it a boost by sharing with others!

When and why the lead forms integration is needed

A lead form is a form that allows a customer to provide his/her contact information to the advertiser. The form contains a few fields that are filled in by the customer, and a button to apply for a product/service, book a follow-up call/email, get a price quote, download a newsletter etc. Data from forms are collected and handled by Customer Relationship Management (CRM) platforms such as Salesforce, Hubspot, Marketo, Pardot, Active Campaign, Microsoft Dynamics, Pipedrive,…

A graphical representation of a complex customer journey
A graphical representation of a complex customer journey

From a conversion-tracking perspective, lead forms represent conversions that are deferred in time. The value of the conversion becomes known not when a potential customer clicks on a lead form submission button but later on when he/she becomes (or does not become) an actual client of the advertiser.

Integration process

The task is to link data on customer journey provided by Google Analytics with data on conversion value from a CRM. It can be completed in the following way:

A note on GA4: GA4 doesn’t have an Ecommerce toggle or a “Transaction” tag type the way Universal Analytics did. The good news is the modern approach is actually simpler: instead of generating your own custom journey ID, you can read GA4’s own Client ID directly, since Google Tag Manager now exposes it as a built-in variable. Here’s the current way to do it:

  1. Read GA4’s Client ID (and Session ID) via Google Tag Manager’s built-in variables, no custom JavaScript or cookie-parsing needed.
  2. Add a hidden field to your lead form and populate it with that Client ID.
  3. Make sure the hidden field’s value is sent to the CRM along with the rest of the lead form submission.
  4. When the CRM later records the conversion outcome (e.g. the lead becomes a won deal), send that outcome back to GA4 via the Measurement Protocol, using the same Client ID.

Changes necessary in Google Tag Manager

1. Enable the Client ID and Session ID variables

In your GTM container, go to Variables > Built-In Variables > Configure, and enable Client ID and Session ID under the Utilities section. These read the values GA4 already assigns to the visitor, no extra code required.

2. Add a hidden field to your lead form

Give it an id, e.g. ga_client_id.

3. Populate the hidden field on form load

Add a Custom HTML tag, firing on the page/form that contains your lead form. Use a snippet that sets the hidden field’s value to the GTM Client ID variable when the form loads.

4. Pass the Client ID to the CRM

Map the hidden field to a custom field on the CRM record, the same way you already map the rest of the form’s fields. For example, on a Salesforce Web-to-Lead form, add ga_client_id as a mapped hidden field alongside your other lead fields.

Sending the conversion back to GA4

When the CRM records the outcome (e.g. a deal is marked Won), trigger a server-side call to the GA4 Measurement Protocol:

POST https://www.google-analytics.com/mp/collect?measurement_id=G-XXXXXXX&api_secret=YOUR_SECRET
Content-Type: application/json

{
  "client_id": "<the Client ID stored on the CRM record>",
  "events": [
    {
      "name": "crm_conversion",
      "params": {
        "value": 250,
        "currency": "USD"
      }
    }
  ]
}

To create the required api_secret: in GA4, go to Admin > Data collection and modification > Data streams > Web > [your stream] > Measurement Protocol API Secrets > Create.

One real limitation to know about: unlike UA’s Ecommerce model, GA4 doesn’t retroactively rebuild your existing channel reports when a delayed conversion like this comes in. The event will show up in GA4’s Realtime and Events reports and can be used in custom explorations, but treat it as tagging the conversion value to the right visitor, not as an automatic historical recalculation.

Tired of juggling fragmented data? Get started with Windsor.ai today to create a single source of truth

Let us help you automate data integration and AI-driven insights, so you can focus on what matters, growth strategy.
g logo
fb logo
big query data
youtube logo
power logo
looker logo