@qlean/analytics-client
Advanced tools
Comparing version 0.4.2 to 0.5.0
@@ -1,1 +0,1 @@ | ||
!function(t){var n={};function Q(e){if(n[e])return n[e].exports;var r=n[e]={i:e,l:!1,exports:{}};return t[e].call(r.exports,r,r.exports,Q),r.l=!0,r.exports}Q.m=t,Q.c=n,Q.d=function(t,n,e){Q.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:e})},Q.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},Q.t=function(t,n){if(1&n&&(t=Q(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var e=Object.create(null);if(Q.r(e),Object.defineProperty(e,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var r in t)Q.d(e,r,function(n){return t[n]}.bind(null,r));return e},Q.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return Q.d(n,"a",n),n},Q.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},Q.p="",Q(Q.s=0)}([function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.Qat = undefined;\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _gateway = __webpack_require__(1);\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar gateway = new _gateway.Gateway();\n\nvar PROP = {\n 'eventId': 'eid',\n 'eventAction': 'ea',\n 'eventCategory': 'ec',\n 'eventLabel': 'el',\n 'phone': 'ph',\n 'user_id': 'uid',\n 'device_id': 'dvid',\n 'url': 'dl'\n};\n\nvar wrapHref = Symbol('wrapHref');\n\nvar Qat = exports.Qat = function () {\n function Qat(_ref) {\n var _this = this;\n\n var buffer = _ref.buffer,\n options = _ref.options;\n\n _classCallCheck(this, Qat);\n\n this.options = options;\n\n gateway.init(options);\n\n if (buffer.length) {\n buffer.forEach(function (event) {\n return _this.emit(event);\n });\n }\n\n if (!options.wrapLink) {\n return;\n }\n\n if (document.readyState === 'complete') {\n this[wrapHref]();\n } else {\n window.addEventListener('load', function () {\n return _this[wrapHref]();\n });\n }\n }\n\n _createClass(Qat, [{\n key: wrapHref,\n value: function value() {\n var els = document.getElementsByTagName('a');\n var pattern = null;\n\n if (_typeof(this.options.wrapLink) === 'object') {\n pattern = this.options.wrapLink.pattern;\n }\n\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = els[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var _ref2;\n\n var a = _step.value;\n\n\n if (pattern && !pattern.test(a.href)) {\n continue;\n }\n\n var oldhref = a.href;\n\n a.href = this.options.url + '?' + gateway.toQuery([(_ref2 = {}, _defineProperty(_ref2, PROP.category, 'redirect'), _defineProperty(_ref2, PROP.action, 'link'), _defineProperty(_ref2, 'tstamp', Date.now()), _defineProperty(_ref2, 'dl', encodeURIComponent(a.href)), _ref2)]) + '&rul=' + encodeURIComponent(oldhref);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n }\n }, {\n key: 'emit',\n value: function emit(event) {\n var item = {\n tstamp: Date.now(),\n dl: encodeURIComponent(location.href),\n prp: {}\n };\n\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n\n try {\n for (var _iterator2 = Object.keys(event)[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var key = _step2.value;\n\n\n if (typeof this.options.normalize === 'function') {\n key = this.options.normalize(key);\n }\n\n if (PROP[key]) {\n item[PROP[key]] = event[key];\n } else {\n item.prp[key] = event[key];\n }\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n\n gateway.pushEvent(item);\n }\n }]);\n\n return Qat;\n}();\n\n/**\n * Данное условие проверяет, что библиотека\n * подключена на обычную страницу и не\n * используется как модуль в приложении\n */\n\n\nif (window && window.$qat) {\n window.$qat = new Qat({\n buffer: window.$qat.buffer || [],\n options: window.$qat.options || {}\n });\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9zcmMvaW5kZXguanM/YjYzNSJdLCJuYW1lcyI6WyJnYXRld2F5IiwiR2F0ZXdheSIsIlBST1AiLCJ3cmFwSHJlZiIsIlN5bWJvbCIsIlFhdCIsImJ1ZmZlciIsIm9wdGlvbnMiLCJpbml0IiwibGVuZ3RoIiwiZm9yRWFjaCIsImVtaXQiLCJldmVudCIsIndyYXBMaW5rIiwiZG9jdW1lbnQiL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iAgICAgIHBycDoge31cbiAgICB9O1xuXG4gICAgZm9yIChsZXQga2V5IG9mIE9iamVjdC5rZXlzKGV2ZW50KSkge1xuXG4gICAgICBpZiAodHlwZW9mIHRoaXMub3B0aW9ucy5ub3JtYWxpemUgPT09ICdmdW5jdGlvbicpIHtcbiAgICAgICAga2V5ID0gdGhpcy5vcHRpb25zLm5vcm1hbGl6ZShrZXkpO1xuICAgICAgfVxuXG4gICAgICBpZiAoUFJPUFtrZXldKSB7XG4gICAgICAgIGl0ZW1bUFJPUFtrZXldXSA9IGV2ZW50W2tleV07XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBpdGVtLnBycFtrZXldID0gZXZlbnRba2V5XTtcbiAgICAgIH1cbiAgICB9XG5cbiAgICBnYXRld2F5LnB1c2hFdmVudChpdGVtKTtcbiAgfVxuXG59XG5cbi8qKlxuICog0JTQsNC90L3QvtC1INGD0YHQu9C+0LLQuNC1INC/0YDQvtCy0LXRgNGP0LXRgiwg0YfRgtC+INCx0LjQsdC70LjQvtGC0LXQutCwXG4gKiDQv9C+0LTQutC70Y7Rh9C10L3QsCDQvdCwINC+0LHRi9GH0L3Rg9GOINGB0YLRgNCw0L3QuNGG0YMg0Lgg0L3QtVxuICog0LjRgdC/0L7Qu9GM0LfRg9C10YLRgdGPINC60LDQuiDQvNC+0LTRg9C70Ywg0LIg0L/RgNC40LvQvtC20LXQvdC40LhcbiAqL1xuaWYgKHdpbmRvdyAmJiB3aW5kb3cuJHFhdCkge1xuICB3aW5kb3cuJHFhdCA9IG5ldyBRYXQoe1xuICAgIGJ1ZmZlcjogd2luZG93LiRxYXQuYnVmZmVyIHx8IFtdLFxuICAgIG9wdGlvbnM6IHdpbmRvdy4kcWF0Lm9wdGlvbnMgfHwge30sXG4gIH0pO1xufVxuXG5cblxuXG5cblxuXG5cbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///0\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Gateway = exports.Gateway = function () {\n function Gateway() {\n _classCallCheck(this, Gateway);\n\n this.buffer = [];\n this.timeout = null;\n this.options = {};\n }\n\n _createClass(Gateway, [{\n key: 'init',\n value: function init(_ref) {\n var url = _ref.url,\n _ref$timeout = _ref.timeout,\n timeout = _ref$timeout === undefined ? 5000 : _ref$timeout;\n\n this.options.url = url;\n this.options.timeout = timeout;\n }\n }, {\n key: 'pushEvent',\n value: function pushEvent(event) {\n var _this = this;\n\n this.buffer.push(event);\n\n if (this.timeout) {\n clearTimeout(this.timeout);\n }\n\n this.timeout = setTimeout(function () {\n return _this.send();\n }, this.options.timeout);\n }\n }, {\n key: 'toQuery',\n value: function toQuery(items) {\n var count = 0;\n var query = [];\n\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = items[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var item = _step.value;\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n\n try {\n\n for (var _iterator2 = Object.keys(item)[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var key = _step2.value;\n\n var value = item[key];\n\n if (value && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object') {\n value = JSON.stringify(value);\n }\n\n query.push('' + key + count + '=' + encodeURI(value));\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n\n count += 1;\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n return query.join('&');\n }\n }, {\n key: 'send',\n value: function send() {\n\n if (!this.options.url) {\n throw new Error('Нужно инициализировать аналитический модуль!');\n }\n\n var url = this.options.url + '?' + this.toQuery(this.buffer);\n\n if (navigator && navigator.product === 'ReactNative') {\n fetch(url).catch();\n } else {\n var img = new Image();\n img.src = url;\n }\n this.buffer = [];\n }\n }]);\n\n return Gateway;\n}();//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9zcmMvZ2F0ZXdheS5qcz81NmFmIl0sIm5hbWVzIjpbIkdhdGV3YXkiLCJidWZmZXIiLCJ0aW1lb3V0Iiwib3B0aW9ucyIsInVybCIsImV2ZW50IiwicHVzaCIsImNsZWFyVGltZW91dCIsInNldFRpbWVvdXQiLCJzZW5kIiwiaXRlbXMiLCJjb3VudCIsInF1ZXJ5IiwiaXRlbSIsIk9iamVjdCIsImtleXMiLCJrZXkiLCJ2YWx1ZSIsIkpTT04iLCJzdHJpbmdpZnkiLCJlbmNvZGVVUkkiLCJqb2luIiwiRXJyb3IiLCJ0b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1ZXJ5LnB1c2goYCR7a2V5fSR7Y291bnR9PSR7ZW5jb2RlVVJJKHZhbHVlKX1gKTtcbiAgICAgIH1cblxuICAgICAgY291bnQgKz0gMTtcbiAgICB9XG5cbiAgICByZXR1cm4gcXVlcnkuam9pbignJicpO1xuICB9XG5cbiAgc2VuZCgpIHtcblxuICAgIGlmICghdGhpcy5vcHRpb25zLnVybCkge1xuICAgICAgdGhyb3cgbmV3IEVycm9yKCfQndGD0LbQvdC+INC40L3QuNGG0LjQsNC70LjQt9C40YDQvtCy0LDRgtGMINCw0L3QsNC70LjRgtC40YfQtdGB0LrQuNC5INC80L7QtNGD0LvRjCEnKTtcbiAgICB9XG5cbiAgICBjb25zdCB1cmwgPSBgJHt0aGlzLm9wdGlvbnMudXJsfT8ke3RoaXMudG9RdWVyeSh0aGlzLmJ1ZmZlcil9YDtcblxuICAgIGlmIChuYXZpZ2F0b3IgJiYgbmF2aWdhdG9yLnByb2R1Y3QgPT09ICdSZWFjdE5hdGl2ZScpIHtcbiAgICAgIGZldGNoKHVybCkuY2F0Y2goKTtcbiAgICB9IGVsc2Uge1xuICAgICAgY29uc3QgaW1nID0gbmV3IEltYWdlKCk7XG4gICAgICBpbWcuc3JjID0gdXJsO1xuICAgIH1cbiAgICB0aGlzLmJ1ZmZlciA9IFtdO1xuICB9XG5cbn0iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///1\n")}]); | ||
!function(t){var n={};function Q(r){if(n[r])return n[r].exports;var e=n[r]={i:r,l:!1,exports:{}};return t[r].call(e.exports,e,e.exports,Q),e.l=!0,e.exports}Q.m=t,Q.c=n,Q.d=function(t,n,r){Q.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:r})},Q.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},Q.t=function(t,n){if(1&n&&(t=Q(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(Q.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var e in t)Q.d(r,e,function(n){return t[n]}.bind(null,e));return r},Q.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return Q.d(n,"a",n),n},Q.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},Q.p="",Q(Q.s=0)}([function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.Qat = undefined;\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _gateway = __webpack_require__(1);\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar gateway = new _gateway.Gateway();\n\nvar PROP = {\n 'eventId': 'eid',\n 'eventAction': 'ea',\n 'eventCategory': 'ec',\n 'eventLabel': 'el',\n 'phone': 'ph',\n 'user_id': 'uid',\n 'device_id': 'dvid',\n 'url': 'dl'\n};\n\nvar wrapHref = Symbol('wrapHref');\n\nvar Qat = exports.Qat = function () {\n function Qat(_ref) {\n var _this = this;\n\n var buffer = _ref.buffer,\n options = _ref.options;\n\n _classCallCheck(this, Qat);\n\n this.options = options;\n\n gateway.init(options);\n\n this.emit({\n eventCategory: 'system',\n eventAction: 'init'\n });\n\n if (buffer.length) {\n buffer.forEach(function (event) {\n return _this.emit(event);\n });\n }\n\n if (!options.wrapLink) {\n return;\n }\n\n if (document.readyState === 'complete') {\n this[wrapHref]();\n } else {\n window.addEventListener('load', function () {\n return _this[wrapHref]();\n });\n }\n }\n\n _createClass(Qat, [{\n key: wrapHref,\n value: function value() {\n var els = document.getElementsByTagName('a');\n var pattern = null;\n\n if (_typeof(this.options.wrapLink) === 'object') {\n pattern = this.options.wrapLink.pattern;\n }\n\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = els[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var a = _step.value;\n\n\n if (pattern && !pattern.test(a.href)) {\n continue;\n }\n\n var oldhref = a.href;\n a.href = this.options.url + '?rul=' + encodeURIComponent(oldhref);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n }\n }, {\n key: 'emit',\n value: function emit(event) {\n var item = {\n tstamp: Date.now(),\n dl: encodeURIComponent(location.href),\n prp: {}\n };\n\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n\n try {\n for (var _iterator2 = Object.keys(event)[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var key = _step2.value;\n\n\n if (typeof this.options.normalize === 'function') {\n key = this.options.normalize(key);\n }\n\n if (PROP[key]) {\n item[PROP[key]] = event[key];\n } else {\n item.prp[key] = event[key];\n }\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n\n gateway.pushEvent(item);\n }\n }]);\n\n return Qat;\n}();\n\n/**\n * Данное условие проверяет, что библиотека\n * подключена на обычную страницу и не\n * используется как модуль в приложении\n */\n\n\nif (window && window.$qat) {\n window.$qat = new Qat({\n buffer: window.$qat.buffer || [],\n options: window.$qat.options || {}\n });\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9zcmMvaW5kZXguanM/YjYzNSJdLCJuYW1lcyI6WyJnYXRld2F5IiwiR2F0ZXdheSIsIlBST1AiLCJ3cmFwSHJlZiIsIlN5bWJvbCIsIlFhdCIsImJ1ZmZlciIsIm9wdGlvbnMiLCJpbml0IiwiZW1pdCIsImV2ZW50Q2F0ZWdvcnkiLCJldmVudEFjdGlvbiIsImxlbmd0aCIsImZvckVhY2giLCJldmVudCIsIndyYXBMaW5rIiwiZG9jdW1lbnQiLCJyZWFkeVN0YXRlIiwid2luZG93IiwiYWRkRXZlbnRMaXN0ZW5lciIsImVscyIsImdldEVsZW1lbnRzQnlUYWdOYW1lIiwicGF0dGVybiIsImEiLCJ0ZXN0IiwiaHJlZiIsIm9sZGhyZWYiLCJ1cmwiLCJlbmNvZGVVUklDb21wb25lbnQiLCJpdGVtIiwidHN0YW1wIiwiRGF0ZSIsIm5vdyIsImRsIiwibG9jYXRpb24iLCJwcnAiLCJPYmplY3QiLCJrZXlzIiwia2V5Iiwibm9ybWFsaXplIiwicHVzaEV2ZW50IiwiJHFhdCJdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7QUFBQTs7OztBQUVBLElBQU1BLFVBQVUsSUFBSUMsZ0JBQUosRUFBaEI7O0FBRUEsSUFBTUMsT0FBTztBQUNYLGFBQVcsS0FEQTtBQUVYLGlCQUFlLElBRko7QUFHWCxtQkFBaUIsSUFITjtBQUlYLGdCQUFjLElBSkg7QUFLWCxXQU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9ydWw9JHtlbmNvZGVVUklDb21wb25lbnQob2xkaHJlZil9YDtcbiAgICB9XG4gIH1cblxuICBlbWl0KGV2ZW50KSB7XG4gICAgY29uc3QgaXRlbSA9IHtcbiAgICAgIHRzdGFtcDogRGF0ZS5ub3coKSxcbiAgICAgIGRsOiBlbmNvZGVVUklDb21wb25lbnQobG9jYXRpb24uaHJlZiksXG4gICAgICBwcnA6IHt9XG4gICAgfTtcblxuICAgIGZvciAobGV0IGtleSBvZiBPYmplY3Qua2V5cyhldmVudCkpIHtcblxuICAgICAgaWYgKHR5cGVvZiB0aGlzLm9wdGlvbnMubm9ybWFsaXplID09PSAnZnVuY3Rpb24nKSB7XG4gICAgICAgIGtleSA9IHRoaXMub3B0aW9ucy5ub3JtYWxpemUoa2V5KTtcbiAgICAgIH1cblxuICAgICAgaWYgKFBST1Bba2V5XSkge1xuICAgICAgICBpdGVtW1BST1Bba2V5XV0gPSBldmVudFtrZXldO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgaXRlbS5wcnBba2V5XSA9IGV2ZW50W2tleV07XG4gICAgICB9XG4gICAgfVxuXG4gICAgZ2F0ZXdheS5wdXNoRXZlbnQoaXRlbSk7XG4gIH1cblxufVxuXG4vKipcbiAqINCU0LDQvdC90L7QtSDRg9GB0LvQvtCy0LjQtSDQv9GA0L7QstC10YDRj9C10YIsINGH0YLQviDQsdC40LHQu9C40L7RgtC10LrQsFxuICog0L/QvtC00LrQu9GO0YfQtdC90LAg0L3QsCDQvtCx0YvRh9C90YPRjiDRgdGC0YDQsNC90LjRhtGDINC4INC90LVcbiAqINC40YHQv9C+0LvRjNC30YPQtdGC0YHRjyDQutCw0Log0LzQvtC00YPQu9GMINCyINC/0YDQuNC70L7QttC10L3QuNC4XG4gKi9cbmlmICh3aW5kb3cgJiYgd2luZG93LiRxYXQpIHtcbiAgd2luZG93LiRxYXQgPSBuZXcgUWF0KHtcbiAgICBidWZmZXI6IHdpbmRvdy4kcWF0LmJ1ZmZlciB8fCBbXSxcbiAgICBvcHRpb25zOiB3aW5kb3cuJHFhdC5vcHRpb25zIHx8IHt9LFxuICB9KTtcbn1cblxuXG5cblxuXG5cblxuXG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///0\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Gateway = exports.Gateway = function () {\n function Gateway() {\n _classCallCheck(this, Gateway);\n\n this.buffer = [];\n this.timeout = null;\n this.options = {};\n }\n\n _createClass(Gateway, [{\n key: 'init',\n value: function init(_ref) {\n var url = _ref.url,\n _ref$timeout = _ref.timeout,\n timeout = _ref$timeout === undefined ? 5000 : _ref$timeout;\n\n this.options.url = url;\n this.options.timeout = timeout;\n }\n }, {\n key: 'pushEvent',\n value: function pushEvent(event) {\n var _this = this;\n\n this.buffer.push(event);\n\n if (this.timeout) {\n clearTimeout(this.timeout);\n }\n\n this.timeout = setTimeout(function () {\n return _this.send();\n }, this.options.timeout);\n }\n }, {\n key: 'toQuery',\n value: function toQuery(items) {\n var count = 0;\n var query = [];\n\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = items[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var item = _step.value;\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n\n try {\n\n for (var _iterator2 = Object.keys(item)[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var key = _step2.value;\n\n var value = item[key];\n\n if (value && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object') {\n value = JSON.stringify(value);\n }\n\n query.push('' + key + count + '=' + encodeURI(value));\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n\n count += 1;\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n return query.join('&');\n }\n }, {\n key: 'send',\n value: function send() {\n\n if (!this.options.url) {\n throw new Error('Нужно инициализировать аналитический модуль!');\n }\n\n var url = this.options.url + '?' + this.toQuery(this.buffer);\n\n if (navigator && navigator.product === 'ReactNative') {\n fetch(url).catch();\n } else {\n var img = new Image();\n img.src = url;\n }\n this.buffer = [];\n }\n }]);\n\n return Gateway;\n}();//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9zcmMvZ2F0ZXdheS5qcz81NmFmIl0sIm5hbWVzIjpbIkdhdGV3YXkiLCJidWZmZXIiLCJ0aW1lb3V0Iiwib3B0aW9ucyIsInVybCIsImV2ZW50IiwicHVzaCIsImNsZWFyVGltZ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ZXQgdmFsdWUgPSBpdGVtW2tleV07XG5cbiAgICAgICAgaWYgKHZhbHVlICYmIHR5cGVvZiB2YWx1ZSA9PT0gJ29iamVjdCcpIHtcbiAgICAgICAgICB2YWx1ZSA9IEpTT04uc3RyaW5naWZ5KHZhbHVlKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHF1ZXJ5LnB1c2goYCR7a2V5fSR7Y291bnR9PSR7ZW5jb2RlVVJJKHZhbHVlKX1gKTtcbiAgICAgIH1cblxuICAgICAgY291bnQgKz0gMTtcbiAgICB9XG5cbiAgICByZXR1cm4gcXVlcnkuam9pbignJicpO1xuICB9XG5cbiAgc2VuZCgpIHtcblxuICAgIGlmICghdGhpcy5vcHRpb25zLnVybCkge1xuICAgICAgdGhyb3cgbmV3IEVycm9yKCfQndGD0LbQvdC+INC40L3QuNGG0LjQsNC70LjQt9C40YDQvtCy0LDRgtGMINCw0L3QsNC70LjRgtC40YfQtdGB0LrQuNC5INC80L7QtNGD0LvRjCEnKTtcbiAgICB9XG5cbiAgICBjb25zdCB1cmwgPSBgJHt0aGlzLm9wdGlvbnMudXJsfT8ke3RoaXMudG9RdWVyeSh0aGlzLmJ1ZmZlcil9YDtcblxuICAgIGlmIChuYXZpZ2F0b3IgJiYgbmF2aWdhdG9yLnByb2R1Y3QgPT09ICdSZWFjdE5hdGl2ZScpIHtcbiAgICAgIGZldGNoKHVybCkuY2F0Y2goKTtcbiAgICB9IGVsc2Uge1xuICAgICAgY29uc3QgaW1nID0gbmV3IEltYWdlKCk7XG4gICAgICBpbWcuc3JjID0gdXJsO1xuICAgIH1cbiAgICB0aGlzLmJ1ZmZlciA9IFtdO1xuICB9XG5cbn0iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///1\n")}]); |
{ | ||
"name": "@qlean/analytics-client", | ||
"version": "0.4.2", | ||
"version": "0.5.0", | ||
"description": "Клиент для платформы аналитики", | ||
"main": "./src/index.js", | ||
"scripts": { | ||
"build": "webpack" | ||
"build": "webpack", | ||
"serv": "static" | ||
}, | ||
@@ -19,3 +20,5 @@ "repository": { | ||
"homepage": "https://gitlab.qleanlabs.ru/cloud-platform/modules/browser-logger", | ||
"dependencies": {}, | ||
"dependencies": { | ||
"static": "^2.0.0" | ||
}, | ||
"devDependencies": { | ||
@@ -22,0 +25,0 @@ "babel-preset-latest": "^6.24.1", |
@@ -18,3 +18,3 @@ ## Qlean аналитика | ||
script: 'https://storage.googleapis.com/pltf-analytics-dp-clfn-storage/public/bundle.js', | ||
url: 'https://anlt.cloud.qlean.ru/сollect', | ||
url: 'https://anlt.cloud.qlean.ru/collect', | ||
timeout: 5000, | ||
@@ -72,2 +72,3 @@ wrapLink: true | ||
Для отправки события в clickstream нужно выполнить следующий код. | ||
```html | ||
@@ -87,2 +88,13 @@ <script> | ||
Следующие поля будут разложены по колонкам в clickstream: | ||
- eventId | ||
- eventAction | ||
- eventCategory | ||
- eventLabel | ||
- phone | ||
- user_id | ||
- device_id | ||
Все остальные поля будут упакованы в виде *json* объекта в поле *eventProperties*. | ||
## Использование библиотеки как модуля | ||
@@ -143,6 +155,2 @@ | ||
// трекинг переходов | ||
<a href="//anlt.cloud.qlean.ru/collect?eid=123&ea0=page_view&ec0=load&el0=ok&rul=%2F%2Fgoogle.com"/> | ||
``` | ||
@@ -162,2 +170,12 @@ Все параметры события передаются в качестве параметров querystring: | ||
Обратите вниманание, в одном пикселе может быть передано одно или более событие. Для их идексации используется цифра после имени параметра, | ||
например `eid0` - это идентификатор первого события | ||
например `eid0` - это идентификатор первого события | ||
## Трекинг переходов | ||
Для отслеживания переходов пользователя, необходимо заменить существуюущую ссылку на следующу | ||
```html | ||
// трекинг переходов | ||
<a href="http://anlt.cloud.qlean.ru/collect?rul=https%3A%2F%2Fqlean.ru%2F%3Futm_source%3D1%26utm_medium%3D2%26utm_campaign%3D3"/> | ||
``` | ||
Где в параметре *rul* передается ссылка куда нужно перейти в заэкножена через encodeURIComponent. |
@@ -25,2 +25,7 @@ import { Gateway } from './gateway'; | ||
this.emit({ | ||
eventCategory: 'system', | ||
eventAction: 'init' | ||
}); | ||
if (buffer.length) { | ||
@@ -57,11 +62,3 @@ buffer.forEach(event => this.emit(event)); | ||
const oldhref = a.href; | ||
a.href = `${this.options.url}?${gateway.toQuery([ | ||
{ | ||
[PROP.eventCategory]: 'redirect', | ||
[PROP.eventAction]: 'link', | ||
tstamp: Date.now(), | ||
dl: encodeURIComponent(a.href) | ||
} | ||
])}&rul=${encodeURIComponent(oldhref)}` | ||
a.href = `${this.options.url}?rul=${encodeURIComponent(oldhref)}`; | ||
} | ||
@@ -68,0 +65,0 @@ } |
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
33931
176
1
142
+ Addedstatic@^2.0.0
+ Addedamdefine@1.0.1(transitive)
+ Addedasync@0.1.220.2.10(transitive)
+ Addedboolbase@1.0.0(transitive)
+ Addedcheerio@0.12.0(transitive)
+ Addedcheerio-select@2.1.0(transitive)
+ Addedcore-util-is@1.0.3(transitive)
+ Addedcss-select@5.1.0(transitive)
+ Addedcss-what@6.1.0(transitive)
+ Addeddom-serializer@2.0.0(transitive)
+ Addeddomelementtype@1.3.12.3.0(transitive)
+ Addeddomhandler@2.0.35.0.3(transitive)
+ Addeddomutils@1.1.63.1.0(transitive)
+ Addedentities@0.5.04.5.0(transitive)
+ Addedhandlebars@1.0.12(transitive)
+ Addedhighlight.js@7.3.0(transitive)
+ Addedhtmlparser2@3.1.1(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedisarray@0.0.1(transitive)
+ Addedmarked@0.2.7(transitive)
+ Addednth-check@2.1.1(transitive)
+ Addedoptimist@0.3.7(transitive)
+ Addedreadable-stream@1.0.34(transitive)
+ Addedsource-map@0.1.43(transitive)
+ Addedstatic@2.0.0(transitive)
+ Addedstring_decoder@0.10.31(transitive)
+ Addeduglify-js@2.3.6(transitive)
+ Addedunderscore@1.4.2(transitive)
+ Addedwordwrap@0.0.3(transitive)