Event sources
Where conversions come from: the website server, code on website pages, or a link for your CRM.
A source is the channel through which a website or CRM sends events — lead, cart, payment — to Loomark with the mk_cid click mark.
Which source to choose
| Source | Fits if | Sends |
|---|---|---|
| Website server | The website has its own backend and a developer | Everything: leads, carts, checkout, payments and refunds. The most reliable way |
| Code on website pages | There is no access to the website server: the code is added through the site admin | Cart, checkout and form submissions. Not payments or refunds |
| Link for your CRM | Leads and payments are recorded in a CRM that can call a link (webhook) on status change | A lead, a sale with its amount, and a rejection |
Create a source
- Step 1Tracking → Event intake → New source. Choose who will send events.
- Step 2Enter a name, e.g. “Website — server” or “CRM — payments”, and choose the website.
- Step 3Copy the connection details. The key and secret are shown once — store them now; the window closes only with the Done button.
Website server
- Step 1Give the website developer the key, the secret and the example request.
- Step 2The website stores
mk_cidfrom the landing page address in the session, then in the order. - Step 3On events (
add_to_cart,begin_checkout,purchaseafter payment,form_submit,refund) the website server sends a POST to the events address, signed with HMAC. No personal data is sent. - Step 4Check: send a test event (
"test": true) — it appears on the Events tab marked “test”.
Headers: X-S2S-Key, X-S2S-Timestamp (Unix seconds) and X-S2S-Signature = sha256= + HMAC-SHA256(secret, <timestamp>.<body>). Full example: Passing mk_cid to the order.
Code on website pages
- Step 1Add the code from the source window to every page of the website, before the closing
</body>tag (in the site admin: “custom code” or “footer code”). - Step 2Where funnel steps happen, call
markomEvent, e.g. when adding to cart:markomEvent("add_to_cart", { value: 49.9, currency: "EUR" }). - Step 3Check: open the website through an ad link, do the action — the event appears on the Events tab.
- Step 4Payments are not sent this way: add a Website server or Link for your CRM source for them.
The code takes mk_cid from the page address and keeps it in the tab’s sessionStorage — no cookies. Requests are accepted only from pages of the source’s website.
Link for your CRM
- Step 1Copy the link from the source window.
- Step 2In your CRM, create an automation on deal status change: the action “call a link / webhook” with this link.
- Step 3Replace
{mk_cid},{status},{payout}and{order_id}with deal fields: the click mark, the status, the amount and the order number. - Step 4Check: change the status of a test deal — the event appears on the Events tab.
| Status | Event in Loomark |
|---|---|
| lead | generate_lead |
| sale | purchase |
| rejected | refund |
The order number prevents duplicates: the same status for the same order is counted once.
Event names
Standard events: page_view, form_submit, generate_lead, add_to_cart, view_cart, begin_checkout, add_payment_info, purchase, refund. Your own names are accepted too: lowercase Latin letters, digits and underscores, starting with a letter.
- Each event needs an
event_id; the same event with the sameevent_idis counted once. - Up to 100 events in one request.
- If there is no
mk_cid, the event can carry a platform click id (gclid,gbraid,wbraid,fbclid,ttclid,msclkid,li_fat_id). - Personal fields such as email, phone, name and address are dropped.