Skip to content

How to integrate Google Analytics data into Salesforce

Google Analytics shows which visits arrive, but not reliably which campaigns produce leads, Opportunities and revenue inside your CRM. Capturing Channel and Landing Page at form submission closes that gap: each Salesforce lead carries the origin and first page that brought the visitor, so reports can compare channels on business outcomes rather than traffic alone.

Why traffic data alone is not enough

Analytics tools make it easy to count visitors by campaign. The harder question for budget decisions is which of those visits became leads, Opportunities, Closed Won deals and revenue. Without origin data on the CRM record, that link is lost when a visitor moves from the website to a form.

The fix is to capture origin at the moment of arrival, keep it in the browser, and attach it to the lead when the form is submitted. Two ideas do most of the work: Channel, meaning how the visitor arrived, and Landing Page, meaning which content they first saw. With those two dimensions on every lead, Salesforce reports can break outcomes down by Paid Search, Organic Search, Paid Social, Referral and similar groupings, and by the page group that attracted the visitor.

How the capture works

A small website script examines the technical signals analytics tools use to identify where a visitor came from. It groups that origin into a Channel such as Paid Search, Paid Social or Organic Search, adds drill-down detail, and stores the result in a cookie. When the visitor later submits a lead form, the script fills hidden fields with the stored values and submits them alongside name, email and phone.

Checklist before you start:

  • Confirm the six hidden fields exist on every lead form you want to measure.
  • Confirm the script is installed on every page where a first visit can land.
  • Test a submission from a tagged campaign and verify each field arrives in Salesforce.
  • Decide how Landing Page Group will be assigned so blog, Features and other content roll up consistently.

Four steps to set it up

Step 1: Add hidden fields to lead forms. Most form builders support hidden fields directly; a custom HTML form can use hidden input elements. The fields are Channel, Channel Drilldown 1, Channel Drilldown 2, Channel Drilldown 3, Landing Page and Landing Page Group.

Step 2: Let the script complete the fields. When a visitor completes a form, the stored origin and first landing page populate those fields automatically.

Step 3: Pass the data into Salesforce. On submission, Channel and Landing Page values move into the CRM with the lead's contact details.

Step 4: Report in Salesforce or a connected BI tool. Group leads, Opportunities, Closed Won deals and revenue by Channel, drill-down and Landing Page Group.

Worked example: reading one captured lead

Worked example: a visitor arrives from a brand campaign in Paid Search and first lands on a Features page. The form would carry Channel = Paid Search, Channel Drilldown 1 = Google, Channel Drilldown 2 = Brand Campaign, Channel Drilldown 3 = the brand term, Landing Page = the Features URL, and Landing Page Group = Features. That single record can later be counted in a Paid Search report, a Google Ads campaign report and a Features content report without extra tagging.

For Paid Search, drill-downs can carry campaign, ad group and keyword detail. For landing data, keep both the exact first page and its group, so you can compare one blog post against the whole blog.

Reports to run first

Start with Leads by Channel by month to see which origins produce volume. Then move downstream: Opportunities by Google Ads campaign shows which campaigns create sales-ready pipeline, Customers by Facebook Ads network separates Facebook, Instagram, Messenger and WhatsApp performance, and Revenue from Organic Search by search engine quantifies SEO against paid channels. If most leads come from Organic Search while most budget goes to Paid Search, that mismatch is exactly the kind of decision this data supports.

Hidden fields to add to lead forms
Hidden fieldWhat it storesExample
ChannelBroad origin groupingPaid Search
Channel Drilldown 1First level of channel detailGoogle
Channel Drilldown 2Second level of channel detailBrand Campaign
Channel Drilldown 3Third level of channel detailBrand term
Landing PageFirst page the visitor sawFeatures page URL
Landing Page GroupCategory of the first pageFeatures

Field names as listed in source; confirm canonical spelling of Drilldown fields before implementation.

Four starter reports
ReportPrimary breakdownDecision it supports
Leads by ChannelChannel by monthWhere to invest for lead volume
Opportunities by Google Ads campaignCampaign by monthWhich campaigns create pipeline
Customers by Facebook Ads networkNetworkWhich social network drives customers
Revenue from Organic Search by search engineSearch engineValue of SEO versus paid channels

Report ideas from source; exact metrics depend on Salesforce objects and Closed Won data available.

Frequently asked questions

What do I need on my forms to capture channel data in Salesforce?

Add hidden fields for Channel, Channel Drilldown 1, Channel Drilldown 2, Channel Drilldown 3, Landing Page and Landing Page Group to the lead form. A website script identifies the visitor's origin, stores it in a browser cookie, and fills those fields when the form is submitted, so the values travel into Salesforce with the lead details.

What is the difference between Channel and Landing Page data?

Channel answers how the visitor arrived, such as Organic Search, Paid Search, Paid Social or Referral. Landing Page answers which content attracted them, such as a Features page, blog or eBook. Together they let you report both the route in and the content that worked.

Which reports become possible after the integration?

Once the fields are in Salesforce, group leads by Channel, Opportunities by Google Ads campaign, Customers by Facebook Ads network, and revenue from Organic Search by search engine. Those views show volume, conversion to Opportunity, Closed Won results and revenue by origin.