If WordPress is only your editor and another site shows the pages to readers, Vireo can count that front end. Each pageview is matched to the WordPress post it shows, so Top pages, per-post stats and Search Console per post work as they do for a theme. It’s free for one front end.
Set it up
- Go to Vireo Analytics, Settings, Tracking, Headless front end.
- Enter the “Front-end site address”: the address readers see in their browser, including
https://. - Click “Save settings”.
- Copy the tag shown under “Add to the front end” and paste it before
</body>on every page of the front end.
The tag looks like this, with your own addresses in it:
<script defer src="https://cms.example.com/wp-content/plugins/vireo-analytics/assets/js/tracker.js" data-endpoint="https://cms.example.com/..."></script>
Always copy it from the settings screen. The endpoint address depends on your host, and the screen names the one in use.
Pageviews sent from any other address are refused, so the tag records nothing if it’s pasted somewhere else.
How pages are matched to posts
By path. A front end that keeps the WordPress permalink structure needs nothing else: /my-post/ on the front end counts for the post at /my-post/ in WordPress.
If your paths differ, add the post ID to each page:
<meta name="vireo:post-id" content="123">
Anything else can be mapped in PHP with the vireo_headless_post_id filter.
Single-page apps
- Astro view transitions are counted on their own.
- For any other front end that changes pages without reloading, add
data-spa="history"to the tag. EachpushStateand back or forward navigation then counts as a pageview. - If your router does its own thing, call
vireo('pageview')after each new page has rendered.
What it can’t see
- Crawlers and AI bots are counted when they request a page from WordPress. Requests they make to the front end never reach WordPress, so the crawler figures cover WordPress only. Your front-end host’s logs have the rest.
- Core Web Vitals aren’t collected from the front end yet.
- Connect Search Console for the front-end address, since that’s the site Google indexes.
More than one front end
The headless setting takes one address. To count other sites with their own numbers, use connected sites. A developer can allow more origins for the headless tag with the vireo_headless_allowed_origins filter.