Open Google Analytics for your WordPress site. How long does it take to find "how many people read my last post"?
For many people, it takes too long. The menus change. The words are strange. And before any of this works, your site needs a cookie pop-up. Visitors who click "no" are not counted at all. So the numbers you do see are lower than the truth. Every visit that is counted is also sent to Google.
In this guide you will replace all of that with a plugin. It takes a few minutes. You will end up with a simple dashboard, no tracking cookies, and no cookie pop-up for your analytics.
We will use Privatus Analytics. Other privacy-friendly tools exist too, like Plausible, Fathom and Matomo. Look at a few if you like. The steps below are for Privatus Analytics.
What you need
- A WordPress site where you can install plugins. WordPress 6.4 or newer, and PHP 7.4 or newer.
- A free Privatus Analytics account. You get 10,000 events a month and up to 3 sites. No card is needed. An "event" is one thing that gets counted, like a page view.
Step 1: Add your site and copy the site ID
Sign in to Privatus Analytics and add your site. You will get a site ID that starts with pa_. Copy it. It is not a password. The Add a site guide shows the clicks.
Step 2: Install the plugin
- In your WordPress admin, go to Plugins, then Add New.
- Search for Privatus Analytics.
- Check the author name. It should be privatusanalytics. Anyone can upload a plugin with a similar name, so it is smart to check.
- Click Install Now, then Activate.
You can also open the plugin page directly at wordpress.org/plugins/privatus-analytics.
If you would rather not use a plugin, there is a way to paste the script into your theme. The WordPress install guide shows that way too. The plugin is easier, and it adds a few extras that I cover below.
Step 3: Paste your site ID
Go to Settings, then Privatus Analytics. Paste your site ID into the Site ID box. Click save.
That is all you must do. The plugin now adds a small script to the top of every page that visitors see. It does not add it to the admin area, to previews, or to feeds.
Step 4: Keep your own visits out
You do not want to count yourself. The plugin has a setting called Do not track roles. People who are logged in with a chosen role are not counted. Administrator is picked by default. So when you check your own site while logged in, nothing is counted.
Want to leave out editors too? Tick their role as well.
Step 5: Check that it works
Open your site in a private window, so you are not logged in. Click through two or three pages. Then look at your dashboard. You should see the visits.
If you see nothing, a caching plugin is the usual cause. Plugins such as WP Rocket, Autoptimize and LiteSpeed Cache can combine or delay scripts. Tell them to leave pa.js alone. Look in the "combine", "defer JavaScript" and "delay JavaScript" settings. Clear your cache after that. The caching troubleshooting guide has more.
Step 6: Remove Google Analytics
Now that the new tool counts visits, turn off the old one. Where it lives depends on how you added it.
- If you used a plugin like Site Kit, deactivate it.
- If you pasted a snippet into your theme or a "header and footer" plugin, delete that snippet.
- If you used Google Tag Manager for it, remove the Google Analytics tag there.
Keep your old Google data if you want it. It does not go away when you stop sending new data. Privatus Analytics can also import Google Analytics history. See the docs for that.
Step 7: Remove the cookie pop-up (if it was only for analytics)
The Privatus Analytics script does not set tracking cookies. So it does not need a pop-up of its own.
Be careful here. Other things on your site may still use cookies, like ads, chat boxes or embedded videos. If they do, you may still need a pop-up for them. Rules are also different in every country. So only remove the pop-up when analytics was the only reason for it, and check the rules where your visitors live.
Many people see a nice side effect. Without a pop-up, the page loads cleaner and nobody gets blocked from your content.
Optional: track WooCommerce sales
Do you run a shop with WooCommerce? Open the plugin settings and switch on WooCommerce: track purchases.
On the "thank you" page after an order, the plugin sends one purchase event. It includes the order total, the currency, the number of items, and whether a coupon was used.
It does not send the order number, the name, the email, or the address. The plugin also hides order numbers in page addresses, so they never show up in your reports.
Optional: let visitors opt out
Add this shortcode to any page, such as your privacy page:
[privatus_optout]
It shows a button. A visitor can click it to stop being counted. It saves one small flag in the browser to remember the choice. The plugin also adds suggested text for your privacy policy. You will find it under Settings, then Privacy, in the policy guide.
Why the numbers may look different
Do not panic if your new numbers are not the same as Google's. Three things are normal:
- Cookie pop-up visitors are back. The people who said "no" to the old pop-up are now counted.
- Bots are filtered out. Privatus Analytics checks every visit against rules for known crawlers, test tools, and servers in data centers. Those visits are left out and do not use up your event limit. The bot filtering page has the full list of rules.
- Ad blockers. Some blockers stop any analytics script. No tool can fully fix that.
So your total might go up or down. Either way, it is closer to what real people did.
What you get
- Analytics set up through the plugin, with no code
- No tracking cookies, so no cookie pop-up for this tool
- Your own admin visits left out
- Bots filtered out of the reports
- Optional WooCommerce sales tracking without personal details
- An opt-out button for visitors who want it
- A free plan with 10,000 events a month and up to 3 sites, no card needed
Try it
Make a free account at privatusanalytics.com. Start on one site. Check the pricing page if you ever grow past the free plan. The plugin code is open on GitHub.
Top comments (0)