Help

Troubleshooting

Fixes for a script that doesn't load, CSP errors, an install status stuck on waiting, and real visitors who get blocked.

The script doesn't load

Open the Network tab of the developer tools and reload. Look for traffic.js.

  • No request at all: the snippet isn't on this page. Check your template, theme or tag manager, and that you published the change.
  • Blocked or cancelled: an ad blocker or a privacy extension stopped it. Try a private window without extensions. See Ad blockers.
  • Refused by Content Security Policy: see CSP errors.
  • A caching or optimisation plugin rewrote it: exclude s.geoiphub.com/v1/traffic.js from combining, delaying and minifying.

CSP errors

The console shows Refused to load the script or Refused to connect. Add our hosts to your policy:

script-src https://s.geoiphub.com
connect-src https://s.geoiphub.com wss://s.geoiphub.com
worker-src blob:

Add them to the directives you already have. Don't replace your other sources. See Content Security Policy.

The status stays on Waiting for first visit

Work through these in order:

  1. The origin isn't allowed. This is the most common cause. Compare the address bar with the website's Allowed origins, exactly: https://example.com and https://www.example.com are different, a wildcard https://*.example.com doesn't match https://example.com, and ports must match (http://localhost:3000). Our edge network turns away visits from other origins with the error bad_website. See Allowed origins.
  2. The website key is wrong. Copy the snippet again from the website's Setup page.
  3. The website is disabled. Enable it on Websites.
  4. init runs before the script has loaded. You see geoiphub is not defined in the console. Call init from DOMContentLoaded (with defer) or from the script's onload, as in the snippets.
  5. The page is opened as a file. Pages opened from file:// have no origin. Serve them from a local server and allow its origin.
  6. Too many test reloads. One IP can open about 20 new sessions a minute. Wait a minute and try again.

See the bad_website error

In the Network tab, filter by s.geoiphub.com. Click the v1/c WebSocket and open Messages: an error looks like {"t":"err","code":"bad_website"}. On the HTTPS fallback, a v1/e request returns 403 with the same error.

Script loaded, but the first visit isn't scored

The decision is made about 3 seconds after the page loads. Keep the page open for a few seconds and move the mouse. If you close it at once, the visit is scored when it ends instead.

Visits after your monthly visit limit show as Not analysed.

A blocked visitor still gets in

  • The block applies from their next page load. A page that was already open stays usable.
  • The script must be on that page. Pages without it are not protected.
  • On Free, nothing is blocked. On a paid plan after a downgrade, blocks are kept but not enforced. See Plans and limits.
  • If our service didn't answer in time, the visitor was let in. Check the session: it shows no decision.
  • A client with JavaScript turned off, or one that strips the script, is never stopped. See Can bots get around it?

Real users are getting blocked

Open one of their sessions and check This visit in the Access box. It tells you which rule blocked them.

To unblock someone, see Unblock someone.

Ad blockers

Some ad blockers and privacy extensions block third-party scripts, including ours. Visits where the script didn't run are not scored and not blocked, and they don't appear in Sessions. Your page works as usual for them. Serving the script through a tag manager makes this more likely.

The score changed after the visit

That is expected. The visit is scored again when it ends, with all of its behaviour. The decision made at the start doesn't change. See Two passes.

On this page