From 88c39d607cf7db652088efa4d8b72605edf2ff78 Mon Sep 17 00:00:00 2001 From: Ryszard Wolosiuk Date: Fri, 2 Aug 2024 13:23:21 +0200 Subject: [PATCH] feat: 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() {