mirror of
https://github.com/netbirdio/docs.git
synced 2026-09-01 20:51:28 +02:00
Change cookie popup behavior (#849)
This commit is contained in:
@@ -4,10 +4,14 @@ import Script from "next/script";
|
||||
// Google Tag Manager ID
|
||||
const GTM_ID = "GTM-PGWDPDN3";
|
||||
|
||||
export const GoogleTagManagerHeadScript = () => {
|
||||
export const GoogleTagManager = ({ consentGiven }) => {
|
||||
if (!consentGiven) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<Script id="gtm-script" strategy="afterInteractive">
|
||||
{`(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
|
||||
{`(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://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
|
||||
@@ -15,17 +19,3 @@ export const GoogleTagManagerHeadScript = () => {
|
||||
</Script>
|
||||
);
|
||||
};
|
||||
|
||||
export const GoogleTageManagerBodyScript = () => {
|
||||
return (
|
||||
<noscript>
|
||||
<iframe
|
||||
title={"Google Tag Manager"}
|
||||
src={`https://www.googletagmanager.com/ns.html?id=${GTM_ID}`}
|
||||
height="0"
|
||||
width="0"
|
||||
style={{ display: "none", visibility: "hidden" }}
|
||||
/>
|
||||
</noscript>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user