Skip to main content
Installation Guide

Installing the Consently banners

Where the snippets go, what your own website can do to block them, and the fix for each.

Consently has two banners: the cookie banner (widget.js) and the DPDPA consent banner (dpdpa-widget.js). Your dashboard calls them widgets. Each is one script tag that you copy from your dashboard. Most websites need nothing more. Sites with strict security settings, script optimisers or heavy custom scripts sometimes block the banners without showing any error on the page. This guide lists each cause we know of and how to fix it.

1. First check: the browser console

If a banner does not appear, or appears broken, the browser console almost always says why.

  • Open your website in a private (incognito) window, so no earlier choice hides the banner.
  • Open the console: right-click the page, choose Inspect, then the Console tab.
  • Reload the page and look for red lines that mention consently.in or start with [Consently.
The console saysWhat it means
Refused to connect to https://www.consently.in/…Your Content Security Policy blocks the banner from loading its settings. Add the connect-src entry above.
Refused to load the script …consently.in…script-src does not allow our scripts. Add the script-src entry above.
Refused to apply a stylesheet … style-srcstyle-src blocks the banner styles, so it appears unstyled or broken. See the style-src note.
Refused to load the image …supabase.co…img-src blocks your uploaded logo or icon. Add the img-src entry above.
Refused to frame https://www.consently.in/frame-src blocks the Privacy Centre. Add the frame-src entry above.
[Consently DPDPA] Failed to load configuration, or [Consently] Failed to load configThe banner could not reach Consently. Look at the line just above it: it is usually one of the "Refused to connect" lines.
net::ERR_BLOCKED_BY_CLIENTAn ad blocker or privacy extension in this browser blocked the request. Test again in a private window with extensions turned off.

2. Where to put the snippets

Cookie banner

  • Paste it as the first script inside <head>, above Google Analytics, Tag Manager and any pixels. It has to run before them to hold them back until the visitor agrees.
  • Keep it as given: no async or defer.
  • Do not load it through Google Tag Manager. Tag Manager runs too late to hold back tags it does not control.

DPDPA consent banner

  • Paste it before </body>, or in <head>. Keep the defer it comes with.
  • On single-page apps (React, Next.js, Vue), load it once in the main HTML file or root layout, not inside a component that mounts again on every page.

Always load the banners from consently.in

Do not download the script files to your own server or CDN. A copied file never receives our fixes and stays on the version you copied. The snippet from your dashboard always loads the current version from https://www.consently.in.

3. Content Security Policy

A Content Security Policy (CSP) is a header your website sends that lists what the browser may load. It is common on bank, fintech and enterprise sites. If yours exists, it must allow the banners. Add these entries to the directives you already have:

DirectiveAddNeeded
connect-srchttps://www.consently.inAlways. Both banners load their settings and save choices here. Without it, neither banner appears.
script-srchttps://www.consently.in, or your page's nonce on both script tagsAlways. If your policy uses a nonce with 'strict-dynamic', putting the nonce on our two script tags is enough.
style-src'unsafe-inline' (with no nonce or hash in this directive)Always. The banners add their own stylesheets. See the note below the table.
img-srchttps://zuvrnjambeziurmallbn.supabase.co data:If you uploaded a logo or a custom button icon in the dashboard.
frame-srchttps://www.consently.inFor the Privacy Centre, where visitors review and change their choices.
media-srcblob:For the "Listen" button that reads the privacy notice aloud.

For example, with nothing else on your site needing these directives:

Content-Security-Policy:
  script-src  'self' https://www.consently.in;
  connect-src 'self' https://www.consently.in;
  style-src   'self' 'unsafe-inline';
  img-src     'self' https://zuvrnjambeziurmallbn.supabase.co data:;
  frame-src   https://www.consently.in;
  media-src   'self' blob:;

If your style-src uses a nonce or hashes

The banners add their own stylesheets without a nonce. Browsers ignore 'unsafe-inline' in any directive that also lists a nonce or a hash, so adding it alongside a nonce does not help: the banners appear unstyled or broken.

If your policy must keep a nonce on style-src, email support@consently.in before you go live and we will work it out with you.

Test a policy change without breaking your site

Send the new policy as Content-Security-Policy-Report-Only first. The browser then reports what it would block in the console, without blocking anything. Switch to the real header once the console is clean.

4. Script optimisers and caching plugins

Tools that delay, combine or rewrite JavaScript to make pages faster can stop the banners or make them appear only after the visitor scrolls or clicks. For each tool you use, exclude scripts from consently.in from delay, defer, combine and minify.

  • Cloudflare Rocket Loader: add data-cfasync="false" to both script tags, as in the example below.
  • WordPress (WP Rocket, LiteSpeed Cache, Autoptimize, Perfmatters, NitroPack and similar): add consently.in to the list of scripts excluded from "Delay JavaScript", "Defer JavaScript" and "Combine/Minify JavaScript".
  • Page caches and CDNs: clear the cache after adding or changing a snippet, or visitors keep getting the old page without it.
<script data-cfasync="false" src="https://www.consently.in/cdn/widget.js" data-consently-id="YOUR_COOKIE_WIDGET_ID"></script>

5. Something covers the banner or the notice will not scroll

  • Another widget sits on top (a chat bubble, a cookie banner from another tool, a promo pop-up): lower that element's z-index, or remove the other consent tool. Running two consent tools at once gives visitors conflicting choices.
  • The banner is in the wrong place or cut off: check for a transform, filter or perspective style on <html> or <body>. Any of these makes the browser position the banner against that element instead of the screen.
  • Smooth-scroll libraries such as Lenis and Locomotive Scroll, and page transitions that swap the whole page body (Turbo, Astro view transitions): the banners handle these themselves. If the privacy notice still does not scroll, tell us the page address.

6. It works for you but not for some visitors

  • Browser extensions: some ad blockers and "hide cookie notices" extensions hide consent banners on purpose. This affects only visitors who installed them, and every consent tool alike.
  • Office and school networks sometimes block unfamiliar domains. If a client reports it, ask their IT team to allow https://www.consently.in.
  • A choice was already made: once a visitor chooses, the banner stays hidden on that browser. They can change their choice from the Privacy Centre link or button on your site.

7. Before you go live

  • In a private window, the banner appears and the console shows no red lines about consently.in.
  • Accept, reject and reload: the banner stays hidden and your choice is remembered.
  • The privacy notice scrolls to the end, and the page behind it stays still.
  • The Privacy Centre opens and shows your choice.
  • Repeat on a phone.
  • For the cookie banner: before you accept, your analytics and ad tags do not load. Check the browser's Network tab.

8. Still stuck?

Email support@consently.in with your website address and a screenshot of the console. We can usually tell what is blocking the banner from those two alone.

New to Consently? Read the DPDPA consent guide and the cookie consent guide.