If you’ve ever wanted to see data on how your visitors are interacting with your website, the free WP Google Analytics Events plugin might be just what you need.
Recently, one of our customers asked if they can track their user’s behavior when using one of our plugins. Google Analytics is a powerful and free tool that is very often underused. Besides tracking page views and sessions, you can track clicks on buttons and links as well.
Adding Event Tracking manually to any website can be achieved by adding a custom click “event” with JavaScript but it’s a more advanced process.
This tutorial will show you how to do that in WordPress easily with the free WP Google Analytics Events plugin from WPflow.com.
For this tutorial we’ll use a restaurant website as an example. We’ll track how often visitors click on the “Find A Table” button using our OpenTable Widget. Collecting this data will help you to compare how many visitors clicked to make a reservation, compared to the data you get from OpenTable for how many reservations you actually got. This gives you insight as to how well your site is converting new reservations for you.
Things You’ll Need:
- A Google Analytics account
- Your website configured to use Google Analytics
- Our free (or Pro) OpenTable Widget plugin
- The WP GA Events plugin (free or Pro — see below for a discount)
Install WP Google Analytics Events Plugin
First, we will install and activate the WP Google Analytics Events plugin. This will add a new menu item named WP GA Events in the left panel of your WordPress admin dashboard.
Configure General Settings
Setup is pretty straightforward. Let’s get started by going to WP GA Events > General Settings.

There are four tabs on the General Settings page. I’ll go over each tab’s settings.
- Google Analytics Identifier
Enter your Google Analytics tracking ID - Don’t add the GA tracking code
Most likely you’re already tracking your visits through Google Analytics and already have a GA plugin or the snippet embedded into your site somehow. Check this box so the plugin doesn’t add the tracking code a second time. - Universal Tracking Code
Check this box if you are using the Universal Tracking Code. Leave it unchecked if you aren’t sure. If the tracking doesn’t work then try it both ways to see if the settings makes a difference. - IP Anonymization (Requires Code Snippet)
Leave unchecked
Configure Click Tracking With OpenTable Widget
On the Click Tracking tab in the GA Scroll Events plugin settings there are a few bits of information we need to fill in and then we’re on our way to tracking click events in Google Analytics!

Element Name:
The class or id of the item to track. For this example we will track when a visitor to your website clicks the FIND A TABLE button in the OpenTable Widget.

Let’s grab the element name of the button first. Head on over to our OpenTable Widget demo website and you will see two example widgets.
See the blue Find A Table button? Right click and select and choose Inspect (Chrome) or Inspect Element (FireFox?).
You’ll see lots of code but all we need to look for is either id= or class=.
<input type="submit" class="otw-submit" value="Find a Table">
In this case the button has a class of “otw-submit.”
Back in the plugin Click Tracking settings you’ll enter otw-submit under Element Name.

Type:
If the Element Name is a class choose class if it is an id choose id.
Event Category:
For this example we will enter “Reservation.”
Event Action:
This will also show up in your Google Analytics stats and can be useful for tracking. I am typing in click.
Event Label:
When you visit Google Analytics later to enjoy your new statistics on visitors click behavior you’ll see the Event Label. This is a handy way of telling us what this button or link is. For this example I named it Find a table clicked.
Event Value:
Let’s leave this blank for now.
Non-Interaction:
True
Now click Save Changes.
View Click Tracking Events in Google Analytics
With the plugin configured and click tracking setup the next step is to open Google Analytics and test it out using the Real-Time analytics feature.
First, open your Google Analytics dashboard, and select Real-Time and then Events. There’s a really small link to switch over to Viewing: Events (Last 30 min). Click on that.

Now when you go the OpenTable Widget on your site, and click the “Find a Table” button, you should see a response in Google Analytics’ real-time tracking for Events.

As you can see in the above screenshot the Event Category is “Reservation” and the Event Action is “click.”
The Real Time statistics are handy for testing to see that our setup works and, of course, for seeing statistics in real time. But eventually you’ll gather more data and want to view it out a week or a month, or more. To view all Events statistics in Google Analytics, select “Behavior” and then “Events.” There you can select to view clicks by “Event Label” or “Event Action.”

In this example I have selected “Event Label” and we see that the “Find a table clicked” Event has 4 Total Events and 2 Unique Events. So we know that two site visitors clicked the “Find a Table” button in our OpenTable Widget a total of four times.
This data is incredibly useful in seeing how often your customers are using your website to make reservations. Now you can see real numbers on how many customers are potentially making reservations using OpenTable while visiting your website.
Other Examples Of Click Tracking
As long as a button or link has an “id” or “class” you can track it easily with the WP Google Analytics Events plugin. Check it out on the WordPress Repository and visit their website for more detailed plugin documentation. Here are some other examples of how you can use this plugin to track events on your website.
Quick Checkout
Class = add_to_cart_button
Track the “Buy Now” button with our Quick Checkout WooCommerce plugin to see if customers commit to buy but then see the checkout and leave the site without making a purchase.
Give
Class = give-submit
Similarly, you can track the “Donate Now” modal popup button in our Give donation plugin to see if donors commit to make a donation but then do not complete the transaction. This can be useful data when comparing the number of clicks on the “Donate Now” button versions the actual completed conversions in Google Analytics.
Google Places Reviews
Class: gpr-business-name.
Track each time a website visitor clicks on to visit your Google Business profile when viewing reviews with our Google Places Reviews plugin. This data will help you to see that your website is encouraging customers to leave reviews on your Google profile. Google reviews are valuable for gaining new customers by seeing positive comments from your existing customer base.
OpenTable Widget
For this tutorial we reviewed tracking events with Google Analytics using the OpenTable Widget. OpenTable Widget allows you to easily create powerful restaurant reservation forms throughout your WordPress powered website using an intuitive widget and shortcode.
Read more and download for free at our website.
Get GA Event Tracking Pro for 20% off
WPFlow is offering our WordImpress readers a 20% discount off their Pro version of WP GA Events. Just use this coupon at checkout:
Impress
We do not get any proceeds of these sales at all, this is not an affiliate link. We reached out to WPFlow because we appreciated their free plugin and from there we offered the idea of a coupon just for our readers. Enjoy and start clicking and tracking all the things!
does the code still work? And do I need the pro account?
It should. If you have a support request about the free Open Table Widget plugin, submit it here and we’ll do our best to assist: https://wordpress.org/support/plugin/open-table-widget
I followed the instructions and the event isn’t showing up in my real-time feed. My class is ot-button ot-dtp-picker-button en. Does that look right?