UNPKG

2.93 kBJavaScriptView Raw
1(function webpackUniversalModuleDefinition(root, factory) {
2 if(typeof exports === 'object' && typeof module === 'object')
3 module.exports = factory();
4 else if(typeof define === 'function' && define.amd)
5 define([], factory);
6 else {
7 var a = factory();
8 for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
9 }
10})(this, function() {
11return /******/ (function(modules) { // webpackBootstrap
12/******/ // The module cache
13/******/ var installedModules = {};
14
15/******/ // The require function
16/******/ function __webpack_require__(moduleId) {
17
18/******/ // Check if module is in cache
19/******/ if(installedModules[moduleId])
20/******/ return installedModules[moduleId].exports;
21
22/******/ // Create a new module (and put it into the cache)
23/******/ var module = installedModules[moduleId] = {
24/******/ exports: {},
25/******/ id: moduleId,
26/******/ loaded: false
27/******/ };
28
29/******/ // Execute the module function
30/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
31
32/******/ // Flag the module as loaded
33/******/ module.loaded = true;
34
35/******/ // Return the exports of the module
36/******/ return module.exports;
37/******/ }
38
39
40/******/ // expose the modules object (__webpack_modules__)
41/******/ __webpack_require__.m = modules;
42
43/******/ // expose the module cache
44/******/ __webpack_require__.c = installedModules;
45
46/******/ // __webpack_public_path__
47/******/ __webpack_require__.p = "";
48
49/******/ // Load entry module and return exports
50/******/ return __webpack_require__(0);
51/******/ })
52/************************************************************************/
53/******/ ({
54
55/***/ 0:
56/***/ function(module, exports, __webpack_require__) {
57
58 'use strict';
59
60 module.exports = __webpack_require__(13);
61
62/***/ },
63
64/***/ 13:
65/***/ function(module, exports) {
66
67 'use strict';
68
69 var GoogleTagManager = function GoogleTagManager() {
70 var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
71 _ref$dataLayerName = _ref.dataLayerName,
72 dataLayerName = _ref$dataLayerName === undefined ? 'dataLayer' : _ref$dataLayerName;
73
74 return function (events) {
75 if (typeof window === 'undefined') {
76 return;
77 }
78 if (!window[dataLayerName] || typeof window[dataLayerName].push !== 'function') {
79 throw new Error('redux-beacon error: window.' + dataLayerName + ' is not defined. Have you forgotten to include Google Tag Manager and dataLayer?');
80 }
81 events.forEach(function (event) {
82 var eventToPush = function () {
83 if (event.event === undefined && event.hitType !== undefined) {
84 return Object.assign({}, event, { event: event.hitType });
85 }
86 return event;
87 }();
88 window[dataLayerName].push(eventToPush);
89 });
90 };
91 };
92
93 module.exports = { GoogleTagManager: GoogleTagManager };
94
95/***/ }
96
97/******/ })
98});
99;
\No newline at end of file