Tracking button events – Google Analytics

Last updated: July 26, 2021 Written by: Avatar Teresa
Table of contents
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.

Not know how a properly defined gtag code for tracking events should look like and what parameters make events up? Check current guidelines in the Google Analytics help center and information about the 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 the Landingi account and go to the editor of your landing page.

3. Select the button on which you want to track events and enter its Settings.

4. Go to the Settings tab (1). In the onClick event field (2), paste the gtag.

5. Save and close. Then publish your landing page again.

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.


Was this manual helpful?