Documentation
Welcome to the ConsentGate documentation. Here you'll find everything you need to get started with our consent-aware GTM proxy.
Quick Start
- Installation Guide - Get up and running in minutes
- CMP Integration - Connect with your consent management platform
- Troubleshooting - Common issues and solutions
- API Reference - RESTful API documentation
- Webhooks - Real-time event notifications
Getting Help
- Email Support: support@pii.ai
- Portal: app.consentgate.io
- Status: status.pii.ai
Installation Guide
Get ConsentGate up and running in just a few minutes. This guide will walk you through the complete setup process.
Prerequisites
Before you begin, make sure you have:
- A verified domain in your PieEye Portal account
- An active subscription (Starter, Growth, or Enterprise)
- Access to your website's HTML source code
Step 1: Create Your Proxy
- Log in to your PieEye Portal
- Navigate to the Developer Setup page
- Select a verified domain from the dropdown
- Click Provision Proxy
- Wait for the proxy to be created (usually takes 2-3 minutes)
Step 2: Replace Your GTM Script
Once your proxy is ready, you'll receive a CloudFront URL. Replace your existing GTM script with:
<!-- Replace this -->
<script async src="https://www.googletagmanager.com/gtm.js?id=GTM-XXXXXXX"></script>
<!-- With this -->
<script async src="https://YOUR-CLOUDFRONT-URL/gtm.js?id=GTM-XXXXXXX"></script>Step 3: Configure Your CMP
Add the following JavaScript snippet to your website before the GTM script:
window.consentgate = {
cmp: "your-cmp-name", // e.g., "onetrust", "didomi", "cookiebot"
consentCookie: "cookie-name", // The cookie your CMP sets for consent
// Optional: Custom consent check function
checkConsent: () => {
// Return true if user has consented, false otherwise
return window.YourCMP && window.YourCMP.hasConsent();
}
};CMP-Specific Examples
OneTrust
window.consentgate = {
cmp: "onetrust",
consentCookie: "OptanonConsent",
checkConsent: () => {
return window.Optanon && window.Optanon.IsAlertBoxClosed();
}
};Didomi
window.consentgate = {
cmp: "didomi",
consentCookie: "didomi_token",
checkConsent: () => {
return window.Didomi && window.Didomi.getConsentStatus();
}
};Cookiebot
window.consentgate = {
cmp: "cookiebot",
consentCookie: "CookieConsent",
checkConsent: () => {
return window.Cookiebot && window.Cookiebot.consent.statistics;
}
};Step 4: Test Your Implementation
- Open your website in a private/incognito browser window
- Check the browser's Network tab
- You should see GTM requests being blocked initially
- Grant consent through your CMP
- GTM requests should now be allowed through
Troubleshooting
GTM Still Loading Before Consent
Problem: GTM is loading immediately, ignoring consent.
Solution:
- Verify your CMP configuration is correct
- Check that the
consentgateobject is defined before the GTM script - Ensure your CMP is setting the correct cookie name
403 Forbidden Errors
Problem: Getting 403 errors when GTM tries to load.
Solution:
- This is expected behavior when no consent is given
- Check that your CMP is properly configured
- Verify the consent cookie is being set correctly
502 Bad Gateway Errors
Problem: Getting 502 errors from the proxy.
Solution:
- Check your PieEye Portal for proxy status
- Ensure your domain is verified
- Contact support if the issue persists
Support
Need help? We're here to assist:
- Email: support@pii.ai
- Documentation: app.consentgate.io/docs
- Status Page: status.pii.ai
Last updated: January 2025