Skip to content
loomark

Documentation

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

SourceFits ifSends
Website serverThe website has its own backend and a developerEverything: leads, carts, checkout, payments and refunds. The most reliable way
Code on website pagesThere is no access to the website server: the code is added through the site adminCart, checkout and form submissions. Not payments or refunds
Link for your CRMLeads and payments are recorded in a CRM that can call a link (webhook) on status changeA lead, a sale with its amount, and a rejection

Create a source

  1. Step 1Tracking → Event intake → New source. Choose who will send events.
  2. Step 2Enter a name, e.g. “Website — server” or “CRM — payments”, and choose the website.
  3. 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

  1. Step 1Give the website developer the key, the secret and the example request.
  2. Step 2The website stores mk_cid from the landing page address in the session, then in the order.
  3. Step 3On events (add_to_cart, begin_checkout, purchase after payment, form_submit, refund) the website server sends a POST to the events address, signed with HMAC. No personal data is sent.
  4. 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

  1. 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”).
  2. Step 2Where funnel steps happen, call markomEvent, e.g. when adding to cart: markomEvent("add_to_cart", { value: 49.9, currency: "EUR" }).
  3. Step 3Check: open the website through an ad link, do the action — the event appears on the Events tab.
  4. 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

  1. Step 1Copy the link from the source window.
  2. Step 2In your CRM, create an automation on deal status change: the action “call a link / webhook” with this link.
  3. Step 3Replace {mk_cid}, {status}, {payout} and {order_id} with deal fields: the click mark, the status, the amount and the order number.
  4. Step 4Check: change the status of a test deal — the event appears on the Events tab.
StatusEvent in Loomark
leadgenerate_lead
salepurchase
rejectedrefund

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 same event_id is 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.