@apolitical/gtm 1.0.0-rc.2 → 1.0.1-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,10 +5,12 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
- ## [0.1.1] - 2021-02-22
9
- ### Fixed
10
- - Initial setup
8
+ ## [1.0.1] - 2021-04-07
9
+ ### Changed
10
+ - TagManager is initialized only when cookie consent is given
11
+ ### Added
12
+ - Add `react` and `react-cookies` to dependencies
11
13
 
12
- ## [0.1.0] - 2021-02-22
14
+ ## [1.0.0] - 2021-04-06
13
15
  ### Added
14
- - Initial setup
16
+ - Initialize Google Tag Manager with GTM container Id
package/build/index.js CHANGED
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react-gtm-module")):"function"==typeof define&&define.amd?define(["react-gtm-module"],e):"object"==typeof exports?exports.ApoliticalGTM=e(require("react-gtm-module")):t.ApoliticalGTM=e(t["react-gtm-module"])}(this,(function(t){return function(){"use strict";var e={273:function(e){e.exports=t}},o={};function n(t){var r=o[t];if(void 0!==r)return r.exports;var i=o[t]={exports:{}};return e[t](i,i.exports,n),i.exports}n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,{a:e}),e},n.d=function(t,e){for(var o in e)n.o(e,o)&&!n.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return function(){n.r(r),n.d(r,{setContext:function(){return u},setupGTM:function(){return f}});var t=n(273),e=n.n(t);const{APOLITICAL:{WEBSITES:{BETA:o,BETA_2:i,LIVE:c,RC:l}}}={APOLITICAL:{WEBSITES:{BETA:"https://beta.apolitical.co",BETA_2:"https://beta-2.apolitical.co",LIVE:"https://apolitical.co",RC:"https://rc.apolitical.co"},ENVIRONMENTS:{BETA:"beta",BETA_2:"beta",RC:"rc",LIVE:"master"}}};let a=null;const u=({configs:t,origin:e=null})=>{a=((t,e)=>{let n=null,r=null;switch(n="undefined"!=typeof window?window.origin||window.location.origin:e,console.log("from gtm context.js website",n),console.log("from gtm context.js configs",t),n){case o:r=t.beta;break;case i:r=t["beta-2"];break;case c:r=t.live;break;case l:r=t.rc;break;default:r=t.local}return console.log("from gtm context.js",r),r})(t,e)},s=()=>a,f=()=>{const t=s();e().initialize({gtmId:t.id})}}(),r}()}));
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react-gtm-module")):"function"==typeof define&&define.amd?define(["react-gtm-module"],t):"object"==typeof exports?exports.ApoliticalGTM=t(require("react-gtm-module")):e.ApoliticalGTM=t(e["react-gtm-module"])}(this,(function(e){return function(){"use strict";var t={273:function(t){t.exports=e}},o={};function n(e){var r=o[e];if(void 0!==r)return r.exports;var i=o[e]={exports:{}};return t[e](i,i.exports,n),i.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return function(){n.r(r),n.d(r,{setContext:function(){return l},setupGTM:function(){return p}});var e=n(273),t=n.n(e);const{APOLITICAL:{WEBSITES:{BETA:o,BETA_2:i,LIVE:c,RC:a}}}={APOLITICAL:{WEBSITES:{BETA:"https://beta.apolitical.co",BETA_2:"https://beta-2.apolitical.co",LIVE:"https://apolitical.co",RC:"https://rc.apolitical.co"},ENVIRONMENTS:{BETA:"beta",BETA_2:"beta",RC:"rc",LIVE:"master"}}};let u=null;const l=({configs:e,origin:t=null})=>{u=((e,t)=>{let n=null,r=null;switch(n="undefined"!=typeof window?window.origin||window.location.origin:t,n){case o:r=e.beta;break;case i:r=e["beta-2"];break;case c:r=e.live;break;case a:r=e.rc;break;default:r=e.local}return r})(e,t)},f=()=>u,p=e=>{const o=f();"true"===e["performance-cookie-consent"]&&t().initialize({gtmId:o.id})}}(),r}()}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apolitical/gtm",
3
- "version": "1.0.0-rc.2",
3
+ "version": "1.0.1-rc.2",
4
4
  "description": "Browser library to interact with Google Tag Manager (GTM)",
5
5
  "author": "Apolitical Group Limited <engineering@apolitical.co>",
6
6
  "license": "MIT",
@@ -62,6 +62,7 @@
62
62
  ]
63
63
  },
64
64
  "jest": {
65
+ "testEnvironment": "jsdom",
65
66
  "bail": true,
66
67
  "clearMocks": true,
67
68
  "collectCoverage": true,