Skip to main content
You can disable events tracking:
  1. Go to the menu on the top right and navigate to Settings
  2. Select Sites.
  3. Select the desired site.
  4. Check/Uncheck the Checkbox next to Track Events.
  5. Click Save at the bottom of the page.

How to use events

Events require one parameter and support one optional parameter:
  1. Required first parameter: Event name.
  2. Optional second parameter: String for additional data, like JSON, or an numeric string which will be used for summarizing values, e.g. e-commerce sales.
Ensure event code is placed after the Axo script to guarantee proper loading. Events require HTTPS/HTTP and cannot be tracked locally. Event names cannot be renamed after creation, but you can modify the event name in your code. This is how you would track a simple event.
<script>
  window.addEventListener('load', (event) => {
    axoanalytics.trackEvent('newsletter signup');
  });
</script>
If you want to add additional data (up to 1024 characters) which are available via Data Export (and later via API), you can add that data as a string:
<script>
  const payload = {
    foo: 'bar',
  }
  window.addEventListener('load', (event) => {
    axoanalytics.trackEvent('data event', JSON.stringify(payload));
  });
</script>

Event Conversion Formula

There are two modes for calculating event conversions: either based on the count of pageviews or based on the count of visitors. This is how you can change the formula for event conversions:
  1. Go to the menu on the top right and navigate to Settings
  2. Select Sites.
  3. Select the desired site.
  4. Scroll down to the section for Event Conversion Formula and select either Pages or Visitors.