# 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.

Source: https://datacenter.so/track/wordpress
By the Datacenter team. Updated October 31, 2026.

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 Datacenter on WordPress

1. In Datacenter, add your site's address and copy the tag from **Set up your site**.
2. In your WordPress admin, go to **Plugins**, then **Add New Plugin**, search for **WPCode**, and click **Install Now**, then **Activate**.
3. Go to **Code Snippets**, then **Header & Footer**.
4. Paste the tag into the **Header** box and save.
5. Clear your cache plugin and any CDN cache, then click **Check my site** in Datacenter.

Any plugin or theme setting that adds code to the head works the same way. The [WordPress install guide](https://datacenter.so/docs/install-wordpress) 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 `datacenter.so/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 Datacenter, turn on **Add people from sign-ups and forms** 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. New sites have it on already. Forms sent by script count from a press of their submit button; press **Test it** to check yours.

**WooCommerce.** Two ways to count sales:

- The [Datacenter WordPress plugin](https://datacenter.so/docs/install-wordpress) counts each order on the order received page.
- WooCommerce's own order webhook sends every paid order and refund from your store's server, whatever the gateway. Click **Connect** next to WooCommerce on the Integrations tab, then paste the address and secret into a new webhook in WooCommerce ([how to connect it](https://datacenter.so/docs/checkout-orders#woocommerce)). Counting orders is on paid plans.

The plugin's count misses buyers who block scripts or close the tab before the page loads. The webhook does not.

## Performance

A tracking script should never block the page from rendering. Datacenter'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 Datacenter need a cookie banner on WordPress?

Private mode, the default, sets no cookies and stores nothing on the device. Read [cookieless analytics and GDPR](https://datacenter.so/guides/cookieless-analytics-gdpr) for what that means where your visitors are.

## Sources

- WordPress plugin directory: [WPCode](https://wordpress.org/plugins/insert-headers-and-footers/). Checked October 2026.

## Where Datacenter fits

On WordPress, Datacenter is one line in your header, under 1.5 KB gzipped, with no cookies in Private mode, and its form capture can turn contact form sends into goals without code. More: https://datacenter.so/docs/install-wordpress
