---
title: "Event tracking"
date: "2022-08-24T14:54:08+00:00"
summary: "Track visitor interactions on your website with Event Tracking. Monitor clicks on buttons, links, and more for valuable user insights."
image:
type: "page"
url: "/web-governance/event-tracking"
id: "a428be59-32c9-4bdc-b1bc-c502c367c9b0"
---

Table of contents will be added

Introduction
------------

This document provides instructions on how to use _Event Tracking_ in the _Statistics_ feature.

Track visitor interactions on your website with the _Event Tracking_ option. This lets you add event tracking to any clickable element on your web pages, for example, buttons, links, drop-down menus, and widgets. The interface displays the number of times that visitors click on a tracked element.

Note

One Click = One Event. For example, if the same user interacts with the item 10 times, it is counted as 10 events.

Prerequisites
-------------

To track events on your website, the following requirements must be fulfilled:

1.  The script has to be present on your website.
    
    For more information, visit [How to add the script](/node/60216).
    
2.  The _Statistics_ feature has to be enabled.   
    For more information, visit [Statistics](/node/60241).
3.  The web page element that you want to track interactions on must contain the following code snippet:

    onclick="window.monsido_functions.trackEvent('Category', 'Action', 'Event', 1);"

Define Categories, Actions, and Event Names
-------------------------------------------

To classify an event, assign a category, action, and name.

For example, you may have _Contact Us_ buttons in various places on your website and would like to track how many people actually click them. For the _Contact Us_ button on the _Home_ page, you could classify it as follows:

*   **Category**: Contact
*   **Action**: Contact Us button
*   **Event**: Click the **Contact Us** button on the Home page.

The code to add to the "Contact Us" button from this example looks like this:

    onclick="window.monsido_functions.trackEvent('Contact', 'Contact Us button', 'Click Contact Us button on Home page', 1);"

If the same button is on a different page, for example, your _Privacy Policy_ page, use the following classification for that element:

*   **Category**: Contact
*   **Action**: Contact Us button
*   **Event**: Click the **Contact Us** button on the Privacy Policy page.

This is how the above configuration appears when the event data starts to come in:

![Example of some Event data from a sample website. The fields on the page are described in the document text.](https://acquia.widen.net/content/e49c0ef6-84c3-441a-95b4-4230a330ec67/web/Mon_Statistics-EventData.png)

Setup
-----

1.  Make sure your website and the app configuration both meet the prerequisites.
2.  Locate a clickable element on your website that you wish to add event tracking to. In this example, we will use a "Book a demo" button located in the website header.
3.  Open the CMS (website builder software) and find the HTML code for the "Book a demo" button. In this example, the code looks like this:
    
        <a href="https://example.com/demo">
        <button class="header-btn" type="button">
        Book a demo
        </button> </a>
    
4.  Copy the code snippet and paste it inside the <button> element of your code. It should look like this:
    
        <a href="https://example.com/demo">
        <button class="header-btn" type="button"
        onclick="window.monsido_functions.trackEvent
        ('Category', 'Action', 'Event', 1);">
        Book a demo
        </button> </a>
    
5.  Specify a Category, Action, and Event that you want this event to be tracked as. These will show up within the interface and help you understand the data.
    
    In our example below, the Category is "Conversion", the Action to "Book a demo", and the Event to "Website header button clicked". The final code should look like this:
    
        <a href="https://example.com/demo">
        <button class="header-btn" type="button"
        onclick="window.monsido_functions.trackEvent
        ('Conversion', 'Book a demo', 'Website header button clicked', 1);">
        Book a demo
        </button> </a>
    
6.  Publish your website. Tracking is activated now on any clicks done on the _Book a demo_ button.

View Events data
----------------

1.  To view the Events data, log in and navigate to the Statistics module > Content > Events. There you can see all of the events data that is tracked on your website. Be aware that in some cases it can take up to 24 hours before tracked data is displayed in the application.  
    The number in the _Events_ column indicates how many times the selected element has been clicked.
    
    ![The location of the Actions button on the Events page, above the list of actions and just above the Search bar.](https://acquia.widen.net/content/f4f06d78-3e42-4243-9edd-c638a8ccea34/web/Mon_Statistics-Events-ActionsButton.png)
    

Instructions
------------

This section provides instructions on how to navigate to **Event Tracking** in the **Statistics** module.

1.  Navigate to the dashboard for the domain.
    
    ![The Domain Dashboard with sections for several active modules.](https://acquia.widen.net/content/1f5bcdac-5405-4063-afdc-fabbd0811e16/web/WebGov_DomainDashboard-LandingPage.png)
    
2.  Locate the **Statistics** section and click to open it, or click **Statistics** (the broken pie chart icon) on the page menu bar. The Statistics landing page opens.
3.  From the menu on the left, click **Content**. The menu expands.
    
    ![The location of the Content button on the left menu bar on the Events page.](https://acquia.widen.net/content/3c5ca267-f8cf-4f99-bb66-1023f9ab511d/web/Mon_Statistics-Events-LeftMenu-ContentButton.png)
    
4.  From the expanded menu, click **Events**.
    
    ![The location of the Events button, in the expanded Content option on the left menu bar on the Events page.](https://acquia.widen.net/content/36a0730e-75d8-4930-aed1-9c420e3fe0a0/web/Mon_Statistics-Events-LeftMenu-Content-EventsButton.png)
    
    The _Events_ page opens by default to the _Categories_ view.
    

Event Categories
----------------

From the options on the top right side of the window, click **Categories**.

![The location of the Categories button, at the top of the page in line with the page title.](https://acquia.widen.net/content/1410b93d-1d67-4414-8178-5d76839bf2d1/web/Mon_Statistics-Events-CategoriesButton.png)

*   The _Categories_ view is a table with the following headers:
    
    *   **Category:** User-assigned category. This can be, for example: _Contact_.
    *   **Action**: This is the element that is assigned to be tracked, for example, a _Contact Us_ button.
    *   **Events**: This column tracks and shows the number of times that users interact with the element, for example clicks on the _Contact Us_ button.
    
    Note
    
    One Click = One Event. For example, if the same user interacts with the item 10 times, it counts as 10 events.
    

Event Actions
-------------

From the options on the top right side of the window, click **Actions**.

![The location of the Actions button on the Events page, above the list of actions and just above the Search bar.](https://acquia.widen.net/content/f4f06d78-3e42-4243-9edd-c638a8ccea34/web/Mon_Statistics-Events-ActionsButton.png)

*   The Actions view sorts the chart per tracked item, for example a link or button. The _Actions_ view table has the following headers:
    
    *   **Action**: This is the element that is assigned to be tracked, for example, a _Contact Us_ button.
    *   **Name**: This category is defined by the user. It usually defines the element further if needed.
    *   **Events:** This column tracks and shows the number of times that users interact with the element, for example the number of clicks on the _Contact Us_ button.
    
    Note
    
    One Click = One Event. For example, if the same user interacts with the item 10 times, it is counted as 10 events.
    

Event Export
------------

This section gives information on how to export events statistics.

1.  Click **Export** from the page functions menu on the top right side of the page.
    
    ![The location of the Export button; in the page menu options under the page header row.](https://acquia.widen.net/content/6a255488-3f48-418b-877b-5e7a79ed1065/web/Mon_Statistics-Content-EventsExportButton.png)
    
2.  A dialog opens. Select the export name from the list.
    
    ![The Export dialog for the Statistics export function. The description is in the document text.](https://acquia.widen.net/content/fc7a4b2f-6449-4547-a08a-16188f87c1f0/web/Mon_Statistics-Export-Dialog.png)
    
3.  The export is sent to the email that is specified on the account.

Event Names
-----------

From the options on the top right side of the window, click **Names**.

![The location of the Names button on the Events page, above the list of actions and just above the Search bar.](https://acquia.widen.net/content/947684a6-5d1c-408c-bd55-e0f7d69f6143/web/Mon_Statistics-Events-NamesButton.png)

*   The table provides the following information:
    
    *   **Name**: This category is defined by the user. It usually defines the element further if needed.
    *   **Action**: This is the element that is assigned to be tracked, for example, a _Contact Us_ button.
    *   **Events**: This column tracks and shows the number of times that users interact with the element, for example number of clicks on the _Contact Us_ button.
    
    Note
    
    One Click = One Event. For example, if the same user interacts with the item 10 times, it counts as 10 events.
    

How to set up onclick Events with Google Tag Manager
----------------------------------------------------

The onclick event executes a certain functionality when, for example, the user clicks on any button.   
This event lets website owners monitor and track the number of clicks on each button or link, and use this data to improve the browsing experience for website visitors.

1.  Make sure that the script is already deployed on Tag Manager, so that the statistics are ready to collect data.  
    For more information, visit [Google Tag Manager deployment](/node/58476).
2.  Click **Tags**, from the menu on the left side of the page.
    
    ![The Tags list, with the Tags option in the left menu selected and the New button on the top right of the page selected.](https://acquia.widen.net/content/14bd259c-8f35-4e97-b7c2-78d8e9523526/web/Mon_GoogleTagManager-Events-TagsListButton-NewButton.png)
    
3.  Click **New**, on the top right of the page.
4.  Create a new **tag** with the type should be **Custom HTML.**  
    ​**Note**: The event is set with Javascript.
5.  Rename the tag. That option is on the top left corner of the window.
6.  Add the event onclick script.
    
        1<a class="b-btn-t" href="#">Click me</a> 2<script type="text/javascript"> 3function trackEvent() { 4 return window.monsido_functions.trackEvent('Category', 'Action', 'Event', 1); 5} 6document.querySelector('a.b-btn-t').addEventListener("click", trackEvent); 7</script>
        
    
    Note
    
    Make sure to adjust the script, since it is set to trigger on a specific button.​
    
7.  Select the tag to be triggered on one or several pages.
8.  Note
    
    The trigger configuration might need to be adjusted.
    
9.  Save the changes.
10.  Publish to the website.

For more information, visit [About triggers - Tag Manager Help](https://support.google.com/tagmanager/answer/7679316?hl=en).

Additional resources
--------------------

For more information, visit:

*   [Cookieless tracking setup](https://docs.acquia.com/acquia-optimize/features/statistics/cookieless-tracking).
*   [User-Friendly Website Analytics](https://monsido.com/platform/statistics)
*   [Website Statistics Software | GDPR-Compliant Analytics | Monsido](https://monsido.com/platform/statistics).