Skip to main content
When you finish, each new HubSpot contact, qualified deal, and won deal arrives in Events, matched by email to the visit that started it. HubSpot has no direct connection. You send each stage to the DATALYR ingest endpoint from Zapier or from a HubSpot workflow.

What HubSpot sends

Only deal_won carries a value: the deal amount. Its cash_role is non_cash_fact, so no revenue report counts it. Cash comes from a payment source such as Stripe or Commas. Each event_id is stable per record and stage. A retried request is a duplicate, not a second conversion. See Duplicates.

Before you start

The request

Replace each placeholder such as {{email}} with the matching HubSpot field. Keep currency and cash_role as written.
The HubSpot card in Sources has the same bodies.
Keep the write key in Zapier or HubSpot only. Anyone holding it can write events into your workspace.

Send stages from Zapier

Build one Zap per stage.
1

Add the HubSpot trigger

For lead_submitted, use New Contact. For the deal stages, use Updated Deal Stage and pick the stage.
2

Find the contact

For a deal stage, add Find Associations for the deal. Then add Find Contact to read the contact’s email.
3

Add the request

Add Webhooks by Zapier with the Custom Request event. Set Method to POST.
4

Set the URL and headers

Paste the URL. Add the X-API-Key and Content-Type headers.
5

Paste the body

Paste the stage’s body into Data. Map each placeholder to the field from an earlier step.
6

Test the step

Run the step test. Confirm the response contains "success": true.

Send stages from a HubSpot workflow

1

Create the workflow

Create a contact-based workflow for lead_submitted, or a deal-based workflow for the deal stages.
2

Set the trigger

For deals, trigger on Deal stage equal to your qualified stage or Closed won.
3

Add Send a webhook

Add the Send a webhook action. Set the method to POST and paste the URL.
4

Authenticate

Add the write key as an API key sent in the X-API-Key header.
5

Build the body

Build the request body to match the stage’s JSON above.
A deal-based workflow must send the associated contact’s email as user_id. If it cannot, use Zapier.

How deals match to ad clicks

HubSpot events match by email alone. user_id and properties.email carry it. A HubSpot event joins an ad click only when DATALYR already knows that email from a tracked visit. That happens through an identify() call on your form, an iClosed or Calendly booking, or a payment source. See Identity.

Set up conversion rules

HubSpot has no starter rules. Create each rule in Conversions with manage rules. Meta and TikTok optimize on a 7-day window, and most deals close later. Send them lead_qualified, and send deal_won to Google Ads.

Verify

  1. Open your landing page in a private window with ?utm_source=doctest.
  2. Submit your form with a test email address.
  3. Create a test deal for that contact. Move it to your qualified stage.
  4. Open Events. Confirm a lead_qualified row with source api.
  5. Open Users. Find the test email. Confirm the pageview and lead_qualified sit on one user.
  6. Move the deal to Closed won. Confirm deal_won arrives with the deal amount in value.

When it does not work

Next