Using ConsentBit with Google tag gateway
How to set up ConsentBit when your Google tags are served from your own domain through Google tag gateway.
What Google tag gateway is
Google tag gateway lets your Google tags (Google Analytics, Google Ads, Google Tag Manager) load from your own website's address instead of from googletagmanager.com. It is usually switched on through Cloudflare, another CDN, or Google Cloud.
Google tag gateway changes where your Google tags load from. It does not change what your visitors have agreed to. Your Google tags must still receive the visitor's consent status before they start, exactly as without the gateway.
The one rule
ConsentBit must still load before the Google tag served through the gateway. Nothing else about your ConsentBit setup changes.
Setup
If your Google tag is in your page code
Keep the ConsentBit script first in <head>, then load your Google tag from the gateway path your provider gave you:
<head>
<!-- 1. ConsentBit: first -->
<script id="consentbit" src="https://manager.consentbit.com/consentbit/YOUR-SCRIPT-ID/script.js"></script>
<!-- 2. Google tag through the gateway on your own domain: after ConsentBit -->
<script async src="https://www.example.com/YOUR-GATEWAY-PATH/gtag/js?id=G-XXXXXXXXXX"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-XXXXXXXXXX');
</script>
</head>
If you turned on the gateway in Cloudflare or another CDN
The CDN serves your existing Google tag through your own domain, so you usually do not change any page code. Check only that the ConsentBit script is still the first script in your <head>, above your Google tag snippet.
If you use Google Tag Manager through the gateway
- Load your GTM container through the gateway, as your provider instructs.
- Install ConsentBit with the ConsentBit CMP tag template, using the Consent Initialization - All Pages trigger.
- Do not also paste the ConsentBit script into the page.
The template sets the consent status before any other tag in the container runs, wherever the container is loaded from.
If you use the ConsentBit IAB TCF banner
Nothing extra is needed. The TCF banner holds back Google tags until the visitor gives consent, whether they are served through the gateway or not. Keep the ConsentBit script first in <head>.
Check your setup
- Open your page with
?consentbit_debug=1(see Debug mode). - Consent default and Google requests should both show PASS. These checks work the same with or without the gateway.
- Open the page in Google Tag Assistant and confirm the first consent event shows every consent type as denied until you accept the banner.
Note: the Script order check recognises Google tags by Google's own addresses. A tag served from your own domain through the gateway may not be listed there. If Consent default and Google requests show PASS, your gateway setup is correct.
Need help? Contact ConsentBit support with your page address and a screenshot of the debug panel.

