To track clicks on your "Book Online" button in Webflow using Google tools (like Google Analytics or Google Tag Manager), you need to add a custom tracking event. Here's how to do it depending on whether you're using Google Tag Manager (GTM) or Google Analytics directly.
book-online-btn) or a Class (e.g., book-button).
```js
<script>
document.addEventListener('DOMContentLoaded', function () {
var bookBtn = document.getElementById('book-online-btn');
if (bookBtn) {
bookBtn.addEventListener('click', function () {
gtag('event', 'click', {
'event_category': 'Button',
'event_label': 'Book Online',
'value': 1
});
});
}
});
</script>
```
gtag(...) with your own tracking logic if you're using a different method like GTM.
Click ID equals book-online-btn) or Class (Click Classes contains book-button).bookbuttonclick, label: Book Online).
Add a unique ID or class to your "Book Online" button, then use either custom JavaScript or Google Tag Manager to send an event to Google Analytics when the button is clicked. Always test with Tag Assistant or GTM Preview before going live.