WPCode Logo

WPCode Documentation

Documentation, Reference Materials, and Tutorials for WPCode

Most Popular

Get free tips and resources right in your inbox, along with 500+ others

Follow Us

How To Use the Conversion Pixels Custom Click Tracking

Would you like to report a conversion to your ad platforms the moment a visitor clicks a specific button on your site? In this guide, we’ll walk you through setting up custom click tracking in the WPCode Conversion Pixels addon. All you need is the addon, a pixel already set up, and the CSS selector of the element you want to track.

Requirements: Custom click tracking is part of the Conversion Pixels addon, which is available on a plus license level or higher.

Before you get started, make sure WPCode is installed and activated on your WordPress site.

Adding a Click Event

To open the pixel settings, go to Code Snippets » Conversion Pixels in your WordPress admin sidebar.

The WordPress admin sidebar showing Conversion Pixels under Code Snippets, with the Conversion Pixels settings page and its row of platform tabs open behind it

The settings for each ad platform sit on their own tab. From here, click Click Tracking, the last tab in the row.

The Conversion Pixels tab row with a red arrow pointing at the Click Tracking tab, which is selected

The Custom Click Tracking panel opens with one empty click event ready to fill in. Each click event pairs an element on your site with the event you want reported when someone clicks it.

The Custom Click Tracking panel showing its intro text and an empty CSS Selector field

In the CSS Selector field, enter the selector for the element you want to track. This is the only field a click event needs, so a row you leave blank will not be saved.

The CSS Selector field filled in with #quote-request-button, with a red arrow pointing at it

It helps to make your selector as specific as you can, ideally a unique ID on the button or link itself. A specific selector matches exactly the element you have in mind. Our guide on finding a CSS selector covers how to look one up on your own site.

Next, fill in Event Name with a label you’ll recognize in your ad platform reports. Then add a number in Event Value if you want to attach a monetary or scoring value to the click. Both fields are optional.

The Event Name field set to QuoteRequest and the Event Value field set to 50

With the click event’s own details filled in, the next step is telling WPCode which pixels should report it.

Choosing Pixels and Standard Events

Below those fields, the Pixels section decides where this click gets reported. It lists the five pixels WPCode can send click events to: Facebook, Google, Pinterest, TikTok, and Snapchat.

The Pixels section listing Facebook, Google, Pinterest, TikTok, and Snapchat, each with its toggle switched off, four of them with a Choose Standard Event dropdown and Google with a Conversion Label field

Every pixel starts switched off. To report this click to a platform, switch on the toggle next to it. Only the pixels you switch on receive the event.

The Facebook toggle switched on and colored blue, with a red arrow pointing at it, and the Google toggle still off below

Each pixel also has its own event control beside the toggle. Four of the five offer a dropdown of that platform’s standard events, and Google offers a Conversion Label field instead. Next, open the Choose Standard Event dropdown next to a pixel and pick the one that matches what the click means.

The Facebook standard event dropdown set to Lead, with a red arrow pointing at it

A standard event chosen here takes precedence over the Event Name you entered earlier, and it applies to that pixel alone. That lets you send one click to several platforms while giving each of them the event name it understands. When you leave a pixel’s picker on Choose Standard Event, that pixel receives your Event Name as a custom event instead.

Setting a Conversion Label for Google

Google’s Conversion Label field works differently from the standard event dropdowns. Once you’ve switched on the Google toggle, enter the label for the conversion action you want this click to count toward.

The Google toggle switched on with a conversion label entered in its field, a red arrow pointing at the field, and the Facebook row above still set to Lead

Whenever the Google toggle is on, WPCode sends your Event Name to Google. Adding a Conversion Label sends a second event alongside it, a conversion event carrying that label. This label is separate from the Ads Conversion Label on the Google tab of this same page.

A click event can therefore count toward a different conversion action than your eCommerce tracking does. Our guide on finding your Google Ads tag ID covers where conversion labels come from.

Adding Multiple Click Events

You can track as many elements as you like. At the bottom of the panel, click Add New Click Event.

The Add New Click Event and Save Changes buttons below the Pixels section, with a red arrow pointing at Add New Click Event

A second set of fields appears below the first, with its own selector, event name, value, and pixels.

A second click event with its CSS Selector set to #newsletter-signup-button and its Event Name set to Subscribe

Because every click event carries its own pixel choices and event names, the events stay independent of each other. That lets you point one at a quote button for Facebook and another at a signup button for Google.

Removing a Click Event

To drop a click event you no longer need, click Remove Click Event at the bottom of that event. When the prompt appears, confirm the removal. The row disappears right away, and the removal takes effect on your site once you save.

The Remove Click Event button at the bottom of the second click event, with a red arrow pointing at it

The panel always keeps one row ready for a new event, so the first click event does not offer a Remove Click Event button. Clearing its CSS Selector is how you retire that one.

Saving Your Click Events

Your click events start working once they’re stored, so click Save Changes when you’ve finished configuring them.

The Save Changes button next to Add New Click Event, with a red arrow pointing at Save Changes

Saving also clears the page caches of the caching plugins WPCode recognizes, so your visitors get the updated tracking right away.

That’s it! Your click events are live, and every matching click is now reported to the pixels you picked. If you haven’t connected a pixel yet, our guide on finding your Facebook Pixel ID and Conversions API token walks through setting one up.

Frequently Asked Questions

Below, we’ve answered some of the most common questions about custom click tracking in WPCode.

Do I have to fill in the Event Name and Event Value?

No, the CSS Selector is the only field a click event needs. If you leave Event Name empty, pick a standard event for each pixel that offers one so those platforms still receive a recognizable event.

How many times is one click event reported on a single page?

Once per page load. If a visitor clicks a matching element again without reloading, no second event is sent, so a double-click won’t show up as two conversions.

Does WPCode add JavaScript to my pages when I’m not using click tracking?

No. The click tracking script is only added to your pages once at least one click event is saved.

What happens if the pixel isn’t loaded on the page?

WPCode checks for each platform’s tracking function before it sends anything, and it sends nothing when that function isn’t there.

Does a click on an icon inside my button still count?

Yes. WPCode checks the element that was clicked and then walks up through its parents. A click on an icon or on text inside the target still triggers the event.

Still stuck? How can we help?

Last Updated on

Get Started Today & Add Your Own Snippets

Future-proof your website with WPCode Snippets and improve the way you manage code across all your websites.