Product
Solutions
Compare
Resources
Get early access Talk to us
Analytics

Best WordPress tracking code manager tools, and how to add tags safely

A WordPress tracking code manager is a plugin or tool that keeps tags like the Google tag, a Google Tag Manager container and the Meta Pixel in one list, prints each one where its vendor says it belongs and takes it off again cleanly. A free header and footer plugin covers one site; for many sites, WPCentrify, a hosted WordPress management platform for anyone responsible for more than one WordPress site, adds WordPress code snippets to every site from one dashboard.

Diagram of where each tracking tag goes on a WordPress page. Inside the head, through the wp_head hook, the Google tag for GA4 and Google Ads, the Google Tag Manager script, the Meta Pixel, Microsoft Clarity and the TikTok Pixel. Just after the opening body tag, through wp_body_open, the Tag Manager noscript part. Just before the closing body tag, through wp_footer, the LinkedIn Insight Tag.
Where six common tags go, from each vendor's own install instructions, and the WordPress hook for each spot. Facts checked 10 October 2026.

The short answer

A WordPress tracking code manager is a plugin or tool that stores your tracking tags in one place and prints each one in the head, just after the opening body tag or in the footer, without editing theme files. Use one manager per site, add each tag only once, make it wait for consent where the law requires it, and check that it fires.

Our quick picks, from facts on each vendor's own pages:

  • Best free all-rounder: WPCode, with head, body and footer spots in the free version.
  • Best for per-page rules: Header Footer Code Manager.
  • Best for store conversion pixels: Tracking Code Manager.
  • Lightest free option: Head & Footer Code.
  • Best for Google tags only: Site Kit by Google, Google's own free plugin.
  • Best for Google Tag Manager: GTM4WP, free.
  • Best for the Meta Pixel: PixelYourSite, with the Conversions API in the free version.
  • Best for many sites: WPCentrify (our product), one dashboard for the tags on every site.

What is a WordPress tracking code manager?

A WordPress tracking code manager is a plugin or tool that holds every third-party tag on a site in one list and prints each one in the right spot, on every page or only on the pages you choose.

Without one, tags get pasted wherever was quickest: header.php, a page builder's code box, a theme options screen. Code in a theme's files is overwritten when the theme updates, and a year later nobody can say what runs where.

Which tracking codes do WordPress sites use?

The common ones are analytics and ad tags: the Google tag (gtag.js) for Google Analytics 4 and Google Ads, a Google Tag Manager container, the Meta Pixel, the LinkedIn Insight Tag, Microsoft Clarity for heatmaps and session recordings, the TikTok Pixel, and verification meta tags that prove you own the site. A GA4 measurement ID starts with "G-" and a Tag Manager container ID with "GTM".

If a tutorial gives you a code starting with "UA-", it is out of date: Google says standard Universal Analytics properties stopped processing data on July 1, 2023. Page titles and meta descriptions are not tracking code either. They belong in your SEO plugin or in on-page SEO management, and our guide to SEO tags in WordPress explains the difference.

Where does each tracking code go?

Each vendor says where its code belongs, and WordPress has a hook for each spot: wp_head for the head, wp_body_open for just after the opening body tag, and wp_footer for just before the closing body tag.

Where each tracking tag goes on a WordPress page
TagWhere the vendor says it goesWordPress hook
Google tag (GA4, Google Ads)Immediately after the opening <head> tagwp_head
Tag Manager, scriptAs high in the <head> as possiblewp_head
Tag Manager, noscriptImmediately after the opening <body> tagwp_body_open
Meta PixelBetween the <head> tags, on every pagewp_head
Microsoft ClarityIn the <head> sectionwp_head
TikTok PixelAt the top of the header sectionwp_head
LinkedIn Insight TagRight before the end of the <body>, in the global footerwp_footer

From each vendor's own install instructions, checked 10 October 2026.

The wp_body_open hook arrived in WordPress 5.2 and only prints code if your theme calls it, so check the page source after adding body code. If it does not, GTM4WP can print Tag Manager's noscript part in the footer instead, which works but is not the recommended way.

6 ways to add tracking code to WordPress

Pick the way that matches how many tags and sites you have:

  1. A header and footer code plugin, with a head, body and footer box. It suits most single sites.
  2. Site Kit by Google, which places Google's own tags with nothing to paste.
  3. Google Tag Manager, printed by a plugin such as GTM4WP, with the tags managed in Tag Manager.
  4. Your theme's settings. Quick, but the code stops printing if you switch themes.
  5. A child theme, with your code hooked to wp_head and wp_body_open, as below.
  6. A platform for many sites, which adds, checks and removes the same tag everywhere.
// In your child theme's functions.php
add_action( 'wp_head', function () {
    ?>
    <!-- Paste the vendor's head code here -->
    <?php
}, 1 );

add_action( 'wp_body_open', function () {
    ?>
    <!-- Paste code that must follow the opening body tag here -->
    <?php
} );

The 1 makes your head code print early, which suits Tag Manager's "as high as possible". Never paste tags into a parent theme's header.php: the next theme update overwrites the file.

How to add a tracking tag with a header and footer plugin

For a single site, add any tag in this order:

  1. Get the code from the vendor. Copy the snippet or ID from the vendor's setup screen and note which part goes where.
  2. Check what is already there. Look in the page source or Google Tag Assistant for the same ID, so you do not add it twice.
  3. Use one tracking code manager. One header and footer plugin per site keeps every tag in one list.
  4. Paste each part where the vendor says. Head code in the head box, body code in the body box and footer code in the footer box.
  5. Wait for consent where the law requires it. Connect analytics and ad tags to your cookie banner so they run only after a yes.
  6. Clear your caches. Clear the page cache and any CDN cache so visitors get the new code.
  7. Check that it fires. Use Google Tag Assistant, Meta Ads Data Advisor or your browser's Network tab.
  8. Write it down. Add the tag, the person who asked for it and a review date to your tag register.

WordPress tracking code manager tools at a glance

WordPress tracking code manager tools compared
ToolAdds tags toFree versionPaid fromActive installsLast updated
WPCodeHead, body, footerYes (WPCode Lite)$49 a year for 1 site, introductory price3+ million8 Oct 2026
Header Footer Code ManagerHead, footer, content; body in ProYes$35 a year for 1 site600,000+15 Jul 2026
Tracking Code ManagerHead or body; store conversion pagesYes, 6 locationsNot shown on the vendor's page90,000+20 Aug 2026
Head & Footer CodeHead, body, footer; per post and categoryYesNone listed100,000+31 Aug 2026
Site Kit by GoogleGoogle tag, Tag Manager containerYesNo paid plan5+ million5 Oct 2026
GTM4WPTag Manager container and data layerYesNo paid plan700,000+1 Oct 2026
PixelYourSiteMeta Pixel, GA4, Tag Manager, any scriptYes$199 a year for 1 site400,000+27 Sep 2026
WPCentrifyHead, body, footer, on one site or manyFree during early accessAnnounced at launchPlatform, not a pluginNot applicable

"Body" means just after the opening body tag. Installs and update dates from WordPress.org, features and prices from each vendor's site, all checked 10 October 2026. Prices exclude tax. Disclosure: WPCentrify is our product, and we use no affiliate links.

The 8 tools, one by one

1. WPCode: best free all-rounder

WPCode, formerly Insert Headers and Footers, has 3+ million active installs. Its free version, WPCode Lite, has site-wide Header, Body and Footer locations, and it also runs PHP, CSS and JavaScript snippets. WPCode Pro adds page-specific snippets and code revisions from $49 a year for one site, an introductory price; that plan is normally $99.

Watch out for: it runs PHP too, so limit who can use it.

Header Footer Code Manager, from DraftPress, adds snippets to the head, the footer, or the top or bottom of the content, site-wide or on chosen posts, pages, categories or post types, on desktop, mobile or both. The spot just after the opening body tag is a Pro feature, from $35 a year for one site. It is tested up to WordPress 7.0.7; the current release is 7.1.3.

Watch out for: Tag Manager's noscript part needs Pro.

3. Tracking Code Manager: best for store conversion pixels

Tracking Code Manager, from Data443, is the plugin named after this job. It keeps tracking codes in one list, places them in the head or body on the whole site or chosen pages, and detects WooCommerce, Easy Digital Downloads and WP eCommerce so a conversion pixel fires after a sale. The free version has six slots, which its FAQ describes as six locations with unlimited codes. It is tested up to WordPress 7.0.7.

Watch out for: the premium price did not load on the vendor's page when we checked, so ask before you buy.

Head & Footer Code prints code in the head, just after the opening body tag and just before the closing body tag, through WordPress's own wp_head, wp_body_open and wp_footer hooks. You can add site-wide code, code per post or page that adds to or replaces it, and code per category. Its WordPress.org page lists no paid version.

Watch out for: targeting is by post, page and category; Header Footer Code Manager adds device rules.

5. Site Kit by Google: best for Google tags only

Site Kit is Google's official free plugin, with 5+ million active installs. Connect your Google account and it can place the Google tag for Analytics on every page and, with a toggle, the Tag Manager container, and it shows your Google data in WordPress. It tells you during setup if it finds an Analytics snippet already on the site. Its consent mode works with the WP Consent API plugin and a consent plugin.

Watch out for: the Meta Pixel and LinkedIn tag still need another tool.

6. GTM4WP: best for Google Tag Manager

GTM4WP is a free plugin that prints the Google Tag Manager container and fills its data layer with page, visitor and WooCommerce data, so tags can fire on the right pages and events. It can also block tag types such as custom HTML, an option its description suggests in case the Google account behind your container is ever compromised. It needs PHP 8.0 and WordPress 6.3.

Watch out for: some data options, such as the visitor's IP address, need explicit consent first, as the plugin itself says.

7. PixelYourSite: best for the Meta Pixel

PixelYourSite's free version installs the Meta Pixel with the Conversions API, GA4 and Google Tag Manager, sends WooCommerce and Easy Digital Downloads events automatically and works with popular consent plugins. Pro adds Google Ads and TikTok tags from $199 a year for one site. If you only need Meta, Meta's own free plugin, Meta pixel for WordPress, also adds the Pixel with the Conversions API.

Watch out for: make it the only thing adding the Pixel and GA4, or visits are counted twice.

8. WPCentrify: best for tags across many sites

WPCentrify is our product (disclosure) and a platform, not a plugin. It adds tracking tags, custom CSS or a script to one website or forty from one dashboard, through the connector each site already runs, so there is no second plugin. A read-only scan shows the tracking code each site already carries, including tags hardcoded into a theme, and the editor warns you if you paste a tag the site already serves. A shared snippet updates every copy when you edit it and comes off every site in one press, and each site reports whether it actually printed the code.

Snippets sit in the same WordPress website management platform as updates, backups, uptime and security; read more about adding code snippets to multiple WordPress sites.

Watch out for: it delivers your code but does not write tags or offer a snippet library, and body placement needs a theme that calls wp_body_open. It is free during early access, with prices announced at launch.

One Tag Manager container or separate tags?

Use separate tags when you have two or three that rarely change, and one Google Tag Manager container when you run many tags or other people change them often.

  • Separate tags stay visible in WordPress, but every change means editing the site.
  • One container lets marketers change tags in Tag Manager without touching WordPress.
  • Guard the login. Whoever can publish in Tag Manager can add code to every page.
  • Never both. The same GA4 tag in the container and in a header plugin sends every page view twice.

In the EU and the UK, most tracking tags need the visitor's consent before they run, because they store or read information on the visitor's device.

The EU's ePrivacy Directive allows that only with consent, apart from narrow exceptions such as what is strictly necessary for a service the visitor asked for. The UK regulator, the ICO, says you cannot set non-essential cookies on your homepage before the user has consented, and it is revising its cookie guidance. This is not legal advice.

In practice, put a consent banner in front of analytics and ad tags and make them wait for it; Site Kit, PixelYourSite and GTM4WP all work with consent plugins. Our guide to the best cookie consent plugins for WordPress compares banners for one site, and cookie consent for multiple WordPress sites covers handling consent across many.

Do tracking codes slow down WordPress?

They can: every tag is JavaScript that downloads and runs on your visitor's device, so each extra tag adds work and a duplicate doubles it.

  • Keep async loading. Google's tag loads gtag.js with the async attribute, so the page keeps building while it downloads.
  • Remove duplicates and dead tags, such as old pixels and Universal Analytics code.
  • Delay what can wait, such as chat widgets and heatmaps.
  • Use defer for your own scripts. WordPress has supported async and defer when registering scripts since version 6.3.

Our guide on how to improve Core Web Vitals on WordPress goes deeper. If you manage several sites, Core Web Vitals monitoring in WPCentrify tracks PageSpeed and Core Web Vitals across all of them, so you can see whether a page slowed after a new tag.

How do you check that a tracking code is working?

Load the page as a visitor would and use the vendor's own checker, or your browser's Network tab for any tag.

  • Google Tag Assistant. At tagassistant.google.com, enter your site's address, find your tag among the detected tags and look for events in the Summary tab.
  • Meta Ads Data Advisor. Meta's free Chrome extension, formerly called Meta Pixel Helper, lists the Pixels on a page, the events they fired and any errors.
  • TikTok Pixel Helper. TikTok's Chrome extension does the same for its pixel.
  • The Network tab. Filter by the vendor's domain. For Clarity, Microsoft says to look for POST requests to clarity.ms/collect.
  • The page source. Search for your ID; two copies means double counting.

Test in a private window after clearing your caches, accept the cookie banner first, and pause ad blockers, which can hide a working tag.

Keep a register of your tags, and remove old ones

A tag register is a short list of every tag on a site, so anyone can see what runs, why, and when it can go. A spreadsheet is enough: the tag and its ID, its purpose, who asked for it, where it is printed, its consent category and a review date.

Review it every few months and remove pixels for ad accounts you no longer use, tags from finished campaigns and old Universal Analytics code. Header Footer Code Manager logs who added and edited each snippet, and WPCentrify writes every snippet change to its WordPress activity log.

Managing tracking codes across many WordPress sites

Across many sites, the hard part is not adding a tag; it is knowing what already runs where, and removing a tag everywhere when it has to go.

Use one tool and one register for every site, check for existing tags before you add a shared one, and remove a retired tag from every site at once.

WPCentrify (our product, entry 8 above) was built for this: one dashboard that shows what each site already carries, adds a tag to many sites and takes it off them all in one press. If all you need is visitor numbers, its cookieless analytics for WordPress counts visitors, page views and traffic sources without setting a cookie, and our guide on how to check website traffic on WordPress compares the other ways.

Sources

All sources checked on 10 October 2026.

Answers

Questions about WordPress tracking code managers

For one site, WPCode is the best free all-rounder, Header Footer Code Manager suits per-page rules and Head & Footer Code is the lightest. Use Site Kit by Google for Google tags only, GTM4WP for Google Tag Manager and PixelYourSite for the Meta Pixel. For many sites, WPCentrify manages tags across every site from one dashboard.

Use a child theme: hook a small function to wp_head for head code and to wp_body_open for code that follows the opening body tag. Do not edit a parent theme's header.php, because the next theme update overwrites it.

Copy your GA4 measurement ID, which starts with G-, then connect Site Kit by Google or paste Google's tag into the head box of a header and footer plugin. Add it only once, and check it with Google Tag Assistant.

Paste the Pixel base code into the head of every page with a header and footer plugin, as Meta recommends, or use PixelYourSite or Meta's own Meta pixel for WordPress plugin. Check it with Meta Ads Data Advisor, formerly Meta Pixel Helper.

Wherever the vendor says. The Google tag, Meta Pixel, Microsoft Clarity, TikTok Pixel and Tag Manager's script go in the head, Tag Manager's noscript part right after the opening body tag, and LinkedIn's Insight Tag right before the end of the body.

In the EU and the UK, most do, because they store or read information on the visitor's device, which needs consent unless it is strictly necessary. Use a consent banner and make analytics and ad tags wait for it. This is not legal advice.

They can, because each tag is JavaScript that runs on your visitors' devices. Keep the async loading in each vendor's snippet, remove duplicate and unused tags, delay chat widgets and heatmaps, and check your Core Web Vitals after each change.

Use Google Tag Assistant for Google tags, Meta Ads Data Advisor for the Meta Pixel and TikTok Pixel Helper for TikTok, or watch your browser's Network tab for requests to the vendor. Test in a private window after clearing your caches.

Usually because the Google tag is on the page twice, for example from a plugin and from the theme or a Tag Manager container. Search the page source for your measurement ID and remove the extra copy.

Use one tool and one tag register for every site. WPCentrify, our product, adds the same tag to many sites from one dashboard, shows what each site already runs before you add more, and removes a tag from every site in one press.

Early access

Manage tracking tags on every WordPress site you run

Add tags to one site or forty, see what each site already runs before you add more, and take a tag off every site in one press.

Free during early access. No credit card required.