Skip to content
Denne side findes på dansk. Læs på dansk
HeyMySocial

Event types

Every event type HeyMySocial stores, what each one must carry and what it does to a lead. The same list applies to the API, the signed webhook and the site script.

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.

TypeName in the appNeeds an existing leadMoves the lead to
page_viewPage viewNoNo change
link_clickLink clickNoNo change
form_startedForm startedNoNo change
lead_createdLead createdNonew New
lead_contactedLead contactedYescontacted Contacted
lead_qualifiedLead qualifiedYesqualified Qualified
lead_disqualifiedLead disqualifiedYesdisqualified Disqualified
appointment_bookedAppointment bookedYesNo change
opportunity_createdOpportunity createdYesopportunity Opportunity
quote_sentQuote sentYesopportunity Opportunity
sale_wonSale wonYeswon Won
sale_lostSale lostYeslost Lost
sale_refundedSale refundedYesNo 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_view opens 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_click is written by a tracked link when someone follows it.
  • form_started is kept with the session. It makes no touchpoint.

Leads

  • lead_created takes properties.contact (name, email, phone, company), up to 40 answers in properties.form, and optionally status, note, tracking_link (a tracked link's code), hms_ref, contact_consent (true or false) and contact_consent_source. Send an external_id: it is how later events find the lead, and a second lead_created with the same source and external_id returns the first lead instead of making another.
  • lead_contacted moves 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_qualified and lead_disqualified take properties.reason. A disqualification without one is stored with "Reported by the source."
  • appointment_booked changes no status. It sets the lead's next step from properties.title and properties.starts_at.

Opportunities and sales

  • opportunity_created adds an opportunity from properties.name, estimated_value or estimated_value_minor, and currency.
  • quote_sent marks the lead's newest open opportunity as quoted, or adds one when there is none.
  • sale_won records a sale. It needs properties.amount (main unit) or properties.amount_minor (smallest unit). currency falls back to the workspace's currency, revenue_basis to booked and verification_source to manual (to crm when the event's source is crm). Its external_id identifies the sale.
  • sale_lost closes the lead's open opportunities as lost and takes properties.reason.
  • sale_refunded needs an amount and names its sale with properties.sale_id or properties.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.