Skip to content

Custom events with Monita Collect

Most monitoring watches requests that vendors already make. Sometimes the thing you want to monitor isn’t a vendor call at all — a data layer state, a user action, a condition in your own code. Monita Collect lets you send those as first-class events with one JavaScript call.

  1. Set up global monitoring on the property — Monita Collect rides on the same script.

  2. Choose (or create) the vendor you want the events attributed to, and switch on Monita Collect for it.

  3. Click the code icon next to the vendor to open its code panel — it shows the exact vendor name and a copy-paste snippet.

  4. Call monitaSendBeacon from your site’s JavaScript wherever the thing you care about happens:

    monitaSendBeacon('Monita', 'customEvent', {
    // any additional data you want on the event:
    url: window.location.href,
    pageCategory: 'landing',
    userId: 'user123',
    });

    The arguments are vendor name, event name, and an object of parameters. Use the exact vendor spelling from the code panel so events group (and get the vendor’s logo) in dashboards.

  1. Trigger your custom event and watch the Network tab for a POST to collect.monita.ai returning 204 — see Verifying network requests.
  2. The event appears in the property’s Visualisation view under the vendor and event name you sent.

Custom events work everywhere ordinary events do: alert rules, data validation, signal volume and the data dictionary.