Google Analytics is the most widely used web analytics platform that tracks website traffic and user behavior. It provides comprehensive…
Full ReviewThe world's leading cloud-based CRM platform powering sales, service, and marketing for businesses of all sizes.
Full ReviewSalesforce tracks what happens after a lead enters your sales pipeline — deal stages, revenue, close dates, and customer lifetime value. Google Analytics tracks what happens before that — which channels, campaigns, and pages drive traffic and conversions. Connecting them closes the loop between marketing spend and actual revenue, answering the question every marketing team asks: "Which campaigns produce deals that actually close?"
Without this integration, marketing teams optimize for top-of-funnel metrics like clicks, sessions, and form submissions. With it, they can optimize for revenue. A Google Ads campaign that generates 100 leads but only 2 deals is less valuable than one that generates 30 leads but 10 deals. This integration makes that distinction visible by connecting web analytics data to CRM outcomes.
There is no direct native integration between Google Analytics (GA4) and Salesforce that you can enable with a single click. Google and Salesforce are separate ecosystems, and connecting them requires middleware, data import features, or custom development.
However, several established methods exist:
The most impactful setup is connecting Google Ads offline conversions from Salesforce. Here is how to set that up, along with the GA4 data import approach.
In your Google Ads account, go to Settings > Account Settings and ensure Auto-tagging is enabled. This appends a GCLID parameter to every ad click URL. On your website, capture the GCLID value from the URL when a visitor arrives and store it in a cookie or hidden form field.
When a lead submits a form on your website, include the GCLID value as a hidden field. This value should be stored in a custom Salesforce field on the Lead or Contact record (create a custom field called "Google Click ID" or "GCLID"). This is the key that links the Google Ads click to the Salesforce record.
In Google Ads, go to Tools & Settings > Measurement > Conversions. Click + New Conversion Action and select Import. Choose Salesforce as the data source. Follow the prompts to connect your Salesforce org using OAuth authorization. You will need Salesforce admin credentials with API access.
Select which Salesforce Opportunity stages or Lead statuses count as conversions in Google Ads. Common mappings include:
Set the conversion value to the Opportunity Amount field for revenue-based conversions.
Set the import to run automatically on a daily schedule. Google Ads will pull new conversions from Salesforce each day and match them to the original ad clicks using the GCLID. Conversions may appear in Google Ads reports 1-3 days after the import runs.
Create a Salesforce report that includes Closed Won Opportunities with the following fields: Client ID (or User ID from GA4), Revenue Amount, Close Date, and any other dimensions you want to analyze. Export this as a CSV file.
GA4 Data Import requires a specific CSV format. The key is matching records between GA4 and Salesforce. You need a common identifier — typically the GA4 Client ID (stored as a custom dimension) or a User ID. Format the CSV with columns that match your GA4 event parameters.
In GA4, go to Admin > Data Import. Create a new data source, select the data type (Event data or User data), upload your CSV file, and map the columns to GA4 dimensions and metrics. For automated uploads, use the GA4 Management API to schedule regular data imports.
| Data | Direction | Sync Method | Notes |
|---|---|---|---|
| Offline conversions (GCLID-based) | Salesforce to Google Ads | Daily automated import | Requires GCLID captured on web forms and stored in Salesforce |
| Revenue data | Salesforce to GA4 or Google Ads | CSV import or API | Matched by Client ID, User ID, or GCLID |
| Lead/Opportunity stage changes | Salesforce to Google Ads | Daily import | Multiple stages can be mapped as separate conversion actions |
| Customer lists for remarketing | Salesforce to Google Ads | Manual or scheduled CSV upload | Uses Customer Match; requires email or phone |
| Web analytics data | GA4 to Salesforce (indirect) | Via data warehouse or ETL tool | GA4 does not push data to Salesforce natively |
The Google Ads-Salesforce offline conversion import runs on a daily schedule by default. Conversions typically take 1-3 days to appear in Google Ads reports after import. For GA4 data imports, the frequency depends on whether you automate the process (via API) or do it manually.
The most critical point of failure. If the GCLID is not captured from the URL and stored in Salesforce, offline conversion import will not work. Common causes: the landing page strips URL parameters, the form does not include a hidden GCLID field, or the CRM field mapping drops the value. Solution: Test the full flow from ad click to Salesforce record. Click an ad, submit the form, and verify the GCLID appears on the resulting Salesforce Lead. Use a JavaScript snippet on your landing pages to capture and persist the GCLID from the URL parameter into a cookie and hidden form field.
If the import runs but no conversions are matched, the GCLIDs in Salesforce may be stale (more than 90 days old), corrupted (partial strings), or from a different Google Ads account. Solution: Verify GCLID format is correct, ensure the Google Ads account connected to Salesforce is the same one generating the clicks, and check that the conversion date in Salesforce falls within Google Ads' lookback window (default 90 days).
Google Ads attributes revenue based on the click date, while Salesforce reports revenue based on the close date. A deal clicked in January but closed in March shows as January revenue in Google Ads but March revenue in Salesforce. This is expected behavior — neither number is wrong, they are just measuring different things. Document this difference for stakeholders to avoid confusion.
If you are importing Salesforce data to GA4 using Client ID as the matching key, the Client ID must be captured at the time of form submission and stored in Salesforce. The GA4 Client ID is stored in the _ga cookie and changes if the user clears cookies or switches devices. Solution: Capture the Client ID via JavaScript at form submission time and pass it to Salesforce as a custom field. Accept that cross-device attribution will have gaps.
These platforms can help you connect Google Analytics and Salesforce without writing code:
Compare Google Analytics vs Salesforce side by side »