Skip to content
GDPR compliant. Hosted in DE.
14-day free trial →
HeartbeatsCheckoutBlack Week
Monitoring 17 min read 18 Oct 2026

Order heartbeat: get alerted when orders stop coming in

An order heartbeat counts the new orders every hour and reports them as items=N. If the report is missing or the number drops too low, an alert goes out.

X

XICTRAQ®

XICTRAQ®

Heartbeat-MonitoringE-CommerceAlertingChristmas season
52 %
of internet users aged 16+ planned to use Black Friday 2025 discounts, mostly online (Bitkom)
22.2 bn €
online sales in the 2025 Christmas season, forecast (HDE)
50 %
of online payment transactions run through internet payment services (Bundesbank)
Order heartbeat: orders per counting runSample values · counting job pings hourly with items=N · minimum min_items = 35 8-21 * * 1-5 · Europe/BerlinOrders in the counting window (60 min)129630709:05910:05811:051112:051013:05614:0515:05Checkout down from 13:40min_items = 3items=0Ping time; each run counts the preceding 60 minutesLatest pings13:05items=10ok14:05items=6ok15:05items=0too fewWarning · 15:05Heartbeat without result:Orders weekdayReported: items=0Expected: at least 3 (min_items)Sent via your alert channels$ curl -fsS "https://api.xictraq.com/api/heartbeat/orders-weekday-x7k2m9qa/ping?items=$N"Sample values for illustration, not measured shop data
An order heartbeat answers a question no uptime check asks: are orders coming in right now? The home page returns status 200, product pages load quickly, and yet no order has reached the database since noon because a payment module quietly fails after an update. A small counting job changes that: every hour it counts the new orders and reports the number as items=N to a heartbeat. If the number stays below the minimum or the ping does not arrive at all, an alert follows. This article covers the counting job, how to derive the threshold from your own order rate, schedules for nights and weekends, and the limits of the method.

Why a silent checkout failure goes unnoticed for hours

Most disruptions in online retail are not complete outages but defects at exactly one point of the checkout. A plugin update changes the order of the scripts and the payment window no longer loads. An access key at the payment provider expires and the order remains in the status "open". A new shipping cost rule returns no price for certain postcodes and the order button stays grey. In all three cases the website is reachable and the cart fills up; only the last step fails.

A classic uptime check sees none of this, because it evaluates the status code and response time of an address. The conversion rate does not reveal the defect straight away either, because abandoned purchases are normal: averaged across 50 studies, the documented cart abandonment rate is 70.22 % (Baymard Institute). A few extra percentage points on one afternoon hardly show in a daily report. The outage is then noticed in the evening in the order list or the next morning through a customer email.

Google's site reliability handbook separates two questions for this: what is broken and why (Google SRE Book). Alerting should focus mainly on symptoms, and on causes only when they are definite and imminent (Google SRE Book). For a shop, the clearest symptom is simply that orders stop arriving. Whether the cause lies in the payment module, the shipping logic or the payment provider, the order heartbeat does not need to know in order to raise the alarm.

Your monitoring system should address two questions: what’s broken, and why?

— Google, Site Reliability Engineering, chapter 6 "Monitoring Distributed Systems"

In the fourth quarter every hour carries more weight. Around one in two people (52 percent) planned to use the reduced prices on Black Friday 2025, the vast majority of them online; 1,120 internet users aged 16 and over were surveyed (Bitkom). For the 2025 Christmas season the German retail federation expected online sales of 22.2 billion euros (HDE), and German retail as a whole generates 18.5 percent of its annual sales in November and December (HDE). How to prepare the website itself for this peak window is covered in the article on Q4 traffic peaks.

The principle: the shop reports what it has sold

A heartbeat turns monitoring around: instead of a checker fetching a page from outside, a process reports from inside at a fixed rhythm. If the report does not arrive, an alert follows. The article on heartbeat monitoring for cron jobs explains this dead man's switch in detail. With an order heartbeat, a small counting job checks in and sends a business figure along: the number of orders in the last time window, passed as the items parameter.

XICTRAQ® heartbeats evaluate this parameter when the setting "Job must produce output/items" is enabled on the heartbeat (field expect_output), optionally with a minimum count (min_items). This results in four states:

  • Ping with items at or above the minimum: healthy run, an open alert is resolved automatically.
  • Ping with items=0 or below the minimum: alert "Heartbeat without result" with the reported and the expected count, severity warning. The counting job ran, but the shop sold nothing or too little.
  • No ping by the next due time plus grace period: alert "Heartbeat missed", severity critical. The counting job itself has failed, for instance because the server is down or the cron service is not running.
  • Failure reported via /fail or exit_code other than 0: alert "Heartbeat failed", severity critical. The counting job could not count and says so explicitly.

The third state sets the order heartbeat apart from a database query that sends an email at zero orders: if that query's server goes down, it falls silent, and silence looks like a quiet day. The heartbeat expects the report and fires when it is missing. An open alert is updated on further runs instead of being created twice. Who receives it and through which route is defined by the account's alert channels and escalation levels.

The counting job: one query and one call

The counting job runs where the orders are: on the shop server or on a machine with read access to the shop database. It needs a read-only database user, a query and an HTTP call. Count orders that indicate a successful checkout, meaning neither cancelled nor flagged as tests. Counting only paid orders additionally reveals missing payment confirmations, but invoice and prepayment then need separate handling. Table and column names differ between shop systems; the example shows the pattern.

count-orders.sh
#!/usr/bin/env bash
# Counts the orders of the last N minutes and reports them to a heartbeat.
# Usage: count-orders.sh <heartbeat-slug> <window-minutes>
set -euo pipefail

HB="https://api.xictraq.com/api/heartbeat/$1"
WINDOW="${2:-60}"

# If the query fails, the job reports a failure right away instead of aborting silently.
trap 'curl -fsS -m 10 "$HB/fail?msg=query%20failed" >/dev/null' ERR

# created_at is stored in UTC, hence UTC_TIMESTAMP() rather than NOW().
N=$(mysql --defaults-extra-file=/etc/shop/read-only.cnf -N -B -e "
  SELECT COUNT(*) FROM orders
  WHERE created_at >= UTC_TIMESTAMP() - INTERVAL ${WINDOW} MINUTE
    AND status NOT IN ('cancelled', 'test')")

curl -fsS -m 10 "$HB/ping?items=${N}" >/dev/null

Two lines do the heavy lifting. The trap reports a failed query as a failure right away. Without it, set -e would make the script abort silently, and the alert would only come after the due time and grace period as "Heartbeat missed", with no hint at the cause. With it, "Heartbeat failed" and the reason appear in the alert at once, kept apart from the "no orders" case. A failed measurement is not a measurement. The last line is the actual ping; further parameters such as exit_code, duration_ms or a note via msg are described in the heartbeat documentation.

Before the heartbeat goes live, a manual cross-check is worthwhile. A ping with items=0 must report the idle run (the response text is in German), a ping with a normal count must not:

$ curl -fsS "https://api.xictraq.com/api/heartbeat/orders-weekday-x7k2m9qa/ping?items=0"
{"ok":true,"duration_ms":null,"anomaly":"Lief, lieferte aber keine\/zu wenige Ergebnisse (Items: 0, erwartet >= 3)"}
$ curl -fsS "https://api.xictraq.com/api/heartbeat/orders-weekday-x7k2m9qa/ping?items=9"
{"ok":true,"duration_ms":null,"anomaly":null}
Check the time zone of the timestamps

Many shop systems store timestamps in UTC. If the database session runs on German time, NOW() shifts the counting window one or two hours into the future, and the counting job reports zero although orders are coming in. In that case the query needs UTC_TIMESTAMP(). A comparison with the order list for the same hour shows whether the count is right.

How many orders are normal? Calculating the threshold

The most important decision is the threshold, and it depends on your own order rate. Orders arrive randomly. The Poisson distribution suits such counts; it models the number of events occurring within a fixed time interval (NIST), and its parameter λ is the average number of events in that interval (NIST). The probability that not a single order arrives in an undisturbed window is therefore e to the power of minus λ. The table shows what this means for a counting job that runs 15 times during the day.

Orders in the window (mean λ)Probability of zeromathematically about everyunfounded zero alerts in 30 days
136.8 %3rd runabout 166
213.5 %7th runabout 61
35.0 %20th runabout 22
50.67 %148th runabout 3
80.034 %2,981st runabout 0.15
100.0045 %22,026th runabout 0.02

A rigid rule of "zero orders in an hour equals alert" therefore does not work for many shops. With an average of two orders per hour, roughly every seventh hour would mathematically pass without an order, with no defect at all (NIST), and the alert would fire around 60 times a month for no reason. The site reliability handbook describes the consequence: people who are paged too often skim or ignore alerts and then miss the real ones too (Google SRE Book). From five expected orders per window, the probability of a randomly empty window drops below one percent.

The model simplifies: real orders arrive in clusters, for example after a newsletter, and in between it is quieter than calculated. The values are therefore a lower bound for false alarms, not a promise. You read λ from your own data: count the orders of the last four to eight weeks per hour and weekday, calculate the mean and count how often an hour actually passed without an order. If that share deviates clearly, your own value applies.

Rule of thumb for the counting window

Choose the window long enough that at least five orders fall into it during normal operation, preferably eight. Only then is zero a signal rather than chance. Shops that sell less extend the window or exclude quiet hours through the schedule.

Aligning counting window, rhythm and minimum count

Three settings determine how quickly and reliably the heartbeat fires: the length of the counting window, the rhythm of the counting job and the minimum count. Window and rhythm do not have to be equally long. A job that counts the last two hours every 30 minutes has a large λ and few false alarms, but only notices a complete outage once the entire window is empty. The detection time of a zero alert lies between one window length and one window length plus one interval.

With min_items, the heartbeat fires not only at zero but as soon as fewer than the minimum are reported. With ten expected orders and a minimum of three, chance alone mathematically triggers in about 0.28 % of runs (NIST), yet in a complete outage the alert comes earlier because the window does not have to be completely empty. Important: the minimum count is a fixed value per heartbeat. XICTRAQ® offers an expectation that adapts per hour of the week for the runtime of a job, not for the reported count. Different expectations over the day are covered with several heartbeats.

Small shop

About one order per hour. An hourly zero alert would be noise; a six-hour window with an hourly rhythm makes sense, plus a browser test of the checkout as an early signal.

Mid-sized shop

Six to ten orders per hour. A 60-minute window with an hourly rhythm detects a complete outage within one to two hours, earlier with a minimum count.

Large shop

Many orders per hour. A 15-minute window is enough for a zero alert; a higher minimum count or one heartbeat per payment method reveals partial outages.

The grace period on the heartbeat, zero to 3,600 seconds, only applies to a missing ping and absorbs the counting job finishing a minute late. The alert for too few orders comes with the ping itself, without any waiting time.

Day, night and weekend: a schedule instead of a rigid rhythm

A fixed hourly rhythm also expects a report at three in the morning, and a minimum count that fits during the day triggers false alarms at night. XICTRAQ® heartbeats therefore support two expectation models: a fixed interval between one minute and 24 hours, or a cron schedule with its own time zone. With a cron schedule, the next due time is calculated in the heartbeat's time zone; if the ping has not arrived by then plus the grace period, the alert follows.

The expression follows the crontab format with five time fields for minute, hour, day, month and weekday, where 0 stands for Sunday in the weekday field (POSIX). A hyphen describes an inclusive range. 5 8-21 1-5 therefore means: Monday to Friday at 8:05, 9:05 and so on until 21:05. After the 21:05 run, the heartbeat expects the next ping only at 8:05 on the following weekday, so nights and weekends stay quiet.

Because the minimum count is fixed per heartbeat, each phase with its own expectation gets its own heartbeat and its own line in the server's crontab. A pattern for a mid-sized shop, with sample values:

HeartbeatCron schedule (Europe/Berlin)Counting windowmin_items
Orders weekday5 8-21 1-5last 60 minutes3
Orders weekend5 9-22 0,6last 60 minutes2
Orders night5 7 *11 pm to 7 am (480 minutes)1
crontab
# Crontab of the shop server, server time zone: Europe/Berlin
# minute hour day month weekday  command
5 8-21 * * 1-5   /opt/shop/count-orders.sh orders-weekday-x7k2m9qa 60
5 9-22 * * 0,6   /opt/shop/count-orders.sh orders-weekend-p4n8c2tw 60
5 7 * * *        /opt/shop/count-orders.sh orders-night-h3v6r1ze 480
Clock change on 25 October

In the EU, summer time ends on the last Sunday in October at 1 a.m. Greenwich Mean Time (Directive 2000/84/EC), which in 2026 is 25 October. If the server's crontab runs in UTC and was converted to German time by hand for the summer (5 6-19 1-5 for 8:05 to 21:05), while the heartbeat runs in Europe/Berlin, the two drift apart by one hour from that day on: the server's runs move one hour earlier in German time, the heartbeat still expects a run at 21:05 that no longer comes and reports a missed ping every weekday evening. If a UTC crontab carries the same expression as the heartbeat instead, the two are already two hours apart before the change. The remedy: the heartbeat gets the time zone in which the crontab actually runs.

Partial outages: when only one payment method fails

A zero alert detects a complete outage. Often, however, only part of the checkout fails, and the number drops without reaching zero. According to the Bundesbank's payment diary, internet payment services account for 50 % of payment transactions on the internet (Bundesbank), followed by direct debits and credit transfers at 30 % and credit cards at 15 % (Bundesbank). If one method fails, a share of roughly this size goes missing while the rest continues. Whether customers simply switch payment method is far from certain: for 54 percent of respondents, payment options are very important when choosing an online shop (Bitkom).

There are two ways to handle partial outages. A higher minimum count only works if the window contains enough orders for the loss of a third to stand out from chance, and it increases the number of false alarms. More precise is a separate heartbeat per payment method: the counting job filters by payment method and reports each one to its own heartbeat, with the rule of thumb applied per payment method. Which payment methods have which share in your own shop is shown in the article on analysing payment methods.

  • Per shop or domain, if one system serves several countries or brands. If only the Austrian checkout fails, the total stays inconspicuous.
  • Per sales channel, such as your own shop, a B2B portal and marketplace imports. A stalled import looks like a quiet day in the total.
  • Per order route, if orders also arrive through an app or an interface.
  • Not per product or category. There λ is usually too small, and the alerts turn into noise.

Order heartbeat, analytics alert and browser test compared

The order heartbeat is not the only way to notice a checkout failure. Three methods complement each other because they measure at different points. Browser monitoring with a checkout flow regularly clicks through the purchase process and sees a defect without real purchase traffic, but usually only up to the real payment; how such flows are built is shown in the article on the login flow and checkout. The analytics alerts of the cookieless analytics evaluate hourly what the tracker counted on the order confirmation, with a fixed threshold or as a drop compared with the same time window a week earlier. The order heartbeat counts in the database itself.

FeatureUptime checkBrowser test checkoutAnalytics alert ordersOrder heartbeat
Measuresreachability and response time of an addressa scripted purchase flowpurchases the tracker records on the confirmation pageorders in the shop database
Needs real purchase trafficnonoyesyes
Sees a failed payment methodnoonly the tested stepsas a drop, without attributionyes, with one heartbeat per payment method
If tracking is blockednot affectednot affectedcounts too fewnot affected
Fires onerror status or timeouta failed stepthreshold or drop within the time windowcount below minimum or missing ping
Requirementnonetest flow, test account if needede-commerce tracking, Business plancounting job with read access to the database

It gets revealing when two methods disagree. If the analytics alert reports a drop while the heartbeat sees normal numbers, the confirmation page or the tracking has a problem. If both drop, sales themselves are affected. If only the heartbeat goes missing, the fault lies with the counting job or its server. Automatic evaluations additionally point out unusual deviations, as described in the article on anomaly detection.

When the alert arrives: the first steps

An order alert says that something is wrong, not what. First confirm and narrow down the finding, ideally in a fixed sequence that is ready to hand for whoever is on call:

  1. Place a test order with a payment method that can be cancelled. If it fails, the finding is confirmed, and the error message in the browser is often the most important clue.
  2. Check payment methods one by one. If invoice works but card payment does not, the problem lies with the payment module or the payment provider.
  3. Review changes from the last few hours: deploy, plugin update, new price or shipping rule. How a rollback with verification works is described in the article on deploy errors as a cause of outages.
  4. Check the error log and the payment provider's callbacks. Rejected callbacks explain orders that were created but not confirmed.
  5. Let it count after the fix. The next run with a sufficient count resolves the alert automatically; if you do not want to wait, start the counting job manually.

Who receives the alert at 8 p.m. on a promotion day and who takes over if nobody responds should be settled in advance. How to set thresholds and channels so that alerts are taken seriously is covered in the article on alarm fatigue. If a disruption lasts longer, a short note on the status page helps before the first customer emails arrive.

Planned maintenance

If the shop is deliberately closed for maintenance, orders drop to zero as planned. Pause the heartbeat for that period: paused heartbeats do not trigger alerts, but their pings are still recorded. Reactivate it afterwards. More in the article on maintenance windows in monitoring.

Set it up before Black Week, not during Black Week

For Black Friday and Cyber Monday 2025 the German retail federation expected sales of 5.8 billion euros (HDE), and according to a survey commissioned by the federation, 54 percent of the online shoppers surveyed also use Black Friday for Christmas shopping (HDE). Activating a new monitor only in that week means getting to know its false alarms in the week with the least time for them. A lead time is better:

  1. Four weeks before: analyse orders per hour and weekday, determine λ per phase, set windows and minimum counts.
  2. Three weeks before: set up the counting job, compare the count with the order list, create heartbeats with cron schedule and time zone.
  3. Two weeks before: cross-check with a manual items=0. Does the alert reach the right person in the right channel? Then send a healthy ping; the alert must resolve.
  4. Before the promotion days: with a clearly higher order rate, create an additional heartbeat with a higher minimum count that the cron schedule only expects on those days, for example 5 8-23 27-30 11 * for 27 to 30 November.
  5. After Black Week: every false alarm points to a window that is too short or a minimum count that is too high.

How the website itself gets through these weeks is described in the article on Q4 traffic peaks linked at the beginning. If you keep your promotion page at the same address every year, the uptime check also gets a permanent address; see the Black Friday page with a permanent URL. The same technique also monitors backup runs, as the article on backup monitoring with heartbeats shows.

Cross-check instead of trust

A monitor that has not fired a single time is set up, but not proven. The ping with items=0 takes a minute and shows whether heartbeat, alert channel and on-call duty work together. How heartbeats and alerts look in the dashboard can be seen in the live demo; the number of heartbeats per plan is listed on the pricing page.

Sources and studies

This article draws on: Bitkom, press release "Black Friday: Die Hälfte geht auf Schnäppchenjagd" of 24 November 2025 (representative survey of 1,120 internet users aged 16 and over); Handelsverband Deutschland (HDE), press releases of 5 November 2025 on the Christmas season and of 17 November 2025 on Black Friday and Cyber Monday; Deutsche Bundesbank, "Zahlungsverhalten in Deutschland 2025", chapter 4.5; Baymard Institute, "50 Cart Abandonment Rate Statistics 2026"; NIST/SEMATECH e-Handbook of Statistical Methods, section "Poisson Distribution"; Google, "Site Reliability Engineering", chapter 6 "Monitoring Distributed Systems"; The Open Group, POSIX specification of the crontab utility; Directive 2000/84/EC on summer-time arrangements. The probabilities in the table are our own calculations based on the Poisson distribution. Information on XICTRAQ® as per the heartbeat documentation in October 2026.

What is an order heartbeat?
A counting job that counts the orders of the last time window at a fixed rhythm and reports them as items to a heartbeat. If the number is below the minimum, the "Heartbeat without result" alert follows; if the ping does not arrive, the "Heartbeat missed" alert. This usually catches both a stalled checkout and a failed counting job.
Isn't an uptime check enough for the shop?
An uptime check verifies whether an address responds and how quickly. A defect in the payment step or an expired access key at the payment provider typically leave the pages reachable. The two complement each other: the uptime check for reachability, the order heartbeat for the outcome.
How can false alarms during quiet hours be avoided?
Choose the counting window so that at least five, preferably eight, orders fall into it during normal operation, and exclude quiet phases through a cron schedule. With five expected orders, the probability of a randomly empty window is mathematically about 0.67 % (NIST). Because real orders arrive in clusters, a comparison with your own data is worthwhile.
Can the heartbeat learn the expectation per time of day on its own?
Not for the reported count; the minimum count is a fixed value per heartbeat. XICTRAQ® offers an adaptive expectation per hour of the week for the runtime of jobs. Day, night and weekend can be covered with several heartbeats, each with its own cron schedule and minimum count.
What happens if the database query itself fails?
If the counting job reports the error via /fail or with an exit code other than 0, the "Heartbeat failed" alert appears, distinguishable from the "no orders" case. If the job aborts without reporting, the ping does not arrive, and after the grace period "Heartbeat missed" follows.
What needs attention when the clocks change?
The counting job and the heartbeat should use the same time zone. In the EU, summer time ends on the last Sunday in October at 1 a.m. Greenwich Mean Time (Directive 2000/84/EC). If a UTC crontab was converted to German time for the summer and the heartbeat runs in Europe/Berlin, the runs shift by one hour from then on, which typically leads to a missed ping at the end of each schedule.

Related in XICTRAQ®

Start in 60 seconds

Let XICTRAQ® watch your website.

Permanent free plan available. No credit card, no installation, no hidden fees.