Everything that is measured in HeyMySocial enters as an event: a page view from the site script, a lead from a form, a sale from your CRM. The event log holds only the types below, whichever door an event came through. An event with any other type is refused with validation_failed.
| Type | Name in the app | Needs an existing lead | Moves the lead to |
|---|---|---|---|
page_view | Page view | No | No change |
link_click | Link click | No | No change |
form_started | Form started | No | No change |
lead_created | Lead created | No | new New |
lead_contacted | Lead contacted | Yes | contacted Contacted |
lead_qualified | Lead qualified | Yes | qualified Qualified |
lead_disqualified | Lead disqualified | Yes | disqualified Disqualified |
appointment_booked | Appointment booked | Yes | No change |
opportunity_created | Opportunity created | Yes | opportunity Opportunity |
quote_sent | Quote sent | Yes | opportunity Opportunity |
sale_won | Sale won | Yes | won Won |
sale_lost | Sale lost | Yes | lost Lost |
sale_refunded | Sale refunded | Yes | No change |
The first column is the value you send as type. The envelope around it (event_id, occurred_at, properties and the rest) is described under server events.
Three kinds of event
Behaviour is page_view, link_click and form_started. These describe a visit, not a lead. They need a session_id and are tied to a visit only with consent: on a tracking site that requires consent only when consent_state is granted, on a site where consent is optional unless it is denied, and through the API without a site only when it is granted or not_applicable. Without that, the event is logged but no session and no touchpoint is made from it.
lead_created makes a lead. It needs no existing lead, but properties.contact must hold a name, an email address or a phone number.
Everything else says what happened to a lead that already exists, so it must name the lead: lead_id (the id HeyMySocial gave it) or lead_external_id (the external_id you sent with its lead_created). A lead is never found by a name or an email address in these events.
What each type does
Visits
page_viewopens or continues the visitor's session. It can give the session a touchpoint: the click a signed reference (hms_ref) names, a visit with campaign parameters (utm_source,utm_medium,utm_campaign,utm_content,utm_term), or, for the first view of a session, a visit from an outside referrer (referrer_host) or a direct visit.link_clickis written by a tracked link when someone follows it.form_startedis kept with the session. It makes no touchpoint.
Leads
lead_createdtakesproperties.contact(name,email,phone,company), up to 40 answers inproperties.form, and optionallystatus,note,tracking_link(a tracked link's code),hms_ref,contact_consent(true or false) andcontact_consent_source. Send anexternal_id: it is how later events find the lead, and a secondlead_createdwith the same source andexternal_idreturns the first lead instead of making another.lead_contactedmoves a new lead to contacted. For a lead that is already further on, only the time of first contact is kept, when it is the earliest known.lead_qualifiedandlead_disqualifiedtakeproperties.reason. A disqualification without one is stored with "Reported by the source."appointment_bookedchanges no status. It sets the lead's next step fromproperties.titleandproperties.starts_at.
Opportunities and sales
opportunity_createdadds an opportunity fromproperties.name,estimated_valueorestimated_value_minor, andcurrency.quote_sentmarks the lead's newest open opportunity as quoted, or adds one when there is none.sale_wonrecords a sale. It needsproperties.amount(main unit) orproperties.amount_minor(smallest unit).currencyfalls back to the workspace's currency,revenue_basistobookedandverification_sourcetomanual(tocrmwhen the event'ssourceiscrm). Itsexternal_ididentifies the sale.sale_lostcloses the lead's open opportunities as lost and takesproperties.reason.sale_refundedneeds an amount and names its sale withproperties.sale_idorproperties.sale_external_id. When it names none, or one that is not known, and the lead has exactly one sale, that sale is used. A refund must be above zero and at most what is left of the sale. It changes no status.
Only sales on the booked basis count as revenue in results, net of their refunds.
A status only moves forward
A reported event may skip steps forward, never backward. lead_contacted for a lead that is already an opportunity changes no status; the event is still stored. A person in the app moves a lead one allowed step at a time; see lead statuses.
To set something right, send a new event with corrects_event_id naming the event_id it corrects. For a status event, the lead is set to that status as a correction. For sale_won, the amount of the sale is corrected. The original event stays in the log.
{
"events": [
{
"event_id": "crm-deal-7781-amount-fix",
"type": "sale_won",
"occurred_at": "2026-11-20T10:15:00Z",
"lead_external_id": "crm-lead-5521",
"corrects_event_id": "crm-deal-7781",
"properties": { "amount": 4500, "currency": "DKK" }
}
]
}
An event that arrives before its lead
An event that names a lead_external_id nobody has sent yet is stored and answered with "warning": "unmatched_lead". It is listed under Items to review on the Funnels screen and applied by itself when a lead_created with that external_id arrives. A refund whose sale cannot be found is answered with "warning": "unmatched_sale" and listed in the same place.
Duplicates and test events
An event is recognised as already seen by its source and event_id, or by its source, type and external_id. It is answered with "status": "duplicate" and the ids of the first one, and nothing changes. Sending the same event twice is therefore safe.
An event with "test": true is shown as received and changes nothing: no lead, no sale, and it does not count toward the month's tracked events.