Tell GTM Kit about a consent platform it cannot detect

If your consent platform is loaded by your theme, a code snippet or a tag, GTM Kit cannot detect it. Declare it with two filters so Site Health names it.

Last updated ·

GTM Kit recognises Cookiebot, Iubenda and CookieYes when they are installed as plugins. If your consent platform is added some other way, for example tarteaucitron.js loaded by your theme, a code snippet or a tag in your container, GTM Kit cannot see it.

When that happens and you have switched off GTM Kit’s Consent Mode defaults because your platform sends the consent signals itself, Tools → Site Health reports “Consent is not configured”. Your setup is fine. GTM Kit just does not know about the platform.

Declaring your platform

Add this snippet with a code snippets plugin or in your child theme’s functions.php. Change both names to match your platform:

add_filter( 'gtmkit_active_cmp', function ( $detected ) {
	return $detected ?? 'tarteaucitron';
} );

add_filter( 'gtmkit_cmp_display_name', function ( $name, $slug ) {
	return 'tarteaucitron' === $slug ? 'tarteaucitron.js' : $name;
}, 10, 2 );

The first filter tells GTM Kit a consent platform is active. The second sets the name Site Health shows for it.

Reload Tools → Site Health and the consent check names your platform instead.

What this does not do

The snippet changes what GTM Kit reports. It does not load your consent platform, send any consent signals, or change how your container loads. Your platform still has to do that itself.

← Previous

Previous article

Next →

Next article