@analytics/google-tag-manager
Advanced tools
Comparing version 0.2.2 to 0.2.3
@@ -6,2 +6,13 @@ # Change Log | ||
## [0.2.3](https://github.com/DavidWells/analytics/compare/@analytics/google-tag-manager@0.2.2...@analytics/google-tag-manager@0.2.3) (2020-03-13) | ||
### Bug Fixes | ||
* GTM plugin undefined src ([8ce2852](https://github.com/DavidWells/analytics/commit/8ce2852)) | ||
## [0.2.2](https://github.com/DavidWells/analytics/compare/@analytics/google-tag-manager@0.2.1...@analytics/google-tag-manager@0.2.2) (2020-03-07) | ||
@@ -8,0 +19,0 @@ |
@@ -158,3 +158,3 @@ var analyticsGtagManager = (function () { | ||
return !!Object.keys(scripts).filter(function (key) { | ||
return scripts[key].src.match(regex); | ||
return (scripts[key].src || '').match(regex); | ||
}).length; | ||
@@ -161,0 +161,0 @@ } |
@@ -1,1 +0,1 @@ | ||
var analyticsGtagManager=function(){"use strict";function g(a){for(var e=1;e<arguments.length;e++){var o=null!=arguments[e]?arguments[e]:{},t=Object.keys(o);"function"==typeof Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(o).filter(function(e){return Object.getOwnPropertyDescriptor(o,e).enumerable}))),t.forEach(function(e){var t,n,r;t=a,r=o[n=e],n in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r})}return a}var e={debug:!1,containerId:null};var r={};function n(e){var t=r[e];t||(t=new RegExp("googletagmanager\\.com\\/gtm\\.js.*[?&]id="+e),r[e]=t);var n=document.querySelectorAll("script[src]");return!!Object.keys(n).filter(function(e){return n[e].src.match(t)}).length}return function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return{name:"google-tag-manager",config:g({},e,t),initialize:function(e){var t=e.config.containerId;if(!t)throw new Error("No google tag manager containerId defined");n(t)||function(e,t,n,r,a){e[r]=e[r]||[],e[r].push({"gtm.start":(new Date).getTime(),event:"gtm.js"});var o=t.getElementsByTagName(n)[0],i=t.createElement(n);i.async=!0,i.src="https://www.googletagmanager.com/gtm.js?id="+a,o.parentNode.insertBefore(i,o)}(window,document,"script","dataLayer",t)},page:function(e){var t=e.payload;e.options,e.instance,"undefined"!=typeof dataLayer&&dataLayer.push(t.properties)},track:function(e){var t=e.payload,n=(e.options,e.config);if("undefined"!=typeof dataLayer){var r=t.anonymousId,a=t.userId,o=t.properties,i=t.category,c=o;a&&(c.userId=a),r&&(c.anonymousId=r),i||(c.category="All"),n.debug&&console.log("gtag push",g({event:t.event},c)),dataLayer.push(g({event:t.event},c))}},loaded:function(){var e=!(!window.dataLayer||Array.prototype.push===window.dataLayer.push);return n(t.containerId)&&e}}}}(); | ||
var analyticsGtagManager=function(){"use strict";function g(a){for(var e=1;e<arguments.length;e++){var o=null!=arguments[e]?arguments[e]:{},t=Object.keys(o);"function"==typeof Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(o).filter(function(e){return Object.getOwnPropertyDescriptor(o,e).enumerable}))),t.forEach(function(e){var t,n,r;t=a,r=o[n=e],n in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r})}return a}var e={debug:!1,containerId:null};var r={};function n(e){var t=r[e];t||(t=new RegExp("googletagmanager\\.com\\/gtm\\.js.*[?&]id="+e),r[e]=t);var n=document.querySelectorAll("script[src]");return!!Object.keys(n).filter(function(e){return(n[e].src||"").match(t)}).length}return function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return{name:"google-tag-manager",config:g({},e,t),initialize:function(e){var t=e.config.containerId;if(!t)throw new Error("No google tag manager containerId defined");n(t)||function(e,t,n,r,a){e[r]=e[r]||[],e[r].push({"gtm.start":(new Date).getTime(),event:"gtm.js"});var o=t.getElementsByTagName(n)[0],i=t.createElement(n);i.async=!0,i.src="https://www.googletagmanager.com/gtm.js?id="+a,o.parentNode.insertBefore(i,o)}(window,document,"script","dataLayer",t)},page:function(e){var t=e.payload;e.options,e.instance,"undefined"!=typeof dataLayer&&dataLayer.push(t.properties)},track:function(e){var t=e.payload,n=(e.options,e.config);if("undefined"!=typeof dataLayer){var r=t.anonymousId,a=t.userId,o=t.properties,i=t.category,c=o;a&&(c.userId=a),r&&(c.anonymousId=r),i||(c.category="All"),n.debug&&console.log("gtag push",g({event:t.event},c)),dataLayer.push(g({event:t.event},c))}},loaded:function(){var e=!(!window.dataLayer||Array.prototype.push===window.dataLayer.push);return n(t.containerId)&&e}}}}(); |
@@ -157,3 +157,3 @@ 'use strict'; | ||
return !!Object.keys(scripts).filter(function (key) { | ||
return scripts[key].src.match(regex); | ||
return (scripts[key].src || '').match(regex); | ||
}).length; | ||
@@ -160,0 +160,0 @@ } |
@@ -155,3 +155,3 @@ function _defineProperty(obj, key, value) { | ||
return !!Object.keys(scripts).filter(function (key) { | ||
return scripts[key].src.match(regex); | ||
return (scripts[key].src || '').match(regex); | ||
}).length; | ||
@@ -158,0 +158,0 @@ } |
{ | ||
"name": "@analytics/google-tag-manager", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"description": "Google tag manager plugin for 'analytics' module", | ||
@@ -55,3 +55,3 @@ "projectMeta": { | ||
}, | ||
"gitHead": "46bb5c10dc2ecec53b88815dc45c23fc834e14aa" | ||
"gitHead": "743f6269487e90de8ab57fbae1cc6efe3dd1051a" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
28122