Skip to content

Custom events and customers

Record anything that matters to your shop with track. Custom events work in both commerce modes.

qm("track", "size_guide_opened", { category: "shoes" });
qm("track", "chat.started");
  • Name: lowercase letters, digits, _, . and -, starting with a letter or digit, up to 64 characters. Other names are dropped.
  • Props: an optional plain object, up to 2 KB as JSON. Larger props drop the event. Email- and phone-like strings in them are masked.
  • The event is stored as custom:<name>, for example custom:size_guide_opened.

Do not put personal data in custom events.

When a buyer is logged in, pass their customer id:

qm("identify", "customer-1042");

The id itself is never sent. The script sends a SHA-256 hash of the id together with the site’s key, so the same customer gets the same hash on every visit and device, and the hash means nothing outside your website. On a page without HTTPS (where the browser cannot hash), nothing is sent.

Call it on every page load while the buyer is logged in, for example in your layout.