Skip to content

Commit

Permalink
Fix body script
Browse files Browse the repository at this point in the history
  • Loading branch information
TorbenLundsgaard committed Nov 23, 2023
1 parent b205e48 commit 42a85d4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Frontend/Frontend.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 '<noscript><iframe src="https://' . esc_attr( $domain ) . '/ns.html?id=' . esc_attr( $gtm_id ) . '" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>';
}

Expand Down

0 comments on commit 42a85d4

Please sign in to comment.