Count pageviews with LopeBase
Add one tag to a site and LopeBase counts its pageviews, visits, pages, and sources itself, with no cookies and no visitor ids.
You do not need PostHog, Google Analytics, or Plausible to see pageviews in LopeBase. One tag, and LopeBase counts them itself: pages, visit sources, and visits, with no cookies and no visitor id, working alongside anything else you already have connected.
Add the tag
-
Open Analytics
Under "Pageviews counted by LopeBase" for a property with no hits yet, copy its tag.
Open Analytics -
Add it to your site
Put the tag once in the layout every page shares, inside
<head>, however your framework does that:app/layout.tsxfor Next.js's app router,pages/_document.tsxfor its pages router, the shared layout for Astro,src/app.htmlfor SvelteKit, and so on. There is also a ready-made prompt for your coding agent to do this for you. -
Deploy and check
Numbers show on Analytics within a minute of the first visit after you deploy.
The tag looks like this, with your property's own key: <script defer src="https://app.lopebase.com/lb.js" data-site="your-site-key"></script>
How it counts
Each page load sends one hit, and so does every page change inside a single-page app, without a full reload. The visit's source (a search engine, a link, or a UTM parameter) is kept only in that browser tab's sessionStorage for the rest of the visit, never in a cookie, and no visitor id is ever set. Hits are only accepted from the property's own site address, using a key that names the property but carries no secret.
Because there is no cookie and nothing to consent to, pageviews counted this way need no cookie banner, and the ad blockers that hide other analytics tools rarely block it.
What you see
Once hits arrive, Analytics shows pageviews and visits over the last 30 days, pages per visit, your top traffic source, a daily chart, and breakdowns of top pages and sources, the same shape as any other analytics source LopeBase reads.
With or without the adapter
Pageviews work whether or not a property has the LopeBase Adapter installed. With both, LopeBase can show which pages and sources bring in the signups your adapter reports from your own database.
Where to go next
- Connect your tools for PostHog, Google Analytics, or Plausible if you already use one of them.
- Analytics for everything else the page shows.
- Install the LopeBase Adapter to pair pageviews with your own signups.
If something goes wrong
Something else? Contact us.
No numbers show up after adding the tag
Check that the tag is on every page, inside the shared layout rather than just one page, and that you deployed after adding it. It can take a minute after the first real visit for numbers to appear.
Add LopeBase's site address on the property first
The property needs a site address before LopeBase can issue it a tag. Add one on the property's own page, then come back to Analytics.
Will this need a cookie banner?
No. It sets no cookie and no visitor id, so there is nothing that needs consent.
Can I use this alongside PostHog or Google Analytics?
Yes. It runs independently of any other analytics connection; Analytics shows each source's numbers in its own row.