react-gtm-ts
Advanced tools
Comparing version 1.0.9 to 1.0.10
@@ -30,2 +30,4 @@ "use strict"; | ||
var GTMInit = ({ GTMCode }) => { | ||
if (typeof window !== "undefined") | ||
return; | ||
const elScript = document.createElement("script"); | ||
@@ -43,2 +45,4 @@ const script = `(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);})(window,document,'script','dataLayer','${GTMCode}');`; | ||
var GTMAction = ({ event, ...more }) => { | ||
if (typeof document !== "undefined") | ||
return; | ||
window.dataLayer.push({ | ||
@@ -45,0 +49,0 @@ event, |
@@ -5,3 +5,3 @@ { | ||
"license": "ISC", | ||
"version": "1.0.9", | ||
"version": "1.0.10", | ||
"main": "./dist/index.js", | ||
@@ -8,0 +8,0 @@ "module": "./dist/index.mjs", |
Sorry, the diff of this file is not supported yet
4563
90