Mistok
Documentation

Analytics and drop-off points

Quick start newArchitectureGatewaysHTTP APIPrepayment and rulesFiscal receiptsNotifications and CRMPayment linksAnalytics newPolandNative Shopify gatewaySecurity new

Mistok records an event at every step — from order creation to payment — and shows exactly where, and how much money, went off the rails.

What is collected

EventWhenAttributes
order_createdorders/create webhook (our methods and cash on delivery)country, region, city from the shipping address, amount, method
pay_clickthe buyer pressed the button (/pay)+ device (mobile/desktop), country by IP (Cloudflare/nginx), language
redirectedinvoice created, redirect to the PSPgateway, amount, prepayment rule
returnedcame back from the PSP page
paid / prepaid / failed / expired / cancelled / reversed / refunded / reminder_sent / link_openedthe corresponding transitionsdecline reason from the gateway

Drop-off points

For each point the dashboard shows the count and the amount of money lost, and the “stuck today” table lists the specific orders that can still be nudged with a call or a message.

Anomalies that get highlighted

Geography

Country/region/city come from the Shopify shipping address (more reliable than IP); country by IP is added as a separate attribute to spot buyers abroad ordering to Ukraine. Tables: countries (conversion, revenue), regions/voivodeships, cities.

Dashboard: /admin/dashboard?key=…&days=7|30|90. JSON: /admin/api/stats. Telegram: /today.

Analytics module (/admin/analytics)

The dashboard answers “where do we lose money”; the analytics module answers “where does the money come from and do buyers come back”. Same Mistok data, no GA, no cookie banners.

BlockDataShows
📣 Traffic sourceslanding_site / referring_site / source_name from the orders/create webhook and customerJourneySummary from the Admin APIutm_source / utm_medium (e.g. google / cpc), else the referrer host (instagram.com), else the Shopify source (POS, draft). Orders, paid, conversion, revenue, AOV per source; UTM campaigns separately.
🔁 New vs repeatcustomer.numberOfOrders + paid history by email/phonerepeat share, AOV of new vs repeat, top-10 buyers by revenue.
📦 Productsline-item snapshot taken at paymenttop-15 by revenue, units, average basket.
⏱️ Time to payorder created → paidhistogram (< 2 min … > 3 days), median, p90 — tells you when to send reminders.
🔔 Remindersreminder counter on the invoiceorders reminded, paid afterwards, recovered revenue.
🌍×💳 Country × providershipping address + gatewaypaid / orders per cell — shows where a local method is missing.
🧑‍🤝‍🧑 Cohortsweek of first paymentshare of buyers who bought again (12 weeks).

Top KPIs are compared with the previous period of the same length (▲▼). Insights are generated automatically: conversion drop ≥ 15 %, a weak source, reminder effectiveness, repeat share, too-long time to pay. Export: /admin/analytics.csv?days=30 (sections source / campaign / product / weekday / country_provider / cohort), JSON: /admin/api/analytics?days=30.

💸 Provider fees and 📬 the weekly digest

The “Provider fees” block shows what acquiring costs: the actual fee comes from the mono statement (/api/merchant/statement, once per poll), from LiqPay (receiver_commission), WayForPay (fee) and Fondy statuses; the rest is estimated by rate (FEE_RATE_<PROVIDER> in .env). The “net” KPI = revenue − fees; an insight highlights the most expensive gateway.

new Where the PSP does not report the fee, FEE_RULES (Settings → “Acquiring fees”, or .env) refine the estimate: an array of {provider, country, currency, minAmount, maxAmount, rate, fixed, note}, first match wins; provider is a code, a comma list or *; rate in %, fixed in minor units per transaction. Example: [{"provider":"stripe","currency":"PLN","rate":1.5,"fixed":100},{"provider":"*","country":"PL","rate":2.9}]. Below the provider table — fees by market (country × currency).

Every Monday at 09:00 (Kyiv) the bot sends the weekly digest: revenue, conversion, AOV and buyers with arrows vs last week, sources, losses, providers, reminders, insights. DIGEST=off disables it, DIGEST_DOW/DIGEST_HOUR change the time, /digest in the bot sends it on demand.

Sources and items are stored for orders created after the upgrade; older orders show as “direct / unknown”. In the sandbox every block is filled with fictional data.