Sites & snippet
Troubleshooting
If your site's status stays on Awaiting connection or shows Blocked, the snippet is almost always being held back by another tool on your site. The two most common causes are performance plugins and content-security policies, and both are quick to fix.
Start with a connection check
Before changing anything, open the site's Overview and choose Check now. The result tells you whether the snippet is missing, present but blocked, or unreachable, which points you straight at the fix below. See Verify your connection for what each result means.
Performance & caching plugins
Optimizers that defer, combine or minify JavaScript can stop the snippet from running in time. The adfit snippet already carries attributes that ask these tools to leave it alone (for example data-no-defer, data-no-optimize and data-cfasync="false"), but some tools need an explicit exclusion as well.
- WP Rocket: add the adfit script to Excluded JavaScript files so it isn't delayed or combined.
- Autoptimize / LiteSpeed / Cloudflare Rocket Loader: exclude the adfit script from script optimization or deferral if your status shows Blocked.
- After changing a plugin setting, clear your site's cache, then run the connection check again.
Keep the snippet in the <head>
Make sure the snippet stays in the <head> after any plugin runs. Some plugins move scripts to the footer, which can cause a flash of the original content before adfit personalizes the page.
Content-security policy (CSP)
Some sites add a content-security policy: a security header that controls which servers the browser is allowed to talk to. If your site sets one, the browser may block the snippet from connecting to adfit even though the code is installed correctly.
How to spot it
The tell-tale sign: the manual connection check says The snippet is on your page, but the status never flips to Connected on its own. That's because the server-side check can still read your page, but the automatic detection ping from the visitor's browser is being blocked by your policy.
How to fix it
Allow the adfit snippet host, cdn.adfit.io (the same host shown in your embed code's preconnect line), in your policy. You need it in two directives:
script-src: so the browser can load the snippet.connect-src: so the snippet can send adfit its signal and personalize the page.
Allow the inline bootstrap
The embed code also contains one tiny inline script: the bootstrap that prevents a flash of your original content before adfit personalizes the page. If your policy doesn't allow inline scripts (no unsafe-inline), add adfit's bootstrap hash to script-src. The same hash works for every site:
sha256-NjfKR7RRnyNsRD/jESyiZSiaj8py8awVmAx1L68Zs0Q=Putting it together, a policy that allows adfit looks like this (add these hosts and the hash to your existing directives; don't replace your whole policy):
script-src 'self' https://cdn.adfit.io 'sha256-NjfKR7RRnyNsRD/jESyiZSiaj8py8awVmAx1L68Zs0Q=';
connect-src 'self' https://cdn.adfit.io;If a flash of original content comes back
This hash covers the current snippet. If adfit ships an update that changes the bootstrap, the hash changes with it. If you pinned the hash in a strict policy and a brief flash of your original content reappears after an update, copy the current value from this page into your script-src again. Sites that allow inline scripts don't need to do anything.
Personalizing images from other domains
If your personalizations swap in images hosted somewhere other than your own site, also allow those image hosts in your img-src directive so the browser can load them.
Without the whitelist, only the manual check works
If you can't add cdn.adfit.io to connect-src right away, automatic detection won't work and you'll need to rely on the manual connection check. Whitelisting the host restores automatic detection and live personalization.
Still stuck?
If the snippet is installed in the <head>, excluded from your performance plugins, and the adfit host is whitelisted in your CSP, but the status still won't connect, get in touch through the support channel on your plan. See Plans & pricing for what's included.