Connecting HubSpot and Salesforce to Track Offline Conversions from Paid Ads

Why CRM Integration Matters for Paid Ads

Paid media drives traffic, but the true value of a campaign is realized only when the final sale or signed contract is recorded. When a prospect converts outside of the web, such as in a phone call or in‑person meeting, the revenue can disappear from the ad platform’s reports. Connecting a CRM like HubSpot or Salesforce to the ad account restores that missing data, allowing marketers to see the complete customer journey and to allocate budget to the tactics that actually close business.

Key Components of a Robust Integration

Three elements form the backbone of a reliable system.

Unified Customer Identifier

A stable identifier – usually the email address or a CRM record ID – must travel from the ad click through the landing page to the CRM and back to the ad platform. Using the same field everywhere prevents duplicate records and ensures that the offline event can be matched to the original click.

Secure Data Transfer Layer

Both HubSpot and Salesforce provide APIs that can be called from server side scripts or middleware platforms. These connections should use HTTPS, OAuth tokens and IP allow lists to keep the data flow protected.

Mapping of Conversion Types

The CRM may record many stages – lead, opportunity, won deal – while the ad platform expects a single conversion event. Define which CRM stage represents a meaningful offline conversion for each campaign and create a mapping table that the integration will use.

Step by Step Setup for HubSpot

HubSpot offers native integrations for Google Ads and Meta, but for offline conversions a custom workflow is needed.

1 Create a Custom Property for Click ID

In HubSpot, add a property called gclid or fbclid depending on the platform. This field will store the click identifier passed in the URL.

2 Capture the Click ID on the Landing Page

Append a script to the page that reads the gclid or fbclid query parameter and writes it into a hidden form field linked to the HubSpot property. When the visitor submits the form, the identifier travels into the CRM record.

3 Build an Automation to Flag Offline Conversions

Create a workflow that triggers when a deal reaches the “Closed Won” stage. The workflow should call a webhook that sends the stored click ID, the deal value and the closing date to the ad platform’s conversion endpoint.

4 Send the Conversion to the Ad Platform

For Google Ads, use the Offline Conversion API endpoint. Include the gclid, conversion time (in UTC) and conversion value. For Meta, call the Conversions API with the fbclid and purchase amount. HubSpot’s webhook can be hosted on a serverless function to keep the process lightweight.

Step by Step Setup for Salesforce

Salesforce provides more flexibility for large teams but requires a few extra steps.

1 Enable Field History Tracking

Activate tracking on the fields that will hold the click identifier and the stage change. This makes it easy to query the exact moment a deal became won.

2 Capture the Click Identifier

Use a hidden form field on the website that maps to a custom Salesforce field such as Ad_Click_ID__c. The value is stored on the lead record when the visitor fills out the form.

3 Create an Apex Trigger for Offline Conversions

The trigger fires after an opportunity is updated to the “Closed Won” stage. It collects the click ID, opportunity amount and close date, then posts a JSON payload to the appropriate ad platform endpoint.

4 Handle API Authentication

Both Google and Meta require OAuth tokens that refresh periodically. Store the refresh token securely in Salesforce Named Credentials and let the Apex code obtain a fresh access token before each call.

Synchronizing Data Across Platforms

When both HubSpot and Salesforce are used, duplicate records can appear. A midpoint middleware – for example a Zapier or Make scenario – can reconcile records by matching on email address. The middleware can also push conversion data from one CRM to the other, ensuring that the ad platform receives a single, accurate signal.

Common Pitfalls and How to Avoid Them

Missing Click IDs – If the landing page does not capture the identifier, the offline conversion cannot be linked. Test every URL variant with a query string and verify that the hidden field receives the value.

Time Zone Mismatch – The ad platform expects the conversion timestamp in UTC. Convert the time stored in the CRM, which may be local, before sending the payload.

Value Discrepancies – Some CRMs track revenue in multiple currencies. Standardize the currency to the one used in the ad account, or include the currency code in the API call if supported.

API Rate Limits – Large enterprises may exceed daily call quotas. Batch conversions where possible and schedule uploads during off‑peak hours.

Measuring Success and Optimizing Attribution

After the integration is live, monitor the following metrics within the ad platform:

  1. Number of offline conversions received
  2. Revenue attributed to each campaign
  3. Cost per acquisition after offline data is included

Compare these figures to the pre‑integration baseline. If the cost per acquisition drops, the integration is delivering value. Use the enriched data to adjust bids, allocate budget to high‑performing ads and refine audience targeting.

Regularly audit the data flow: run a weekly query in HubSpot or Salesforce to list all won deals that have a click ID but no corresponding conversion in the ad platform. Investigate any gaps and update the integration logic as needed.


by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *