How to Sync HubSpot and Salesforce with Paid Ads for Accurate Offline Conversion Tracking

Why Offline Conversions Matter for Paid Media

Digital ads are usually measured by clicks, leads, or online purchases. When a prospect clicks an ad, fills a form in HubSpot, and later closes a deal in Salesforce, the original ad may receive no credit if the conversion is recorded offline. This disconnect inflates cost‑per‑lead metrics and hides the true contribution of each channel.

Integrating your CRM systems with the ad platforms you buy on—whether Google, Meta, LinkedIn, or TikTok—creates a feedback loop that attributes revenue back to the exact touchpoint that sparked the journey. The result is clearer budgeting decisions, smarter bid strategies, and a more trustworthy performance dashboard.

Core Components of a Reliable Integration

Three technical pieces form the backbone of any offline conversion pipeline:

  1. Data capture in the CRM. Every lead or opportunity must carry a unique identifier that can be matched to the ad click.
  2. Export mechanism. The CRM must push the relevant fields to a place where the ad platform can retrieve them—usually a CSV file, a webhook, or a third‑party connector.
  3. Import process in the ad platform. The platform ingests the offline data, matches it to the click ID, and updates conversion metrics.

HubSpot and Salesforce each provide native tools that can be combined with Google’s Offline Conversion Upload, Meta’s Offline Conversions API, and LinkedIn’s Conversions API. The following sections break down each platform and highlight where you need to pay attention.

Setting Up Unique Click IDs in HubSpot

HubSpot’s forms can automatically add a hidden field that stores the gclid (Google Click Identifier) or the fbclid (Facebook Click Identifier) passed in the URL. To enable this:

  • Activate hidden field auto‑population in the form settings.
  • Map the hidden field to a property named “Click ID” in the contact record.

When a visitor lands on a landing page via a paid ad, the URL already contains the click ID (e.g., ?gclid=ABC123). HubSpot captures it, stores it, and later syncs it to Salesforce through the native HubSpot‑Salesforce integration.

Syncing HubSpot Contacts to Salesforce Opportunities

The native connector pushes contact and lead information into Salesforce as Leads. To keep the click ID through the sales cycle, you must customize the field mapping:

  • Create a custom text field in Salesforce called “Ad Click ID”.
  • In HubSpot’s integration settings, map the “Click ID” property to the Salesforce “Ad Click ID” field.

When a Lead converts to an Opportunity, ensure the field is carried over by adding it to the Opportunity field mapping as well. This guarantees the click ID travels from the first touch to the final revenue event.

Exporting Offline Conversions from Salesforce

Once the opportunity is marked as “Closed Won”, Salesforce contains the revenue amount, the closing date, and the ad click ID. You now need to extract these rows for upload.

Two common approaches are:

  1. Scheduled Report Export. Build a report that filters for “Closed Won” opportunities with a non‑empty “Ad Click ID”. Schedule the report to email a CSV to a secure storage location each night.
  2. Realtime Webhook. Use Salesforce’s Outbound Message feature or a platform like Zapier to trigger a webhook whenever an opportunity reaches “Closed Won”. The payload can be posted directly to the ad platform’s API.

Both methods preserve the click ID, conversion value, and conversion time—three fields required by most ad APIs.

Uploading Offline Conversions to Google Ads

Google expects a CSV with the columns Google Click ID, Conversion Name, Conversion Time, Conversion Value. If you chose the scheduled export route, you can set up a simple script (Python, Google Apps Script, or even a Google Sheet “IMPORTDATA” function) to transform the Salesforce CSV into Google’s format and call the Offline Conversions API.

For webhook users, Google provides a REST endpoint that accepts JSON payloads. The payload must include the gclid, the conversion timestamp in UTC, and the value. Successful responses return a confirmation ID you can store for audit purposes.

Feeding Offline Conversions to Meta

Meta’s Offline Conversions API works similarly but requires a Facebook Click ID (fbclid) and a Event Set ID that you create in Meta Business Manager. After mapping the fbclid in HubSpot, the same export process supplies the required fields.

Meta also supports bulk CSV uploads through the Events Manager UI. The file must contain event_time, event_name, custom_data, click_id. The custom_data object can hold the purchase value. Again, a simple script can automate the upload on a nightly basis.

Connecting LinkedIn Campaign Manager

LinkedIn relies on a “Member ID” that is not supplied in URL parameters. Instead, you must use the LinkedIn Insight Tag to capture a browser cookie that later maps to a click. HubSpot can store the “li_fat_id” cookie value in a hidden field, similar to the gclid approach.

Once you have that identifier, the LinkedIn Conversions API accepts a JSON payload with click_id, conversion_name, conversion_timestamp, and conversion_value. The API response includes a status code you should log for compliance.

Maintaining Data Quality and Privacy

Because you are moving personally identifiable information (PII) across systems, follow these safeguards:

  • Restrict access to the CSV files or webhook endpoints to IP ranges belonging to your marketing team.
  • Encrypt data at rest and in transit using TLS 1.2 or higher.
  • Respect user opt‑out preferences; HubSpot can flag contacts who have unsubscribed, and those records should be excluded from the export.

Most platforms also require you to hash email addresses if you decide to use email‑based matching instead of click IDs. Use SHA‑256 hashing without salts to stay compliant with Google and Meta guidelines.

Validating the Integration

Before you scale the pipeline, run a validation cycle:

  1. Generate a test click on a paid ad using a private browsing window.
  2. Complete the form on the landing page, ensuring the hidden click ID field captures the value.
  3. Manually create a test opportunity in Salesforce, associate the click ID, and close it as “Won”.
  4. Check the ad platform’s conversion reporting after the upload—look for the test conversion value and correct timestamp.

If any step fails, double‑check field mappings, time zone conversions, and CSV formatting. Most mismatches arise from daylight‑saving‑time offsets or missing required columns.

Measuring Impact on ROI

Once the data flow is stable, you can compare the “offline‑attributed” metrics with the original “online‑only” reports. Common insights include:

  • Higher conversion volume on high‑intent search terms that previously showed low ROAS.
  • Shift in budget allocation from broad awareness campaigns to more direct‑response channels that now prove profitable.
  • Improved cost‑per‑acquisition calculations that factor in the full revenue pipeline.

These insights feed back into bid adjustments, audience refinements, and even creative testing priorities, completing the loop from ad spend to revenue and back to strategy.

Scaling the Solution Across Multiple Business Units

Enterprises often run several brands under the same HubSpot and Salesforce instances. To keep the integration clean:

  1. Tag each brand with a custom field in HubSpot (e.g., “Brand”).
  2. Include the brand tag in the CSV export, then filter by brand when uploading to each ad account.
  3. Set up separate API credentials for each ad platform to avoid permission conflicts.

This modular approach lets you add new campaigns without rewriting the entire pipeline.

Future‑Proofing with Server‑Side Tagging

Server‑side tagging platforms such as Google Tag Manager Server‑Side or Cloudflare Workers can act as a central hub for click ID storage. Instead of relying on URL parameters alone, you can capture the click ID in a first‑party cookie that survives page reloads and form submissions. When the conversion event reaches HubSpot, the cookie value is pushed to the “Click ID” field automatically.

Adopting server‑side tagging reduces reliance on third‑party cookie restrictions, improves data accuracy, and simplifies the integration architecture for both HubSpot and Salesforce.


by

Tags:

Comments

Leave a Reply

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