Skip to content

Example: Common events

Richard Cowin edited this page Jan 16, 2024 · 2 revisions

Page load events

{
  "source": "expression",
  "key": "window.location.pathname",
  "action": "event",
  "apply": [
    {
       "when": "/product",
       "tag": "pageload.product"
    },
    {
       "when": "/cart",
       "tag": "pageload.cart"
    }
  ]
}

CTA click events

{
  "source": "dom",
  "on": "click",
  "action": "event",
  "apply": [
    {
       "key": "button.add-to-cart",
       "tag": "click.cta.add-to-cart"
    },
    {
       "key": "button.checkout",
       "tag": "click.cta.checkout"
    }
  ]
}