Title: GTM Server side blocking
Last modified: October 19, 2025

---

# GTM Server side blocking

 *  Resolved [Dieter J – Webtica Support](https://wordpress.org/support/users/dieterj/)
 * (@dieterj)
 * [5 months, 3 weeks ago](https://wordpress.org/support/topic/gtm-server-side-blocking/)
 * Hi there,
 * We are using the plugin on a new site. We have the standard GTM head and body
   code on our site except the domain is custom first party so:
 *     ```wp-block-code
       <!-- Google Tag Manager --><script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://domain.be/som/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-NDPN2SS');</script><!-- End Google Tag Manager -->
       ```
   
 * The WPconsent plugin does not seem to scan this and configure it. Thus not activation
   consent mode. 
   Is there a way to get it working with these server side configs?
   Thanks

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Mircea Sandu](https://wordpress.org/support/users/gripgrip/)
 * (@gripgrip)
 * [5 months, 3 weeks ago](https://wordpress.org/support/topic/gtm-server-side-blocking/#post-18687441)
 * Hi [@dieterj](https://wordpress.org/support/users/dieterj/),
 * Thank you for reaching out. WPConsent will automatically load the Google Consent
   Mode scripts if a Google service is configured on your website. So if you go 
   in wp-admin > WPConsent > Settings > Cookies and add a service named Google Tag
   Manager or Google Analytics, for example, to the appropriate category, WPConsent
   will then know to load the consent mode script.
 * This type of check is needed because the consent mode script is loaded very early
   on the page and we only want to load it for those websites that really need it.
 * Let me know if you run into any issues.
 * Thanks,
    Mircea
 *  Thread Starter [Dieter J – Webtica Support](https://wordpress.org/support/users/dieterj/)
 * (@dieterj)
 * [5 months, 3 weeks ago](https://wordpress.org/support/topic/gtm-server-side-blocking/#post-18687473)
 * Hi [@gripgrip](https://wordpress.org/support/users/gripgrip/) ,
 * Thanks! this worked. How do need to map the cookies set by GTM? 
   For example:
 * GTM has a Google Analytics 4 tag that loads on page after consent with consent
   mode. 
   This adds the ga_ cookies in the browser of the user but it is not found
   via the scanner? ThanksDieter
 *  Plugin Author [Mircea Sandu](https://wordpress.org/support/users/gripgrip/)
 * (@gripgrip)
 * [5 months, 3 weeks ago](https://wordpress.org/support/topic/gtm-server-side-blocking/#post-18687478)
 * Hi [@dieterj](https://wordpress.org/support/users/dieterj/),
 * Yes, that is happening because GA4 is not directly loaded on your site, it’s 
   loaded through GTM.
 * WPConsent doesn’t currently have a way to detect the tags loaded through GTM.
 * You can manually configure the details for GA4 cookies by adding a new service
   and cookie info in the Cookies tab of WPConsent. [https://cookielibrary.org/service/google-analytics/](https://cookielibrary.org/service/google-analytics/)
 * If your site loaded GA4 directly on the website, WPConsent would automatically
   detect it and configure it from our public library linked above.
 *  Thread Starter [Dieter J – Webtica Support](https://wordpress.org/support/users/dieterj/)
 * (@dieterj)
 * [5 months, 3 weeks ago](https://wordpress.org/support/topic/gtm-server-side-blocking/#post-18687532)
 * Perfect, thank you!

Viewing 4 replies - 1 through 4 (of 4 total)

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fgtm-server-side-blocking%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://ps.w.org/wpconsent-cookies-banner-privacy-suite/assets/icon-256x256.
   png?rev=3232030)
 * [WPConsent - Cookie Consent Banner for Privacy Compliance (GDPR / CCPA)](https://wordpress.org/plugins/wpconsent-cookies-banner-privacy-suite/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wpconsent-cookies-banner-privacy-suite/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wpconsent-cookies-banner-privacy-suite/)
 * [Active Topics](https://wordpress.org/support/plugin/wpconsent-cookies-banner-privacy-suite/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wpconsent-cookies-banner-privacy-suite/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wpconsent-cookies-banner-privacy-suite/reviews/)

## Tags

 * [gtm](https://wordpress.org/support/topic-tag/gtm/)
 * [server-side](https://wordpress.org/support/topic-tag/server-side/)
 * [Tag Manager](https://wordpress.org/support/topic-tag/tag-manager/)

 * 4 replies
 * 2 participants
 * Last reply from: [Dieter J – Webtica Support](https://wordpress.org/support/users/dieterj/)
 * Last activity: [5 months, 3 weeks ago](https://wordpress.org/support/topic/gtm-server-side-blocking/#post-18687532)
 * Status: resolved