Tracking button events – Google Analytics

Last updated: August 12, 2022 Written by: Avatar Teresa
share
Table of contents
share
Table of contents

If your landing page already has a global website tag (gtag) implemented as instructed, you can also track other events in Google Analytics, such as clicking a button.

Go to Google Analytics help center to learn more about gtags for tracking events.

How to track an onClick event on the landing page in Google Analytics?

1. Prepare the gtag code for measuring events – you can use the example given below or build your own one according to the syntax recommended by Google Analytics.

gtag('event', 'aaa', {   'event_category' : 'bbb',   'event_label' : 'ccc' });

The inclusion of the event category and action is mandatory. Optionally, you can add a label and the value.

2. Log in to your Landingi account and go to the editor of your landing page.

3. Select the button on which you want to track events and click Add onClick event in the right-side toolbar.

4. Paste the gtag and click Save & close.

5. Publish your landing page.

To check Google Analytics reports with events, log into your Google Analytics account and go to Behavior > Events > Overview.

Remember that events can be visible in Google Analytics reports with up to 24 hours delay.

share

Was this manual helpful?