This is the easiest way to get started with event tracking. 🤗 All you need is to add a special attribute to the HTML elements that you want to track events from.

For example, to track a button click, you should add 👇

<button data-cyanstats-event="Button Click">Click me</button>

When this button gets clicked, an event will be recorded with a Button Click description that can be seen in your dashboard at Cyan Stats.

Event payload

To record a payload along with the tracked event, you just need to include an additional data-cyanstats-event-[KEY] attribute, as seen in the following example:

<button 
  data-cyanstats-event="Button Click" 
  data-cyanstats-event-local="Navbar"
>Click me</button>

The above example will record an event with the following structure, that can be seen later on in your dashboard at Cyan Stats:

{
  event: 'Button Click',
  local: 'Navbar'
}

© 2024, Abtz Labs | by Rogerio Taques