Blog
/
How to Connect Salesforce with Google Analytics 4 (GA4) - The Right Way

How to Connect Salesforce with Google Analytics 4 (GA4) - The Right Way

If you're generating leads through your website or running paid ad campaigns, you likely use Google Analytics to measure performance. But here’s the problem: your CRM Salesforce has no idea what happened before the form was submitted.

That's where Salesforce–Google Analytics integration comes in. And in 2025, with GA4 fully in place, it's more important and more complex than ever.

In this guide, we’ll break down how GA4 and Salesforce can work together, what challenges to expect, and how Heeet helps you unlock full-funnel attribution, natively inside Salesforce.

Tracking conversions beyond form completions

When asking some marketing teams how they are measuring their conversions and overall paid ads performances, they usually tell us that they only look at form completions.

Despite form completion being a strong KPI, it only gives part of the answers. Indeed, most of the "real" conversions happen once a form is submitted.

- Was the lead converted?
- Did we send a proposal?
- Did it turn into a closed won opportunity?
- And, the most important thing, how much revenue did it generate?

Why not tracking real conversions can be harmful?

When you're not tracking real revenue conversions from your investments you end up continuing bidding on under performing campaigns and might be missing revenue opportunities from under rated campaigns.

Some campaigns might be generating lot of leads but do not convert into revenue while some might be generating less leads but more revenue.

Let's take the example below, if you're being asked to spend additional 500$ on one campaign, which one would you pick up? I guess it would be Campaign 1

But if you start tracking properly acquisition data in your CRM then you can really see what campaigns or keywords truly convert.

With this new tracking data, you will be able to figure out that spending additional 500$ on campaign 2 would generate a 211% ROI (21% higher that investing on campaign1)

Why Integrate Google Analytics with Salesforce?

Marketing teams live in GA4. Sales teams live in Salesforce. Without integration, it’s hard to answer fundamental questions like:

  • Which campaigns actually lead to revenue?
  • How much does each lead really cost?
  • Where are we losing leads between click and closed deal?

Integrating GA4 with Salesforce allows you to:


✅ Connect sessions, campaigns, and traffic sources to leads
✅ Understand which touchpoints drive qualified pipeline
✅ Prove marketing ROI with revenue-based attribution

What Changed with GA4?

GA4 no longer uses Universal Analytics’ session-based model. Instead, it relies on events, user IDs, and client IDs. That makes integration trickier—but also more flexible if done right.

Key GA4 identifiers:

  • client_id: Unique browser/session identifier
  • user_id: Optional ID you can set (ideal for authenticated users)

You’ll need to capture these on your website and associate them with Salesforce records to build the link.

How to Link GA4 Data with Salesforce

Here’s the basic process:

1. Capture GA4 Identifiers on Your Website

Use Google Tag Manager or custom JavaScript to store the GA4 client_id and campaign UTM parameters in cookies.

gtag('get', 'GA_MEASUREMENT_ID', 'client_id', function(clientID) {
 document.cookie = `ga_client_id=${clientID}; path=/`;
});

2. Add Hidden Fields in Your Forms

When a user submits a form, pass client_id, utm_source, utm_medium, etc., as hidden fields. These get stored on the Salesforce Lead.

3. Send Salesforce Conversions Back to GA4

Use tools like GAConnector or direct API calls to send “conversion events” (like MQLs, Opp creation, or Closed Won) back to GA4. This lets you track not just lead volume but revenue.

POST https://www.google-analytics.com/mp/collect?measurement_id=...&api_secret=...
{
 "client_id": "1234.5678",
 "events": [{
   "name": "lead_submitted",
   "params": {
     "lead_id": "00Q...",
     "utm_campaign": "product_launch"
   }
 }]
}


The Challenges of Doing It Manually

🧩 GA4's data model is event-based, making integration harder
🧩 You need to track cookies, pass data, store it in Salesforce, and sync conversions
🧩 There’s no native connector from Salesforce to GA4 so it requires custom development or third-party tools

Heeet: Revenue Attribution That Connects It All

Instead of juggling multiple tools and scripts, Heeet automates the entire process:

  • ✅ Captures all GA4 identifiers, UTM parameters, and referrers
  • ✅ Stores them with every Lead, Contact, and Opportunity in Salesforce
  • ✅ Sends revenue and conversion events back to GA4 automatically
  • ✅ Gives you real-time dashboards and attribution insights inside Salesforce

Whether you're using Google Ads, LinkedIn, SEO, or email campaigns, Heeet ties every dollar spent to actual revenue no guesswork.

Final Thoughts

GA4 is powerful, but only if it's connected to your CRM. Without integration, you're stuck with vanity metrics. With Heeet, you get revenue intelligence and full visibility across the funnel.

Want to bridge the gap between GA4 and Salesforce?
Try Heeet for free or Book a Demo

Similar posts

Check out related blog articles