Skip to content

E-commerce website monitoring

The checks an online shop needs — shop front, checkout, the payment provider, mail, the domain — who is called, a status page for customers, and pausing ads while the shop is down.

A shop can answer and still not sell: the home page opens while checkout fails, the bank’s 3-D Secure page does not load, or order e-mails stop going out. The monitors below catch those. They are nine, so they fit the Free plan’s 10. Each check runs from Istanbul, Stockholm and Frankfurt, and an incident opens only when the regions agree (Quorum in the docs).

A shop’s monitor list on the Free plan: the shop front with a keyword, checkout, the admin sign-in, the payment provider’s 3-D Secure host, outgoing and incoming mail over TLS, the domain’s DNS, the TLS certificate and a heartbeat for the marketplace stock sync — all up from three regions, checkout with one 14-minute outage in the last 30 days.
A shop’s nine monitors. Mail, the domain, the admin panel and the provider are marked major: they e-mail and message, they do not call.

The monitors

MonitorWhat it catches
Shop frontA page that answers with a database error or an empty theme: the keyword is missing
CheckoutCheckout reads the cart, stock and the payment settings: it fails or slows down first
Admin sign-inThe panel the orders are handled in
Payment provider’s 3-D SecureThe page the bank asks for the card holder’s code on: not yours to fix, but you know before customers write
Outgoing and incoming mailOrder confirmations, password resets, customers’ replies and returns
DomainA lapsed domain or a broken zone: the shop, mail and the panel at once
TLS certificateTwo weeks before browsers refuse the shop
Marketplace stock syncThe job that sends stock and prices to the marketplaces stopped: you oversell
The shop set in the app, for a shop on the Free plan: the nine monitors ticked, each with its type, how often it is checked, its severity, its address and what it checks — the shop front and checkout critical, the rest major — and under them that the Free plan has room for 10 more monitors, so all nine fit.
The set before anything is created: what each monitor checks, and what fits your plan.
The monitors, as the form asks for them
- name: Shop front
  type: keyword
  target: https://www.yourshop.example
  conditions: ["[STATUS] == 200", "[BODY] == pat(*Add to cart*)"]
- name: Checkout
  type: http
  target: https://www.yourshop.example/checkout
  conditions: ["[STATUS] == 200", "[RESPONSE_TIME] < 3000"]
- name: Admin sign-in
  type: http
  target: https://www.yourshop.example/admin/login
  conditions: ["[STATUS] == 200"]
  severity: major
- name: Payment provider's 3-D Secure
  type: tls
  target: 3ds.provider.example:443        # where checkout sends the card holder
  conditions: ["[CONNECTED] == true", "[CERT_EXPIRY] > 168h"]
  severity: major
- name: Outgoing mail
  type: tls
  target: mail.yourshop.example:465       # SMTPS; incoming mail on :993 (IMAPS)
  conditions: ["[CERT_EXPIRY] > 336h"]
  interval: 10 min
  severity: major
- name: Domain
  type: dns
  target: yourshop.example                # record type A
  conditions: ["[DNS_RCODE] == NOERROR", "[RECORD_COUNT] > 0"]
  interval: 10 min
  severity: major
- name: TLS certificate
  type: tls
  target: www.yourshop.example:443
  conditions: ["[CERT_EXPIRY] > 336h"]
  interval: 1 h
  severity: major
- name: Marketplace stock sync
  type: heartbeat
  interval: 1 h                           # the job pings at its end (below)
  severity: major
  • For the shop front, take a text that is there only when the products are: the label of the cart button, a category’s name.
  • The 3-D Secure host is in your payment provider’s integration guide, and a test payment shows it in the address bar.
  • A tls monitor speaks TLS from the first byte, so mail is checked on 465 (SMTPS) and 993 (IMAPS). It cannot do STARTTLS on 587 or 143: for those, a tcp monitor says the port answers.
  • Give the shop front, checkout and the admin panel the shortest interval your plan allows — 3 min on Free, 30 s on Pro, 20 s on Team, 15 s on Business. Certificates, mail and DNS change slowly: every 10 minutes or every hour is enough for them.
  • Shop platforms often sit behind bot protection (Cloudflare, Imunify360) that turns the probes away and makes the shop look down: let them through as the docs’ Monitors → “Heimdall’s probes” shows.
The stock sync job, at its end
# after the job has sent stock and prices to the marketplaces
curl -fsS -m 10 --retry 5 --retry-connrefused -o /dev/null https://heimdall.warewave.tech/hb/hb_5d81c0e4a7

Watch the purchase path

The monitors above see that the pages answer. A scenario goes the way a customer does: it opens the shop, signs in, puts a product into the basket and goes to the payment page, in a real browser, every few minutes. When a step fails, the incident names it and shows the page as it was, with the requests that failed. Scenario monitors come with the paid plans — Pro 1 (every 10 min, up to 20 steps), Team 3 (every 5 min, up to 30 steps), Business 10 (every 5 min, up to 50 steps) — and every account can try them in the Team trial (Scenario monitors in the docs).

  1. Make a user of its own on the shop for the scenario, with no real person’s data in it — not yours, and not a customer’s: its e-mail heimdall@ at the shop’s own domain (heimdall+checkout@ too), and where checkout asks for a name, an address or a phone number, Made-up data. An owner or admin of your organisation declares so when the scenario is saved.
  2. Open Monitors → + Monitor → Scenario. Start from the shop’s address and a text its page shows only when it works (“Add to basket”), and add the rest of the path in the editor. Or record the path with Heimdall Recorder, for Windows and Linux: it opens your own Chrome, Edge or Chromium with a clean profile, records what you do and sends the steps to the app with a one-time pairing code.
  3. Sign in with the scenario’s user. Its password is a secret: stored encrypted, never shown again, given to the probe for one run only and blanked out in every screenshot.
  4. Open a product, add it to the basket and go to checkout.
  5. End with a check that the payment page is there — This must be here on its payment button — and never with a click on “Place order”: the scenario runs on the real shop every few minutes, and every such click would be an order. If your payment provider has a test mode, a scenario may go to the end with its test cards.

Every run is played at once in Istanbul, Stockholm and Frankfurt, each in a fresh browser, and the regions vote as they do for a check: an incident opens only when the quorum agrees, so one region’s bad minute is not an outage. A shop that is reachable only inside your network is watched from a private location instead. Let the browser through your bot protection as the docs show: it names itself at the end of its User-Agent.

Who is called

Alerts go to the members of your organisation, each to the number they added to their own profile and confirmed (Settings → Profile → Notifications). Invite whoever fixes the shop — your developer, your agency — as a member, and they are alerted with you. Nobody adds a number for somebody else.

Without rules of your own, every member who is alerted gets SMS, e-mail and Telegram at once, and a call after 5 minutes if nobody has acknowledged — for monitors of critical severity, the default. Keep the shop front and checkout critical. Mark the rest major (Edit → Alerts → Severity): they reach people by e-mail and Telegram only, so a mail certificate rings nobody at night.

On-call → Escalation policies: the default policy, built in, followed by the monitors without a policy of their own; at once everyone gets SMS, e-mail and Telegram, after 5 minutes a phone call; SMS and calls for critical incidents only.
The rule every monitor follows until you write your own.

The Free plan includes 10 SMS and 3 calls a month, to +90 numbers. When they run out, alerts carry on by e-mail and Telegram, and the incident’s timeline says so (Plans & billing in the docs).

A status page for your customers

When checkout fails, customers write to support and on social media. A status page tells them you know before they ask. Give it components for the shop, payments and order e-mails, each bound to its monitors. It is in Turkish and English, and it is served from a CDN, so it opens while the shop is down. Link it from the shop’s footer and from the order e-mails; customers can subscribe to its updates by e-mail. Status pages: Free 1, Pro 2, Team 5, Business 20 (Status pages in the docs).

Before a campaign day

  • Make the last changes days before 11.11 or Black Friday, not on the day. A change you must make goes inside a planned maintenance window: checks go on, its alerts are held, and they start if the shop is still down when the window ends (Planned maintenance in the docs).
  • After the last change, make a test payment through your provider’s live page. The monitors see that the pages open, not that a card goes through.
  • On-call → People shows who has a confirmed number. Somebody needed that night without one is alerted by e-mail and Telegram only.
  • Put the status page’s address where customers will look for it, before the traffic comes.

Pause ads while the shop is down

Ads keep sending people to a shop that cannot sell. A webhook channel (Pro, Team and Business) tells a small program of yours when the shop front or checkout goes down and when it is back, and the program pauses your ad campaigns and resumes them. It runs on your server with your ad account’s token: Heimdall never holds it.

  1. In Meta’s Business Settings, give a system user access to the ad account and make it a token with ads_management. The campaigns’ IDs are in Ads Manager.
  2. Run the program below with the secret, the token and the campaign IDs in its environment, behind your web server with https — in nginx, location /heimdall-ads/ { proxy_pass http://127.0.0.1:8787; }.
  3. On-call → Integrations → Webhook, with that address. Keep the secret the channel shows once: it is the program’s HEIMDALL_WEBHOOK_SECRET.
pause_ads.py — Python 3, standard library
# pause_ads.py: Heimdall's webhook pauses the shop's Meta campaigns while the shop is down
import hashlib, hmac, json, os, time, urllib.parse, urllib.request
from http.server import BaseHTTPRequestHandler, HTTPServer

SECRET = os.environ["HEIMDALL_WEBHOOK_SECRET"].encode()  # whsec_… from the channel
TOKEN = os.environ["META_ACCESS_TOKEN"]                   # a system user's token with ads_management
CAMPAIGNS = os.environ["META_CAMPAIGN_IDS"].split(",")    # the campaigns that send people to the shop
MONITORS = {"Shop front", "Checkout"}                      # their names in Heimdall
GRAPH = "https://graph.facebook.com/v26.0"                 # the Graph API version your app uses
STATE = "pause_ads.json"                                   # open incidents, and what this paused

def graph(campaign, **params):
    params["access_token"] = TOKEN
    query = urllib.parse.urlencode(params)
    if "status" in params:  # a change is a POST, a read a GET
        req = urllib.request.Request(f"{GRAPH}/{campaign}", data=query.encode())
    else:
        req = urllib.request.Request(f"{GRAPH}/{campaign}?{query}")
    with urllib.request.urlopen(req, timeout=5) as r:
        return json.load(r)

def save(state):
    with open(STATE + ".new", "w") as f:
        json.dump(state, f)
    os.replace(STATE + ".new", STATE)

def handle(event):
    inc = event.get("incident") or {}
    if inc.get("monitor") not in MONITORS:
        return
    try:
        with open(STATE) as f:
            state = json.load(f)
    except FileNotFoundError:
        state = {"incidents": [], "paused": []}
    if event["event"] == "incident.opened" and inc["id"] not in state["incidents"]:
        state["incidents"].append(inc["id"])
    if event["event"] == "incident.resolved" and inc["id"] in state["incidents"]:
        state["incidents"].remove(inc["id"])
    save(state)
    # every event of these monitors brings the campaigns where they should be: a call
    # that failed is made again with the next one, or when Heimdall tries this one again
    if state["incidents"]:  # down: pause what is running, and only that
        for c in CAMPAIGNS:
            if c not in state["paused"] and graph(c, fields="status")["status"] == "ACTIVE":
                graph(c, status="PAUSED")
                state["paused"].append(c)
                save(state)
    else:  # back: resume what this paused, and only that
        for c in list(state["paused"]):
            graph(c, status="ACTIVE")
            state["paused"].remove(c)
            save(state)

def verified(raw, header):
    parts = dict(p.split("=", 1) for p in header.split(","))
    t, sig = int(parts["t"]), parts["v1"]
    if abs(time.time() - t) > 300:
        raise ValueError("too old: a replay")
    mac = hmac.new(SECRET, f"{t}.".encode() + raw, hashlib.sha256).hexdigest()
    if not hmac.compare_digest(mac, sig):
        raise ValueError("not from Heimdall")
    return json.loads(raw)

class Receiver(BaseHTTPRequestHandler):
    def do_POST(self):
        raw = self.rfile.read(int(self.headers.get("Content-Length", 0)))
        try:
            event = verified(raw, self.headers.get("X-Heimdall-Signature", ""))
        except (ValueError, KeyError):
            return self.answer(401)
        try:
            handle(event)
        except Exception as e:  # Meta unreachable, a token revoked: a 5xx, and Heimdall tries again later
            self.log_error("%s", e)
            return self.answer(503)
        self.answer(204)

    def answer(self, code):
        self.send_response(code)
        self.end_headers()

HTTPServer(("127.0.0.1", 8787), Receiver).serve_forever()
  • It pauses only campaigns that are running when the shop goes down, and when the last incident of those monitors is resolved it resumes only what it paused: a campaign somebody paused by hand stays paused. It keeps that in pause_ads.json, so a restart forgets nothing.
  • It answers within Heimdall’s 10 seconds. When Meta does not answer, it says 503 and Heimdall delivers the event again later; every event of those monitors puts the campaigns where they should be.
  • An incident that opens inside a planned maintenance window reaches the channel only if the shop is still down when the window ends: a deploy inside a window pauses nothing.
  • The channel hears every incident in its scope; the program acts only on the monitors named in MONITORS. Rename them there when you rename them in Heimdall.
  • Google Ads works the same way: customers/<id>/campaigns:mutate with the status PAUSED, then ENABLED, a developer token and an OAuth access token (Google’s client libraries renew it). Replace graph() with that call.
  • “Send test” on the channel sends a test event, which the program ignores. To try the whole path, list a test monitor whose target you can switch off, with a test campaign.

In the docs