Tracking Button Click Events with Google Tag Manager

Tracking specific button clicks on a page with a universal pixel in Google Tag Manager (GTM) involves three steps:

1. Create a Universal Pixel in Basis

Universal pixels can act as conversion pixels and audience pixels on multiple pages at once. This lets you use a single pixel on different pages on your website, and even place that pixel before your conversions or audiences are set up. See Universal Pixels for more information.

Before you create a universal pixel, identify the button click event you want to track. In this scenario, you track the Connect With Us button.

Website with Connect with Us button selected for tracking a button click event.

2. Create a Tag for Your Universal Pixel in GTM

After you install your GTM Container on all pages of your site, create a tag. A tag is made up of two components: tag configuration and triggering. Tags are segments of code provided by analytics, marketing, and support vendors to help you integrate their products into your websites or mobile apps. With GTM, you no longer need to add these tags directly to your projects. You configure and publish tags from within GTM. See Google's About Tags page for more information.

3. Create and Apply a Trigger to Your Universal Pixel in GTM

After you create a tag, create and apply a trigger to your universal pixel. A trigger scans your web page or mobile app for certain types of events like form submissions, button clicks, or page views. The trigger tells the tag to fire when it detects the specified event. Every tag must have at least one trigger to fire. See Google's About Triggers page for more information.

How to Check if your Universal Pixel is Firing in Chrome

After the GTM container has been published, check if your universal pixel is firing on all pages correctly in a live environment.

To check if your universal pixel is firing in Chrome:

  1. In Google Chrome, select Chrome’s Menu icon > More tools > Developer tools (Ctrl+Shift+I) on the newly pixeled page to open the Developer tools panel.

  2. Select the Network tab.

  3. Search for the key value, button=connectwithus in this case, then click the specified button to see if your universal pixel fires in real time.

    Chrome developer tools showing pixel fires in real time.