Skip to content
Guide · Measurement

How to exclude your own visits from analytics

On a young site your own visits are some of the most frequent: you check every deploy, click every button and reload every page. Linqry gives you a per-browser off switch, path exclusions and host rules, and filters known bots for you; this guide shows how to combine them and what each one can't do.

Updated · 6 min read

What Linqry filters for you, and what you handle

Source of noiseWhat Linqry does automaticallyWhat you do
Local development on localhostNot recorded on linqry.comNothing
Staging on a subdomain, such as staging.example.comCounted, because subdomains of your domain are acceptedDon't load the tracker there
Preview deploys on another domainRejected, unless you add the host in site settingsDon't add them
You and your teamCounted like anyone elseSet the linqry_ignore flag in each browser
Admin and internal pagesCountedList them in data-exclude
End-to-end testsFiltered only when the browser's user agent says it's headless or automatedSet the flag in the test browser
Known bots, crawlers and link previewsFiltered in the browser and again on the serverNothing
Bots posing as ordinary browsersNot reliably caughtSpot them and read around them

Switch off tracking in your own browser

The tracker checks one value before it sends anything. If localStorage on your site holds linqry_ignore set to true, that browser sends nothing at all, page views and custom events included. Open your site, open the browser's developer console and run:

localStorage.setItem('linqry_ignore', 'true')

Then reload. The tracker reads the flag when it starts, so a page that was already open keeps tracking until its next full load. To be counted again, run localStorage.removeItem('linqry_ignore'). To check, localStorage.getItem('linqry_ignore') returns "true" while the switch is on. Linqry's tracker only reads this value; it never writes anything to the browser itself.

The flag is ordinary site storage, so it follows the browser's storage rules:

  • Only the exact value works. It must be the string true; setting it to 1 or yes doesn't switch tracking off.
  • It belongs to one origin. https://example.com, https://www.example.com and https://app.example.com keep separate storage, and so do the http:// and https:// versions of a host. Set the flag on each one you visit.
  • It stays in one browser. Each browser, browser profile and device needs its own flag.
  • Private windows forget it. A private or incognito window starts without the flag, and its storage is cleared when the last private window closes.
  • Clearing site data removes it. Set it again after you clear your browsing data for the site.

A one-click toggle

A bookmarklet saves opening the console. Create a bookmark with this as its address, then click it on any page of your site:

javascript:(function(){var k='linqry_ignore';if(localStorage.getItem(k)==='true'){localStorage.removeItem(k);alert('Linqry: this browser is counted again on '+location.host+'. Reload to apply.');}else{localStorage.setItem(k,'true');alert('Linqry: this browser is now ignored on '+location.host+'. Reload to apply.');}})();

On phones, where bookmarklets and consoles are awkward, a tiny script on your own site can set the flag from a link. Put it before the Linqry tag, then send teammates https://example.com/?linqry_ignore=on:

<script>
  // ?linqry_ignore=on switches Linqry off in this browser; ?linqry_ignore=off turns it back on.
  try {
    var flag = new URLSearchParams(location.search).get('linqry_ignore');
    if (flag === 'on') localStorage.setItem('linqry_ignore', 'true');
    if (flag === 'off') localStorage.removeItem('linqry_ignore');
  } catch (e) {}
</script>

Because the Linqry script loads with defer, this runs first, so even the page view of the link itself isn't counted. It's your code rather than Linqry's, and it only writes to the browser of someone who opens a link with the parameter. Anyone who discovers the parameter can opt themselves out, which affects nobody else.

Keep staging and development out

Linqry accepts browser events only from your site's registered domain, its subdomains and any additional hosts listed in site settings, and it doesn't record localhost at all. That covers local development and preview deploys on other domains. Staging on a subdomain is the gap: staging.example.com is a subdomain of example.com, so its events are accepted and mixed into your real numbers.

The fix is to load the tracker only in production. If your build has an environment flag, render the tag only when it's set. If not, check the hostname in the page before loading the script:

<script>window.linqry=window.linqry||function(){(window.linqry.q=window.linqry.q||[]).push(arguments)}</script>
<script>
  // Load Linqry only on the production hostnames.
  if (['example.com', 'www.example.com'].indexOf(location.hostname) !== -1) {
    var s = document.createElement('script');
    s.src = 'https://linqry.com/t.js';
    s.setAttribute('data-website-id', 'YOUR_SITE_ID');
    s.setAttribute('data-domain', 'example.com');
    document.head.appendChild(s);
  }
</script>

The queue stub stays on every host, so window.linqry() calls in your code never throw on staging; they're simply never sent. The opposite also works: if you do want a staging host or a second domain to report into the site, add it under Additional hosts in the site's settings.

Exclude admin and internal pages

Some pages are visited mostly by your own team: an admin area, an internal preview, a status page. List them in the tag's data-exclude attribute, separated by commas, with * matching anything:

<script defer data-website-id="YOUR_SITE_ID" data-domain="example.com" data-exclude="/admin,/admin/*,/preview" src="https://linqry.com/t.js"></script>
  • Patterns match the whole path, so /admin/* covers /admin/users but not /admin itself. List both, as above.
  • Matching is case-sensitive and ignores the query string: /preview also matches /preview?id=3, but not /Preview.
  • Everything on a matching path is skipped: page views, custom events and outbound link clicks.

Exclusion works by page and applies to everyone, so keep it for pages only your team sees. For pages your customers use too, switch off your own browser instead. In a single-page app the patterns are checked on every route change; the single-page app guide covers the details.

Your team, in production

Linqry has no setting to exclude visitors by IP address, office network or login, and because it doesn't store IP addresses, past visits can't be removed by IP either. Exclusion happens in each browser instead:

  • Ask everyone who works on the site to set the flag in the browsers they use for work, on every hostname they visit, including the app subdomain if your product lives there.
  • Put the toggle link or the bookmarklet in your onboarding notes, so new teammates switch off on their first day.
  • Dashboard access doesn't exclude anyone. Inviting someone to Linqry as an admin or viewer controls who can see your analytics; their visits to your site are counted either way until they set the flag.

Automated tests and monitors

End-to-end tests that run against production or a staging subdomain look like real visitors unless something stops them. The tracker doesn't start in browsers whose user agent mentions headless browsing, and the server drops automation tools that name themselves, but a test browser with an ordinary user agent is counted.

So set the flag before the page loads. In Playwright, an init script runs in every page of a browser context after the document is created and before the page's own scripts, so the tracker sees the flag on its first run:

// In a fixture or a beforeEach hook
test.beforeEach(async ({ context }) => {
  await context.addInitScript(() => {
    window.localStorage.setItem('linqry_ignore', 'true');
  });
});

With another runner, set the item from a hook that runs before the page's scripts. Simple uptime checks that only fetch your HTML don't run JavaScript, so they never reach Linqry, and browser-based monitors are filtered when their user agent names them.

Bots: what the filter catches

Linqry drops known bots twice. The tracker doesn't start in browsers whose user agent mentions a bot, crawler, spider, preview, headless browser, Lighthouse or PhantomJS. The server then checks every browser event against a longer list that includes search and AI crawlers, link-preview fetchers from chat and social apps, uptime monitors, automation tools and HTTP libraries such as curl. Requests with an empty or unusually long user agent are dropped as well.

Two more checks stop common spam. Browser events must come from your own hostnames, checked in the page URL and, when the browser sends one, in the request's Origin header, so scripts that post events for made-up hostnames are rejected. And each IP address can send at most 20 events per second to a site, with bursts of up to 100.

What gets through are bots that drive a real browser with an ordinary user agent. They tend to look like this:

  • A sudden spike of single-page visits from one country or city, often at odd hours.
  • One browser and operating system combination far above its usual share.
  • A jump in bounce rate, because each of those visits is a single page view.
  • An unfamiliar referrer sending many visitors who all leave after one page.

Use the dashboard filters for country, browser, OS and referrer to isolate a spike, and open a few of the visits on the Users page to confirm it. Filters narrow the view to a single value; you can't exclude a value or delete individual events, so note the spike and compare against periods without it. The bot traffic glossary entry explains the wider problem.

Check that exclusion works

  1. Set the flag and reload

    Run the command or click the toggle on your site, then reload the page.

  2. Open a few pages

    Pick pages few people visit right now, so your own activity is easy to recognise.

  3. Look at Realtime

    Open Realtime in Linqry. The live event feed shouldn't show the pages you just opened.

  4. Test the opposite

    Open the same pages in a private window, which doesn't have the flag. They should appear within seconds, which proves the tracker works and the flag is what stops it.

Frequently asked questions

Can I exclude my IP address or office network?

No. Linqry has no IP-based exclusion and doesn't store IP addresses. Set the linqry_ignore flag in each browser you and your team use; a bookmarklet or a link that sets it makes this quick.

Why do my own visits still show up after I set the flag?

Check that the value is exactly true, that you set it on the same hostname and protocol you're browsing (www and non-www are separate), that you reloaded the page afterwards, and that you're not in a private window.

Does excluding myself affect other visitors?

No. The flag lives in your own browser's storage for your site and only stops that browser from sending events.

Can I remove visits that were already counted?

Not one by one. There's no way to delete individual events, so set up exclusions before you launch or share numbers. Afterwards, filters help you read around a spike.

Sources

  1. MDN Web Docs: Window localStorage property (per origin, per protocol, private browsing) (checked Nov 14, 2026)
  2. Playwright: BrowserContext addInitScript (runs before the page's scripts, in every page of the context) (checked Nov 14, 2026)
  3. Playwright: Test fixtures (the built-in context fixture, fixtures in hooks) (checked Nov 14, 2026)

See your own funnels and revenue by channel

No card required · 30-day trial · No cookies