WordPress analytics without cookies: add LightMetrica in 2 minutes
WordPress doesn't come with visitor statistics, so most site owners add Google Analytics or a heavy stats plugin. If you just want to know how many people visit, where they come from and which posts they read — without cookies or a slower site — LightMetrica takes a couple of minutes to set up.
What you need
- A free LightMetrica account — sign up and add your site's domain.
- The tracking code from your counter settings. It looks like this:
<script defer src="https://lightmetrica.com/lm.js" data-site="YOUR_ID"></script>
Option 1: a header plugin (recommended)
This works with any theme, including block themes, and survives theme updates.
- In the WordPress admin, go to Plugins → Add New and install WPCode (or any "Header and Footer" plugin).
- Open Code Snippets → Header & Footer.
- Paste the LightMetrica code into the Header field.
- Click Save Changes.
Option 2: the theme
If you use a classic theme with a header.php file, you can paste the code just before </head>. Use a child theme,
otherwise a theme update will remove it. With block themes there's no header.php, so use the plugin option.
Check that it works
Open your site in another browser or on your phone, then open the Real-time report in LightMetrica. The visit appears within seconds. If it doesn't, clear the cache of your caching plugin (WP Rocket, LiteSpeed Cache, W3 Total Cache and others) and the CDN, then reload the page.
To keep your own visits out of the stats, open your site once with ?lightmetric=ignore at the end of the address.
What you'll see
- Visits, visitors, page views, bounce rate and time on site.
- Which posts and pages are read most, and how far people scroll.
- Sources: search engines, social networks, messengers, AI assistants like ChatGPT, other sites.
- Goals without setup: clicks on phone numbers, email links, messenger links, file downloads and outbound links.
- A weekly AI Smart Report with one to three recommendations.
FAQ
Does LightMetrica slow down WordPress?
No noticeably — the script is about 2 KB and loads with defer.
Do I need a cookie banner for it? LightMetrica doesn't set cookies. Whether you need a banner depends on the other tools on your site and your jurisdiction — this isn't legal advice.
Can I track contact form submissions?
Add the data-lm-goal="Lead" attribute to the submit button, or call lightmetric('goal', 'Lead') from your form
plugin's success hook.
Try LightMetrica — free
Lightweight, independent, cookie-free analytics: the counter installs in a minute — on its own or next to your current tools. Every week — an AI-powered Smart Report: what changed and what to do next.