Pageviews counted twice
Find and fix the causes of double pageviews, from a second copy of the snippet to history changes your app makes.
If your pageviews look about twice as high as you expect, or the Pages panel shows two pageviews for every visit, something on your site is sending more than one pageview per page. This page shows how to confirm it and fix each cause.
Confirm it
Watch the requests
Open your site, open DevTools → Network, filter for collect and reload the page once.
Count the pageviews
Click each collect request and check its Payload. A single page load should send exactly one request with "event_type":"pageview". Requests with "event_type":"custom" or "event_type":"session_end" are normal and don't count as pageviews.
Navigate once
If your site is a single-page app, click one internal link. That should send one more pageview, not two.
Two copies of the snippet
This is the most common cause. View the page source and search for muro.js. If it appears twice, every page load and every navigation is sent twice.
It often happens when the snippet is added in two places, for example:
- in your layout and again in a page template;
- hard-coded and also through a tag manager;
- in a site builder's site-wide custom code and again in page-level custom code;
- in a Shopify theme twice, or in
theme.liquidand in a section.
Remove one copy. If the two copies have different project IDs, both send to the project in the first tag, so removing one also fixes that.
Your app pushes history entries without navigating
Muro sends a pageview whenever your app calls history.pushState, and when the visitor goes back or forward. That's how single-page-app navigation is tracked. If your app also calls pushState for things that aren't page changes, each one counts as a pageview. Common examples:
- updating the URL as someone types in a search box or changes filters;
- opening a modal or a tab that adds a history entry;
- a router that pushes the same URL twice on one navigation.
To fix it, use history.replaceState (or your router's "replace" option, such as router.replace() in Next.js) for URL updates that aren't real page changes. Muro ignores replaceState on purpose, which is also why framework hydration doesn't cause doubles.
In-page anchor links
Clicking a link to a section on the same page, such as <a href="#pricing">, makes most browsers fire a history event. Muro then records another pageview of the same path. If a page has a table of contents or "jump to" links, you may see extra pageviews for it. Hash routers behave the same way.
If this matters for a page, use buttons that scroll with JavaScript (for example element.scrollIntoView()) instead of # links.
Calling track('pageview') yourself
You don't need to send pageviews by hand. Muro does it automatically. window.muro.track('pageview') doesn't create a second pageview, though: it sends a custom event named pageview, which shows up in the Custom Events panel. Remove the call so that panel stays clean.
Verify it works
- Reload a page with DevTools open and the filter set to
collect. You see exactly one request with"event_type":"pageview". - Click one internal link in your app. You see exactly one more.
- Set the dashboard time range to Live and check that one visit adds one pageview.
Pageviews recorded before the fix stay in your reports. Compare periods after the fix to see the true numbers.