Skip to content

Script blocking

Trackers wait until visitors say yes

Trusted Cookie's script loads first on the page and holds back analytics, advertising and other tracking scripts until the visitor allows their category. Around 25 common trackers are recognised automatically, and you can add your own rules or tag any script by hand.

  • About 25 known trackers blocked automatically
  • Your own address rules
  • Manual tagging for zero requests
  • Strict blocking for unknown third parties

Three ways to hold a script back

MethodWhat you doRequest before consent?
Known trackersNothing. Google Analytics, Meta Pixel, Hotjar and about 20 others are recognisedAdded by other scripts: no. Written in the HTML: the file may download, but it does not run
Your own rulesAdd an address pattern such as cdn.example-chat.com and choose a categorySame as known trackers
Manual taggingChange the script's type to text/plain and add a categoryNo request at all

Manual tagging is the strictest. It works for scripts with a src and for inline scripts:

<script type="text/plain" data-pgcmp-category="analytics"
        src="https://www.googletagmanager.com/gtag/js?id=G-XXXX"></script>

The categories are functional, analytics and marketing. Necessary scripts need no tag.

What happens when a visitor chooses

  • When a visitor allows a category, its held scripts run once, in page order.
  • When a visitor withdraws a category, the page reloads and the cookies on your cookie list for that category are deleted.
  • If you turn the site off in the dashboard, the script does nothing and your scripts run as if it were not there.

Strict blocking for everything else

Turn on strict blocking to hold back every script and iframe from another site that Trusted Cookie does not know, until the visitor allows Marketing. Payment, bot check, code library and font hosts, your own domain and the banner itself keep working. If something stops working, mark its address as Always allowed.

Check it yourself

Open your site in a private window and add ?pgcmp_debug=1 to the address. The browser console then lists every script the banner holds back and releases.

Questions

Does blocking work with Google Tag Manager?

Yes. Put the Trusted Cookie tag directly in the page, not inside Tag Manager. Tag Manager is then held back until consent, unless you mark it as necessary.

Do I need a developer to block scripts?

No for known trackers and address rules: you set them in the dashboard. Manual tagging means editing a script tag, which is a small change your web person can make in minutes.

Add your cookie banner today.

Free for your first 10,000 page views. No card needed.