A machine-readable guide to this site for AI agents and language models is available at/llms.txt(https://dev.acquia.com/llms.txt on the production site).
onclick="window.monsido_functions.trackEvent('Category', 'Action', 'Event', 1);"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:
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:
This is how the above configuration appears when the event data starts to come in:
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>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>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>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.
In Google Tag manager, Click Tags, from the menu on the left side of the page.
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>Select the tag to be triggered on one or several pages.
For more information, visit About triggers - Tag Manager Help.
If this content did not answer your questions, try searching or contacting our support team for further assistance.
Select the tag to be triggered on one or several pages.
If this content did not answer your questions, try searching or contacting our support team for further assistance.