How to Track Custom Google Analytics 4 Events in WordPress?

Updated on July 1, 2023 by Ananda

Table of Contents

Tracking custom events in Google Analytics 4 (GA4) allows you to monitor specific user interactions on your WordPress website beyond the GA4 Recommended events

Whether it’s tracking clicks on custom buttons, form submissions, or other unique actions, custom event tracking provides valuable insights into user behavior.

With the Event Tracking extension of The Plus Blocks for Gutenberg, you can easily track custom events using Google Analytics on your WordPress website.

To check the complete feature overview documentation of The Plus Blocks for Gutenberg Event Tracking extension, click here.

Requirement  – This extension is a part of The Plus Blocks for Gutenberg, make sure it’s installed & activated to enjoy all its powers.

Note: To track Google events on your WordPress website you need to have Google Analytics or Google Measurement id installed on your website.

Once you’ve added the Google Measurement id, you can use buttons, forms or any custom links on blocks from The Plus Blocks for Gutenberg to track events. So, for instance, add a button block from The Plus Blocks for Gutenberg on the page.

1. Go to Advanced > Event Tracking

2. Turn on the Google Analytics toggle.

3. In the Event Type dropdown, select Custom

4. In the Event Name field, enter your custom event name.

event tracking add custom google event

5. Then from the Event Properties section, you can add custom properties to the event.

Open the item here you’ll find two fields – 

Name – For adding a custom label to the event.

Value – For adding a custom value to the event.

You can click on the + Add Properties button to add multiple custom properties.

Let’s suppose we are promoting an affiliate product so we can add the affiliate network name and product name in the Name and Value fields, respectively.

6. In Google Analytics 4, it can take up to 24 hrs to show the events in the analytics. So to check the event instantly to know if it is working or not, install the Google Analytics Debugger Chrome extension. 

7. Open the page in Chrome and turn on the Google Analytics Debugger extension. Reload the page and click on the button.

Note: Make sure your ad blockers are disabled, and you’re not using brave browser. You can also read steps to do if your debug view isnt working. 

8. Now go to your Google Analytics then go to Admin > DebugView, here you’ll see the events live. You’ll also see your custom events and their properties.

google analytics track custom event

Also, read How to Track Custom Facebook Events in WordPress.