From 42a85d4dc4c507b761e502f3de6dc6a14fb2872f Mon Sep 17 00:00:00 2001 From: Torben Lundsgaard Date: Thu, 23 Nov 2023 22:05:54 +0100 Subject: [PATCH] Fix body script --- src/Frontend/Frontend.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Frontend/Frontend.php b/src/Frontend/Frontend.php index a99b672..2c95916 100644 --- a/src/Frontend/Frontend.php +++ b/src/Frontend/Frontend.php @@ -225,6 +225,10 @@ public static function get_body_script(): void { $domain = Options::init()->get( 'general', 'sgtm_domain' ) ? Options::init()->get( 'general', 'sgtm_domain' ) : 'www.googletagmanager.com'; $gtm_id = Options::init()->get( 'general', 'gtm_id' ); + if ( empty( $gtm_id ) ) { + return; + } + echo ''; }