Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@analytics/google-tag-manager

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@analytics/google-tag-manager - npm Package Compare versions

Comparing version 0.3.0 to 0.3.1

11

CHANGELOG.md

@@ -6,2 +6,13 @@ # Change Log

## [0.3.1](https://github.com/DavidWells/analytics/compare/@analytics/google-tag-manager@0.3.0...@analytics/google-tag-manager@0.3.1) (2020-12-12)
### Bug Fixes
* use properties.categories for google tag manager ([b52c6f7](https://github.com/DavidWells/analytics/commit/b52c6f7)), closes [#127](https://github.com/DavidWells/analytics/issues/127)
# [0.3.0](https://github.com/DavidWells/analytics/compare/@analytics/google-tag-manager@0.2.3...@analytics/google-tag-manager@0.3.0) (2020-09-25)

@@ -8,0 +19,0 @@

5

dist/@analytics/google-tag-manager.js

@@ -116,4 +116,3 @@ var analyticsGtagManager = (function () {

userId = payload.userId,
properties = payload.properties,
category = payload.category;
properties = payload.properties;
var formattedPayload = properties;

@@ -129,3 +128,3 @@

if (!category) {
if (!properties.category) {
formattedPayload.category = 'All';

@@ -132,0 +131,0 @@ }

2

dist/@analytics/google-tag-manager.min.js

@@ -1,1 +0,1 @@

var analyticsGtagManager=function(){"use strict";function g(r){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,a,n;t=r,n=o[a=e],a in t?Object.defineProperty(t,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[a]=n})}return r}var r,e={debug:!1,containerId:null,dataLayerName:"dataLayer",dataLayer:void 0};var n={};function o(e){var t=n[e];t||(t=new RegExp("googletagmanager\\.com\\/gtm\\.js.*[?&]id="+e),n[e]=t);var a=document.querySelectorAll("script[src]");return!!Object.keys(a).filter(function(e){return(a[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,a=t.containerId,n=t.dataLayerName;if(!a)throw new Error("No google tag manager containerId defined");o(a)||(function(e,t,a,n,r){e[n]=e[n]||[],e[n].push({"gtm.start":(new Date).getTime(),event:"gtm.js"});var o=t.getElementsByTagName(a)[0],i=t.createElement(a),c="dataLayer"!=n?"&l="+n:"";i.async=!0,i.src="https://www.googletagmanager.com/gtm.js?id="+r+c,o.parentNode.insertBefore(i,o)}(window,document,"script",n,a),r=n,t.dataLayer=window[n])},page:function(e){var t=e.payload,a=(e.options,e.instance,e.config);void 0!==a.dataLayer&&a.dataLayer.push(t.properties)},track:function(e){var t=e.payload,a=(e.options,e.config);if(void 0!==a.dataLayer){var n=t.anonymousId,r=t.userId,o=t.properties,i=t.category,c=o;r&&(c.userId=r),n&&(c.anonymousId=n),i||(c.category="All"),a.debug&&console.log("gtag push",g({event:t.event},c)),a.dataLayer.push(g({event:t.event},c))}},loaded:function(){var e=!!r&&!(!window[r]||Array.prototype.push===window[r].push);return o(t.containerId)&&e}}}}();
var analyticsGtagManager=function(){"use strict";function c(r){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,a,n;t=r,n=o[a=e],a in t?Object.defineProperty(t,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[a]=n})}return r}var r,e={debug:!1,containerId:null,dataLayerName:"dataLayer",dataLayer:void 0};var n={};function o(e){var t=n[e];t||(t=new RegExp("googletagmanager\\.com\\/gtm\\.js.*[?&]id="+e),n[e]=t);var a=document.querySelectorAll("script[src]");return!!Object.keys(a).filter(function(e){return(a[e].src||"").match(t)}).length}return function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return{name:"google-tag-manager",config:c({},e,t),initialize:function(e){var t=e.config,a=t.containerId,n=t.dataLayerName;if(!a)throw new Error("No google tag manager containerId defined");o(a)||(function(e,t,a,n,r){e[n]=e[n]||[],e[n].push({"gtm.start":(new Date).getTime(),event:"gtm.js"});var o=t.getElementsByTagName(a)[0],i=t.createElement(a),c="dataLayer"!=n?"&l="+n:"";i.async=!0,i.src="https://www.googletagmanager.com/gtm.js?id="+r+c,o.parentNode.insertBefore(i,o)}(window,document,"script",n,a),r=n,t.dataLayer=window[n])},page:function(e){var t=e.payload,a=(e.options,e.instance,e.config);void 0!==a.dataLayer&&a.dataLayer.push(t.properties)},track:function(e){var t=e.payload,a=(e.options,e.config);if(void 0!==a.dataLayer){var n=t.anonymousId,r=t.userId,o=t.properties,i=o;r&&(i.userId=r),n&&(i.anonymousId=n),o.category||(i.category="All"),a.debug&&console.log("gtag push",c({event:t.event},i)),a.dataLayer.push(c({event:t.event},i))}},loaded:function(){var e=!!r&&!(!window[r]||Array.prototype.push===window[r].push);return o(t.containerId)&&e}}}}();

@@ -115,4 +115,3 @@ 'use strict';

userId = payload.userId,
properties = payload.properties,
category = payload.category;
properties = payload.properties;
var formattedPayload = properties;

@@ -128,3 +127,3 @@

if (!category) {
if (!properties.category) {
formattedPayload.category = 'All';

@@ -131,0 +130,0 @@ }

@@ -113,4 +113,3 @@ function _defineProperty(obj, key, value) {

userId = payload.userId,
properties = payload.properties,
category = payload.category;
properties = payload.properties;
var formattedPayload = properties;

@@ -126,3 +125,3 @@

if (!category) {
if (!properties.category) {
formattedPayload.category = 'All';

@@ -129,0 +128,0 @@ }

{
"name": "@analytics/google-tag-manager",
"version": "0.3.0",
"version": "0.3.1",
"description": "Google tag manager plugin for 'analytics' module",

@@ -55,3 +55,3 @@ "projectMeta": {

},
"gitHead": "219b20141960cf1074476b9b6ba3fff520dddfc5"
"gitHead": "747d4da09fc2f44e0f840edd8f0c6116b210b3a1"
}

@@ -26,2 +26,3 @@ <!--

- [Using multiple instances of GTM](#using-multiple-instances-of-gtm)
- [Custom name for dataLayer-object](#custom-name-for-datalayer-object)
- [Tracking if JS is disabled](#tracking-if-js-is-disabled)

@@ -110,2 +111,3 @@

| `containerId` <br/>**required** - string| The Container ID uniquely identifies the GTM Container. |
| `dataLayerName` <br/>_optional_ - string| The optional name for dataLayer-object. Defaults to dataLayer. |

@@ -112,0 +114,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc