Documentation, Reference Materials, and Tutorials for WPCode
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.
To open the pixel settings, go to Code Snippets » Conversion Pixels in your WordPress admin sidebar.
![]()
The settings for each ad platform sit on their own tab. From here, click Click Tracking, the last tab in the row.
![]()
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.
![]()
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.
![]()
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.
![]()
With the click event’s own details filled in, the next step is telling WPCode which pixels should report it.
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.
![]()
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.
![]()
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.
![]()
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.
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.
![]()
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.
You can track as many elements as you like. At the bottom of the panel, click Add New Click Event.
![]()
A second set of fields appears below the first, with its own selector, event name, value, and pixels.
![]()
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.
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 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.
Your click events start working once they’re stored, so click Save Changes when you’ve finished configuring them.
![]()
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.
Below, we’ve answered some of the most common questions about custom click tracking in WPCode.
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.
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.
No. The click tracking script is only added to your pages once at least one click event is saved.
WPCode checks for each platform’s tracking function before it sends anything, and it sends nothing when that function isn’t there.
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.
Future-proof your website with WPCode Snippets and improve the way you manage code across all your websites.