Question from user:
For a client I’m trying to connect incoming Leads to SF Campaigns and SF Campaigns to Online Marketing Campaigns (Google Ads, Linkedin Ads, Facebook Ads, etc).
Client has a WordPress website with the GravityForms module and the GravityForms Salesforce Add-In. This allows their users to submit a form which will then land in Salesforce as a Lead.
There are several hidden fields that are sent along whose values are stored on custom fields on the Lead object.
There is another Gravity Forms module, AFL UTM Tracker, which helps us to populate hidden form fields with Online Marketing Campaign Information.
Like UTM Medium, UTM Source, UTM Term, UTM Content, UTM Campaign, UTM Link, Landing Page URL, Keyword, Referral, Referral Form, GCLID, etc.
Now my main question is:
How can I best match incoming Leads to SF Campaigns so that I can really start attributing revenue to Online Campaigns?
My idea was to create a Flow that triggers on Lead creation which searches Campaigns for the occurrence of a Lead value on the Campaign Object and returns exactly one Campaign.
So if the Lead field UTM_Campaign__c = 18734000000 I want to search for Campaigns for 18734000000 stored on one of the Custom Campaign fields.
But what campaign values are available when a user submits the form?
How granular can I get information from Google Ads?
Did someone run into similar problems?
ps. GravityForms including Salesforce Add-In and AFL UTM Tracker are well built and I can def recommend them.
Answer from Nabil:
The combination of Salesforce API + Google Ads API + Facebook Conversions API + Google Analytics Data API + Google Tag Manager (GTM) with a server-side solution like Stape or Google Cloud Platform (GCP) is an awesome solution because it future-proofs your tracking and provides much richer data.
That’s a great question, and it sounds like you’re on the right track with using UTM parameters and a Flow in Salesforce.
Your proposed approach of matching the incoming Lead
‘s UTM Campaign value to a custom field on a Salesforce Campaign is a solid starting point for initial attribution.
However, to get truly granular and robust attribution that connects revenue back to specific ad clicks or impressions, you’re hitting the limits of what UTMs alone can provide, especially when dealing with stricter privacy settings and cookieless tracking.
The values available when a user submits the form are only those that you’ve successfully captured and passed via the hidden fields, typically from the URL’s UTMs or the GCLID.
GCLID (Google Click ID) is particularly valuable from Google Ads as it can be used to connect the Lead to a specific click, but you’ll need a mechanism on the Google Ads side to complete that loop, often through offline conversion import.
To move beyond this initial matching and achieve better revenue attribution, you should consider a more integrated, server-side tracking approach that uses the APIs of the platforms you mentioned.
The combination of Salesforce API + Google Ads API + Facebook Conversions API + Google Analytics Data API + Google Tag Manager (GTM) with a server-side solution like Stape or Google Cloud Platform (GCP) is an awesome solution because it future-proofs your tracking and provides much richer data.
The Salesforce API, specifically, allows you to not only create the Lead
but also, crucially, to push an event back to your ad platforms.
Once a Lead is created and attributed to a Salesforce Campaign, you can use the Salesforce API to send a Lead
or MQL
event back to Google Ads via its API, and a Lead
or Purchase
event via the Facebook Conversions API.
This completes the loop, telling the ad platform, “Hey, the click you recorded for Ad X resulted in a Lead/Conversion in Salesforce,” allowing the ad platform’s internal algorithm to optimize better.
Similarly, you can push data into Google Analytics (GA4) using the Google Analytics Data API, giving you a complete view of the user journey alongside your other business data.
Using GTM, in conjunction with a server-side tagging environment like Stape or GCP, means you are sending data from your website to your own server endpoint first, and then to Google Ads, Facebook, and others.
This avoids the browser-based tracking issues (like ad-blockers or Safari’s ITP) that often strip out GCLID
or other vital tracking information before the form submission.
This server-side approach is more reliable for capturing parameters like GCLID
and fbc/fbp
(Facebook Click ID/Browser ID), which are essential for robust attribution.
In essence, your server-side GTM environment receives the raw, untainted data and then sends a clean, validated conversion event directly to the platforms, resulting in more accurate and granular reporting, directly matching the revenue-generating events in Salesforce with the initial ad campaign.
This is how you can really start attributing revenue to Online Campaigns
, not just Leads
.