Evaluate a website feature with Google Analytics

Warning: this content is older than 365 days. It may be out of date and no longer relevant.

Ever wonder how many people think about clicking a button on your website? With Google Analytics, you can stop wondering and start learning.

I often wonder, how many people think about clicking a button on my website, such as the “hire me to speak” button. I especially wonder how many people think about clicking it but never do. Google Analytics gives us the ability to determine how many people are thinking about it but never do it.

To set this test up, you’ll need a free Google Analytics account.

Step 1: Set up a Google Analytics goal.

You’ll start by going to goals in your Google Analytics Admin control panel:

Google Analytics goals_setup_1.jpg

Start a new goal:

Google Analytics goals_setup_2.jpg

In Goal Setup, choose a custom goal:

Google Analytics goals_setup_3.jpg

Name your goal something logical and intuitive, and choose event:

Google Analytics goals_setup_4.jpg

Next, configure the event parameters. This is fancy talk for categorizing what your visitor is doing. I named mine navigation for the category (since the visitor is navigating around my site), hover for the action, and speaking-button for the label, or what they’re hovering their mouse over:

Google Analytics goals_setup_5.jpg

Note above I also set an arbitrary amount of 1 for the goal value. Value the event by what it’s worth, but if you have no idea, you can default to1. Remember, it will alter your eCommerce reporting, so if you’re not sure what the event is worth, leave it blank instead if you don’t want to mess up your eCommerce reports.

Hit save.

Next, you’ll need to make an edit to your website to add the event we’ve just configured. If you’re using the modern version of Google Analytics’ Universal Analytics, you’ll add this Javascript to your button/page element:

ga('send', 'event', [eventCategory], [eventAction], [eventLabel], [eventValue], [fieldsObject]);

To use my settings above, I’d rewrite this as:

ga('send', 'event', 'navigation', 'hover', 'speaking-button');

Next, we add this event in jQuery to our page’s HTML:

$(document).ready(function() {
    setTimeout(function() {
      ga('send', 'event', 'navigation', 'hover', 'speaking-button');
    }, 1000);

What the above code says is, for the item named speakingitem on our page (which in my website’s case is the sidebar item), if a user’s mouse pointer hovers over that button for more than a second (1000 ms in the script above), send the event to Google Analytics. We avoid just the random mouseovers that way. On most websites, you’ll paste this into your site’s code in the head section.

If you’re not using Universal Analytics, upgrade first (it’s free), and then use the above. There’s no reason to use the legacy version of Google Analytics. How do you know which version you’re using? On any page on your website, use Google’s free Tag Assistant extension for Chrome:

Google Analytics setup 1.png

Click on Google Analytics and it’ll tell you which version you’re on:

ga setup 2.jpg

Give this a try if you’ve got something on your site which requires insight into user intent!

You might also enjoy:

Want to read more like this from Christopher Penn? Get updates here:

subscribe to my newsletter here

AI for Marketers Book
Take my Generative AI for Marketers course!

Analytics for Marketers Discussion Group
Join my Analytics for Marketers Slack Group!


Leave a Reply

Your email address will not be published. Required fields are marked *

Pin It on Pinterest

Share This