WordPress makes it easy to add tracking. Too easy, you could say. There is a plugin for the Meta Pixel, another one for Google, a third for TikTok, a cookie plugin on top, and maybe a Google Tag Manager container a previous agency set up. Two years later nobody knows which script measures what, which conversion counts twice, or whether the cookie banner actually blocks everything it should.
This guide shows a simpler way: one script in the head of your WordPress site that feeds every ad platform. You will learn where to add the script, how to count form leads reliably as conversions, and which WordPress-specific traps distort your data.
Why tracking in WordPress gets messy so often
The problem is rarely one broken plugin. It is the sum of them:
- One plugin per platform. Each brings its own settings, its own event names and its own updates. A plugin update can quietly rename or switch off events.
- Duplicate pixels. The Meta Pixel sits in the theme, in the pixel plugin and in the tag manager. Every page view then counts two or three times, and your campaigns optimise toward inflated numbers.
- Cookie plugin and tracking don't fit together. A consent plugin can only block scripts it knows about. Whatever another plugin loads often slips through.
- Browser only. Classic pixel plugins measure in the browser. Ad blockers, Safari and iOS swallow part of the signals before they reach Meta or TikTok.
More plugins don't fix this. Fewer moving parts do.
The goal: one script instead of five plugins
With LeadSignal, a single tracking snippet replaces the individual pixel plugins. The script captures page views, your conversions and your visitors' consent, and sends the events to the connected platforms:
- Meta: the Meta Pixel in the browser plus the Conversions API from the server, with event deduplication via a shared event ID.
- TikTok and LinkedIn: the pixel or Insight Tag in the browser plus the Events API or LinkedIn Conversions API from the server.
- Google Ads: the Google tag in the browser with Consent Mode v2 and Enhanced Conversions. LeadSignal does not currently send Google Ads conversions server-side.
It also comes with a built-in cookie banner, so you don't need a separate consent plugin. Our guide to simple conversion tracking explains how the approach works independently of your CMS.
Step 1: Clean up before you add anything new
Before the new script goes live, remove everything that already loads the same pixels. Otherwise you measure twice.
Typical candidates in WordPress:
- Pixel plugins such as PixelYourSite or the official Meta plugin for WordPress
- Google plugins that add the Google tag for Google Ads, for example Site Kit with the Ads connection enabled
- GTM plugins such as GTM4WP, if the container only holds ad pixels
- Code someone wrote straight into the theme, usually in
header.phporfunctions.php - Snippets in a "header and footer" plugin
A quick check: open your site in a private window, right-click, choose "View page source" and search for fbq(, gtag(, ttq. and _linkedin_partner_id. Every match you don't deliberately want to keep should go.
This is not just about clean numbers. The LeadSignal cookie banner only controls the scripts LeadSignal loads itself. A pixel added by another plugin loads past your banner, possibly without consent.
Feel free to keep GA4 if you use it for analysis. LeadSignal works alongside an existing GA4 setup.
Step 2: Add the script to WordPress
Copy the script from your LeadSignal dashboard. It belongs in the <head> of every page. WordPress gives you several ways to do that, from simplest to most technical:
| Option | Best for | Note |
|---|---|---|
| Code snippet plugin (e.g. WPCode) | Most sites | Add the script as "Site Wide Header". Survives theme changes and updates. |
| Theme settings | Themes with a header code field | Many themes and builders have a field like "Add code to the head", e.g. Divi under Theme Options, Integration. In Elementor Pro the feature is called "Custom Code". |
Child theme with wp_head | Developers and agencies | Cleanly versioned, but only in a child theme, never in the parent theme. |
Stay away from the parent theme's header.php: the next theme update overwrites your change and tracking disappears without warning.
After you add the script, the LeadSignal onboarding checks live whether it arrives on your site. From that moment on, page views are tracked automatically.
Step 3: Turn on the cookie banner - and keep only one
Two cookie banners on one site are bad for visitors and bad for your data. Pick one.
Option A: you use the LeadSignal banner. Adjust layout, colour and language in the dashboard, activate it and deactivate your previous consent plugin. The banner then directly controls which pixels load and sets the Consent Mode v2 signals once a Google Ads integration is configured. Use the default variant with an equally prominent "Decline" button.
Option B: you keep your existing consent plugin. Then your visitors' decision has to be passed on to LeadSignal. There is a JavaScript interface for this (leadsignal.setConsent). It is an integration task for someone who knows your consent plugin. For most small sites, option A is the easier route.
Enable the restricted consent mode in your project settings. Before marketing consent, nothing but the consent decision itself leaves the browser. It is the most cautious setting and fits best with a privacy policy that promises "only after consent". Read more in the guide to GDPR-compliant tracking.
Step 4: Measure form leads as conversions
For most WordPress sites, the submitted contact form is the most important conversion. This is also where most mistakes happen.
Good to know first: LeadSignal detects form fields like email, phone, first and last name automatically and attaches this contact data to later events. That improves matching with Meta and others. It does not create a separate "form submitted" event, though. You define the conversion itself with one of the following options.
The most reliable option: a thank-you page
Redirect to a dedicated thank-you page after submission, for example /thank-you-contact. In LeadSignal you then create a page event: "URL contains /thank-you-contact" becomes your lead event, mapped for example to the Meta standard event Lead.
Why this works so well: only people who actually submitted the form successfully see the thank-you page. Failed validations, spam aborts and double clicks don't count.
How to set up the redirect in common form plugins (exact labels may differ slightly by version):
- WPForms: Settings, Confirmations, confirmation type "Go to URL (Redirect)".
- Gravity Forms: Settings, Confirmations, type "Redirect".
- Elementor Pro forms: Actions After Submit, add "Redirect" and enter the URL.
- Contact Form 7: has no built-in redirect. Use an add-on plugin or the interface option below.
Make sure the thank-you page is not linked in your menu and ideally set to "noindex". Otherwise visitors land on it via Google and create false conversions.
Without a redirect: fire the event via the interface
If your form stays on the same page, you can trigger the conversion with JavaScript. Create a custom event in LeadSignal, for example named lead. For Contact Form 7, a short snippet added with WPCode to the footer of the form page is all you need:
<script>
document.addEventListener("wpcf7mailsent", function () {
window.leadsignal.trigger("lead");
});
</script>
wpcf7mailsent only fires when Contact Form 7 has sent the message successfully. Other form plugins have similar events, their names are in the plugin documentation.
Clicking the submit button - only as a fallback
With the visual event setup you can simply click the "Submit" button and mark it as a conversion, no code needed. For buttons like "Book a call" or "Call now" that is ideal. For forms there is a catch: the click also counts when the form was never sent because a required field was missing. For forms, prefer the thank-you page.
Step 5: Connect ad platforms and map events
Connect Meta, Google Ads, TikTok and LinkedIn in the dashboard and decide per event which platform receives it under which name. A typical setup for a service business:
| LeadSignal event | Trigger | Meta | Google Ads | TikTok |
|---|---|---|---|---|
| Lead | Page /thank-you-contact | Lead | Conversion action "Lead" | SubmitForm |
| Call booked | Page /thank-you-booking | Schedule | Conversion action "Booking" | Contact |
| Phone click | Click on phone number | Contact | Conversion action "Call" | Contact |
You can give every event a conversion value and currency, for example the average value of a lead. That helps the platforms optimise toward more valuable conversions.
Step 6: Test before you spend budget
Test with a real run: open the site in a private window, accept in the banner, submit the form, wait for the thank-you page.
- In LeadSignal: the event log shows the event with all details and the session timeline. You can see whether the lead arrived and which campaign the visitor came from.
- For Meta, TikTok and LinkedIn: use the integration's test events or connection test to check that the platform receives the event.
- For Google Ads: check the status of the conversion action and the tag diagnostics. Google often needs a few hours, sometimes longer, before new conversions show up.
Also test once with "Decline" in the banner. No ad pixel may load then.
Typical WordPress traps
Caching and optimisation plugins. WP Rocket, LiteSpeed Cache, Autoptimize or Cloudflare Rocket Loader can combine, move or delay scripts until the first user interaction. That is bad for tracking: visitors who leave quickly are never measured. Add the LeadSignal script to the exclusion lists for "delay JavaScript" and "combine JavaScript" and clear the cache afterwards.
Theme and builder changes. The visual event setup remembers an element by attributes such as text, link and position on the page. If you change the button text or rebuild the page, a click event can stop firing. Check your click events after every redesign. Page events on a thank-you page are not affected as long as the URL stays the same.
Staging sites. If your staging copy contains the same script, test clicks end up in your real campaign data. Remove the script on staging or create a separate project for it.
Redirects that drop parameters. Some redirect or language plugins strip URL parameters. Then the gclid and fbclid are missing, and Google or Meta can match the conversion to the click less well. Click one of your own ads or add ?gclid=test to the URL and check whether the parameter survives the redirect.
Conclusion
Good conversion tracking in WordPress doesn't need a collection of plugins. Clean up first, add a single script via a code snippet plugin, choose exactly one cookie banner and measure form leads through a dedicated thank-you page. With those four decisions, most WordPress sites are set up cleanly in under an hour.
You can try it on the free plan: one project, one ad platform, no credit card. All plans are on the pricing page.
