How to track a WordPress site without slowing it down
WordPress has no analytics of its own. How to add a light tracking tag with a header plugin, avoid cache problems, and count forms and WooCommerce sales.
On this page
WordPress itself counts nothing. Analytics comes from a plugin or a script you add: Jetpack Stats, a GA4 plugin, Site Kit, or a tag pasted into the header. Each adds weight, and some add a lot: a full analytics plugin can load its own settings screens, database tables and several scripts on every page.
The lightest setup is a single script tag in the page head, added through a small header plugin you probably need anyway.
Install Sporetag on WordPress
- In Sporetag, add your site's address and copy the tag from Set up your site.
- In your WordPress admin, go to Plugins, then Add New Plugin, search for WPCode, and click Install Now, then Activate.
- Go to Code Snippets, then Header & Footer.
- Paste the tag into the Header box and save.
- Clear your cache plugin and any CDN cache, then click Check my site in Sporetag.
Any plugin or theme setting that adds code to the head works the same way. The WordPress install guide covers the details. On WordPress.com, adding plugins may need a paid plan.
The cache problem
Most "the tag is not there" reports on WordPress are caching. A page cache, an optimization plugin or a CDN keeps serving the old HTML without the tag. Clear every layer after adding it.
Optimization plugins that combine or delay scripts can also change the tag. If visits do not appear, exclude sporetag.com/s.js from script combining and delaying, and check that the data-site attribute is still on the tag in the page source.
Count what matters: forms and sales
Contact forms. Most WordPress leads come through a form plugin. In Sporetag, turn on Capture emails from my forms automatically on the Profiles tab (90-day tracking): when a form with an email or phone field is sent, it counts a "Form sent" event and adds the person to their profile. It never reads password, card or hidden fields. Forms that send without a normal submit may not be seen; press Test it to check yours. For those, the identify call does the same job in code.
WooCommerce. Sporetag has no WooCommerce connector. Two ways to count sales today:
- If WooCommerce takes payments through a Stripe account you own, the Stripe connector reads those payments on paid plans.
- Otherwise, send each paid order from your server with the Events API, with the order id so it counts once.
A WooCommerce thank-you page script also works, but it misses buyers who block scripts or close the tab before it loads.
Performance
A tracking script should never block the page from rendering. Sporetag's tag uses defer, so the browser loads it after the HTML is parsed. Avoid installing several analytics plugins at once: each adds its own scripts, and two tools tracking the same page gives you two sets of numbers that will never match.
Common questions
Does WordPress have built-in analytics?
No. WordPress.com sites have stats through Jetpack. Self-hosted WordPress needs a plugin or a script.
Do I need a plugin to add analytics to WordPress?
You need some way to add code to the head of every page. A small header and footer plugin is the safest, because theme edits are lost when the theme updates.
Why is my tracking code not working on WordPress?
Usually a cache serving old pages, or an optimization plugin that delays or rewrites scripts. Clear the cache and view the page source to confirm the tag is there.
Does Sporetag need a cookie banner on WordPress?
Private mode, the default, sets no cookies and stores nothing on the device. Read cookieless analytics and GDPR for what that means where your visitors are.
Sources
- WordPress plugin directory: WPCode. Checked October 2026.
Spotted something wrong or out of date? Email hello@sporetag.com and we will fix it.