diff --git a/package-lock.json b/package-lock.json index 35122c1e..2db8a948 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "react-gtm-module", - "version": "2.0.4", + "version": "2.0.5", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 2ed0debe..fd8477a7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-gtm-module", - "version": "2.0.5", + "version": "2.0.6", "description": "React Google Tag Manager Module", "main": "dist/index.js", "scripts": { diff --git a/src/TagManager.js b/src/TagManager.js index 57d7c21d..902cf03b 100644 --- a/src/TagManager.js +++ b/src/TagManager.js @@ -43,9 +43,7 @@ const TagManager = { document.body.insertBefore(gtm.noScript(), document.body.childNodes[0]) }, dataLayer: function ({dataLayer, dataLayerName = 'dataLayer'}) { - const snippets = Snippets.dataLayer(dataLayer, dataLayerName) - const dataScript = this.dataScript(snippets) - document.head.appendChild(dataScript) + window[dataLayerName].push(dataLayer) } }