From cac50d5028356c62f6792b93fa2055566fc00e68 Mon Sep 17 00:00:00 2001 From: prashant-sp-FE Date: Mon, 8 May 2023 20:43:53 +0530 Subject: [PATCH] Gtag script append in header --- src/ga4.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ga4.js b/src/ga4.js index cf6a597..94f86ef 100644 --- a/src/ga4.js +++ b/src/ga4.js @@ -95,7 +95,7 @@ export class GA4 { if (nonce) { script.setAttribute("nonce", nonce); } - document.body.appendChild(script); + document.head.appendChild(script); window.dataLayer = window.dataLayer || []; window.gtag = function gtag() {