Custom events

Count what people do, not only where they went.

Pageviews tell you where people went. Custom events tell you what they did — signed up, added to cart, started a trial.

window.causalit('signup', { props: { plan: 'pro' } });

Limits

  • The name is required: letters, digits, spaces, underscore, dot and hyphen, up to 64 characters.
  • Properties are optional and flat — strings, numbers and booleans, up to 30 keys.
  • Nested objects and arrays are rejected rather than silently flattened.

Calls that fire before the script loads

window.causalit only exists once the tag has run. If a handler might fire earlier, define a queue stub first and the tag will replay everything in order once it loads:

<script>
  window.causalit = window.causalit || function () {
    (window.causalit.q = window.causalit.q || []).push(arguments);
  };
</script>

Start free

Custom events — causalIT