@webtrekk-smart-pixel/angular 1.0.2 → 1.1.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/README.md +3 -3
- package/{dist/smart-pixel-angular.umd.js → bundles/webtrekk-smart-pixel-angular.umd.js} +268 -278
- package/bundles/webtrekk-smart-pixel-angular.umd.js.map +1 -0
- package/esm2015/lib/Directives/ContentEngagementDirective.js +31 -0
- package/esm2015/lib/Directives/ContentEngagementDirective.ngsummary.json +1 -0
- package/esm2015/lib/Directives/DataDirective.js +66 -0
- package/esm2015/lib/Directives/DataDirective.ngsummary.json +1 -0
- package/esm2015/lib/Directives/DataTypes.js +2 -0
- package/esm2015/lib/Directives/DataTypes.ngsummary.json +1 -0
- package/esm2015/lib/Directives/ExtensionDirective.js +25 -0
- package/esm2015/lib/Directives/ExtensionDirective.ngsummary.json +1 -0
- package/esm2015/lib/Directives/ProductListDirective.js +30 -0
- package/esm2015/lib/Directives/ProductListDirective.ngsummary.json +1 -0
- package/esm2015/lib/Directives/TeaserDirective.js +31 -0
- package/esm2015/lib/Directives/TeaserDirective.ngsummary.json +1 -0
- package/esm2015/lib/WebtrekkSmartPixelAngular.js +132 -0
- package/esm2015/lib/WebtrekkSmartPixelAngular.ngsummary.json +1 -0
- package/esm2015/lib/WebtrekkSmartPixelAutoTracking.js +44 -0
- package/esm2015/lib/WebtrekkSmartPixelAutoTracking.ngfactory.js +14 -0
- package/esm2015/lib/WebtrekkSmartPixelAutoTracking.ngsummary.json +1 -0
- package/esm2015/lib/WebtrekkSmartPixelConfig.js +12 -0
- package/esm2015/lib/WebtrekkSmartPixelConfig.ngsummary.json +1 -0
- package/esm2015/lib/WebtrekkSmartPixelModule.js +54 -0
- package/esm2015/lib/WebtrekkSmartPixelModule.ngfactory.js +15 -0
- package/esm2015/lib/WebtrekkSmartPixelModule.ngsummary.json +1 -0
- package/esm2015/lib/WebtrekkSmartPixelToken.js +3 -0
- package/esm2015/lib/WebtrekkSmartPixelToken.ngsummary.json +1 -0
- package/esm2015/public-api.js +22 -0
- package/esm2015/public-api.ngsummary.json +1 -0
- package/esm2015/webtrekk-smart-pixel-angular.js +6 -0
- package/esm2015/webtrekk-smart-pixel-angular.ngsummary.json +1 -0
- package/fesm2015/webtrekk-smart-pixel-angular.js +421 -0
- package/fesm2015/webtrekk-smart-pixel-angular.js.map +1 -0
- package/lib/Directives/ContentEngagementDirective.d.ts +10 -0
- package/lib/Directives/DataDirective.d.ts +17 -0
- package/lib/Directives/DataTypes.d.ts +174 -0
- package/lib/Directives/ExtensionDirective.d.ts +9 -0
- package/lib/Directives/ProductListDirective.d.ts +10 -0
- package/lib/Directives/TeaserDirective.d.ts +10 -0
- package/lib/WebtrekkSmartPixelAngular.d.ts +19 -0
- package/lib/WebtrekkSmartPixelAutoTracking.d.ts +9 -0
- package/lib/WebtrekkSmartPixelAutoTracking.ngfactory.d.ts +3 -0
- package/lib/WebtrekkSmartPixelConfig.d.ts +22 -0
- package/lib/WebtrekkSmartPixelModule.d.ts +5 -0
- package/lib/WebtrekkSmartPixelModule.ngfactory.d.ts +3 -0
- package/lib/WebtrekkSmartPixelToken.d.ts +3 -0
- package/package.json +19 -6
- package/public-api.d.ts +17 -0
- package/webtrekk-smart-pixel-angular.d.ts +6 -0
- package/webtrekk-smart-pixel-angular.metadata.json +1 -0
- package/CHANGELOG.md +0 -31
- package/index.js +0 -4
package/README.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# Webtrekk Smart Pixel - Angular
|
|
2
2
|
|
|
3
3
|
[Site](https://www.webtrekk.com/) |
|
|
4
|
-
[Docs](https://
|
|
5
|
-
[Support](https://
|
|
6
|
-
[Changelog](
|
|
4
|
+
[Docs](https://documentation.mapp.com/latest/en/angular-15741405.html) |
|
|
5
|
+
[Support](https://github.com/Webtrekk/Webtrekk-Smart-Pixel/issues) |
|
|
6
|
+
[Changelog](./CHANGELOG.md)
|
|
7
7
|
|
|
8
8
|
A Angular implementation of the Webtrekk Smart Pixel.
|
|
9
9
|
|
|
@@ -1,45 +1,144 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
2
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@webtrekk-smart-pixel/core'), require('@angular/router'), require('rxjs/operators')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', '@angular/core', '@webtrekk-smart-pixel/core', '@angular/router', 'rxjs/operators'], factory) :
|
|
4
|
-
(global = global || self, factory(global[
|
|
5
|
-
}(this, (function (exports, core, wtSmart, router, operators) { 'use strict';
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@webtrekk-smart-pixel/angular', ['exports', '@angular/core', '@webtrekk-smart-pixel/core', '@angular/router', 'rxjs/operators'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global["webtrekk-smart-pixel"] = global["webtrekk-smart-pixel"] || {}, global["webtrekk-smart-pixel"].angular = {}), global.ng.core, global.wtSmart, global.ng.router, global.rxjs.operators));
|
|
5
|
+
})(this, (function (exports, core, wtSmart, router, operators) { 'use strict';
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
7
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
|
+
|
|
9
|
+
var wtSmart__default = /*#__PURE__*/_interopDefaultLegacy(wtSmart);
|
|
10
|
+
|
|
11
|
+
var pixel_;
|
|
12
|
+
var getWindow_ = function () {
|
|
13
|
+
return ((typeof window !== 'undefined') ? window : null);
|
|
14
|
+
};
|
|
15
|
+
var ɵ0 = getWindow_;
|
|
16
|
+
var getDocument_ = function () {
|
|
17
|
+
return ((typeof window !== 'undefined' && typeof window.document !== 'undefined') ? window.document : null);
|
|
18
|
+
};
|
|
19
|
+
var ɵ1 = getDocument_;
|
|
20
|
+
var init_ = function () {
|
|
21
|
+
var window_ = getWindow_();
|
|
22
|
+
var document_ = getDocument_();
|
|
23
|
+
if (window_ !== null && document_ !== null) {
|
|
24
|
+
pixel_ = wtSmart__default["default"].use(window_, document_);
|
|
25
|
+
// @ts-ignore
|
|
26
|
+
window_['wtSmart'] = pixel_;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
var ɵ2 = init_;
|
|
30
|
+
var WebtrekkSmartPixelAngular = /** @class */ (function () {
|
|
31
|
+
function WebtrekkSmartPixelAngular() {
|
|
32
|
+
}
|
|
33
|
+
WebtrekkSmartPixelAngular.prototype.call = function (call) {
|
|
34
|
+
if (!pixel_) {
|
|
35
|
+
init_();
|
|
36
|
+
}
|
|
37
|
+
if (pixel_) {
|
|
38
|
+
pixel_.push(call);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
WebtrekkSmartPixelAngular.prototype.init = function (data) {
|
|
42
|
+
this.call(function (pix) {
|
|
43
|
+
pix.init.add(data);
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
WebtrekkSmartPixelAngular.prototype.advanced = function (data) {
|
|
47
|
+
this.call(function (pix) {
|
|
48
|
+
pix.advanced.add(data);
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
WebtrekkSmartPixelAngular.prototype.page = function (name, data) {
|
|
52
|
+
this.call(function (pix) {
|
|
53
|
+
if (typeof name === 'string') {
|
|
54
|
+
pix.page.data.add(name, data);
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
pix.page.data.add(name);
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
WebtrekkSmartPixelAngular.prototype.action = function (name, data) {
|
|
62
|
+
this.call(function (pix) {
|
|
63
|
+
if (typeof name === 'string') {
|
|
64
|
+
pix.action.data.add(name, data);
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
pix.action.data.add(name);
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
WebtrekkSmartPixelAngular.prototype.session = function (data) {
|
|
72
|
+
this.call(function (pix) {
|
|
73
|
+
pix.session.data.add(data);
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
WebtrekkSmartPixelAngular.prototype.campaign = function (data) {
|
|
77
|
+
this.call(function (pix) {
|
|
78
|
+
pix.campaign.data.add(data);
|
|
79
|
+
});
|
|
80
|
+
};
|
|
81
|
+
WebtrekkSmartPixelAngular.prototype.customer = function (id, data, validation) {
|
|
82
|
+
this.call(function (pix) {
|
|
83
|
+
if (typeof id === 'string') {
|
|
84
|
+
pix.customer.data.add(id, data, validation);
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
pix.customer.data.add(id);
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
};
|
|
91
|
+
WebtrekkSmartPixelAngular.prototype.product = function (action, data) {
|
|
92
|
+
this.call(function (pix) {
|
|
93
|
+
var method = (action === 'view' || action === 'basket') ? 'set' : 'add';
|
|
94
|
+
// @ts-ignore
|
|
95
|
+
pix.product[action].data[method]([data]);
|
|
96
|
+
});
|
|
97
|
+
};
|
|
98
|
+
WebtrekkSmartPixelAngular.prototype.products = function (action, data) {
|
|
99
|
+
this.call(function (pix) {
|
|
100
|
+
var method = (action === 'view' || action === 'basket') ? 'set' : 'add';
|
|
101
|
+
// @ts-ignore
|
|
102
|
+
pix.product[action].data[method](data);
|
|
103
|
+
});
|
|
104
|
+
};
|
|
105
|
+
WebtrekkSmartPixelAngular.prototype.order = function (data) {
|
|
106
|
+
this.call(function (pix) {
|
|
107
|
+
pix.order.data.add(data);
|
|
108
|
+
});
|
|
109
|
+
};
|
|
110
|
+
WebtrekkSmartPixelAngular.prototype.extension = function (extension, action, config) {
|
|
111
|
+
if (!extension) {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
if (!action) {
|
|
115
|
+
action = 'activate';
|
|
116
|
+
}
|
|
117
|
+
this.call(function (pix) {
|
|
118
|
+
// @ts-ignore
|
|
119
|
+
pix.extension[extension][action](config);
|
|
120
|
+
});
|
|
121
|
+
};
|
|
122
|
+
WebtrekkSmartPixelAngular.prototype.track = function (keepData) {
|
|
123
|
+
this.call(function (pix) {
|
|
124
|
+
pix.track(keepData);
|
|
125
|
+
});
|
|
126
|
+
};
|
|
127
|
+
WebtrekkSmartPixelAngular.prototype.trackPage = function (keepData) {
|
|
128
|
+
this.call(function (pix) {
|
|
129
|
+
pix.trackPage(keepData);
|
|
130
|
+
});
|
|
131
|
+
};
|
|
132
|
+
WebtrekkSmartPixelAngular.prototype.trackAction = function (keepData) {
|
|
133
|
+
this.call(function (pix) {
|
|
134
|
+
pix.trackAction(keepData);
|
|
135
|
+
});
|
|
136
|
+
};
|
|
137
|
+
return WebtrekkSmartPixelAngular;
|
|
138
|
+
}());
|
|
139
|
+
WebtrekkSmartPixelAngular.decorators = [
|
|
140
|
+
{ type: core.Injectable }
|
|
141
|
+
];
|
|
43
142
|
|
|
44
143
|
var directiveSelector = '[wt-advanced-data],'
|
|
45
144
|
+ '[wt-campaign-data],'
|
|
@@ -62,7 +161,7 @@
|
|
|
62
161
|
this.pixel.campaign(this.wtCampaignData);
|
|
63
162
|
}
|
|
64
163
|
if (this.wtCustomerData) {
|
|
65
|
-
this.pixel.customer(this.wtCustomerData.id, this.wtCustomerData, this.wtCustomerData.validation);
|
|
164
|
+
this.pixel.customer(this.wtCustomerData && this.wtCustomerData.id ? this.wtCustomerData.id : this.wtCustomerData, this.wtCustomerData, this.wtCustomerData.validation);
|
|
66
165
|
}
|
|
67
166
|
if (this.wtInitData) {
|
|
68
167
|
this.pixel.init(this.wtInitData);
|
|
@@ -71,10 +170,10 @@
|
|
|
71
170
|
this.pixel.order(this.wtOrderData);
|
|
72
171
|
}
|
|
73
172
|
if (this.wtPageData) {
|
|
74
|
-
this.pixel.page(this.wtPageData.name, this.wtPageData);
|
|
173
|
+
this.pixel.page(this.wtPageData && this.wtPageData.name ? this.wtPageData.name : this.wtPageData, this.wtPageData);
|
|
75
174
|
}
|
|
76
175
|
if (this.wtProductData) {
|
|
77
|
-
this.pixel.product(this.wtProductData.action, this.wtProductData);
|
|
176
|
+
this.pixel.product(this.wtProductData && this.wtProductData.action ? this.wtProductData.action : 'view', this.wtProductData);
|
|
78
177
|
}
|
|
79
178
|
if (this.wtSessionData) {
|
|
80
179
|
this.pixel.session(this.wtSessionData);
|
|
@@ -85,40 +184,27 @@
|
|
|
85
184
|
}, 0);
|
|
86
185
|
}
|
|
87
186
|
};
|
|
88
|
-
__decorate([
|
|
89
|
-
core.Input('wt-advanced-data')
|
|
90
|
-
], DataDirective.prototype, "wtAdvancedData", void 0);
|
|
91
|
-
__decorate([
|
|
92
|
-
core.Input('wt-campaign-data')
|
|
93
|
-
], DataDirective.prototype, "wtCampaignData", void 0);
|
|
94
|
-
__decorate([
|
|
95
|
-
core.Input('wt-customer-data')
|
|
96
|
-
], DataDirective.prototype, "wtCustomerData", void 0);
|
|
97
|
-
__decorate([
|
|
98
|
-
core.Input('wt-init-data')
|
|
99
|
-
], DataDirective.prototype, "wtInitData", void 0);
|
|
100
|
-
__decorate([
|
|
101
|
-
core.Input('wt-order-data')
|
|
102
|
-
], DataDirective.prototype, "wtOrderData", void 0);
|
|
103
|
-
__decorate([
|
|
104
|
-
core.Input('wt-page-data')
|
|
105
|
-
], DataDirective.prototype, "wtPageData", void 0);
|
|
106
|
-
__decorate([
|
|
107
|
-
core.Input('wt-product-data')
|
|
108
|
-
], DataDirective.prototype, "wtProductData", void 0);
|
|
109
|
-
__decorate([
|
|
110
|
-
core.Input('wt-session-data')
|
|
111
|
-
], DataDirective.prototype, "wtSessionData", void 0);
|
|
112
|
-
__decorate([
|
|
113
|
-
core.Input('wt-track')
|
|
114
|
-
], DataDirective.prototype, "wtTrack", void 0);
|
|
115
|
-
DataDirective = __decorate([
|
|
116
|
-
core.Directive({
|
|
117
|
-
selector: directiveSelector
|
|
118
|
-
})
|
|
119
|
-
], DataDirective);
|
|
120
187
|
return DataDirective;
|
|
121
188
|
}());
|
|
189
|
+
DataDirective.decorators = [
|
|
190
|
+
{ type: core.Directive, args: [{
|
|
191
|
+
selector: directiveSelector
|
|
192
|
+
},] }
|
|
193
|
+
];
|
|
194
|
+
DataDirective.ctorParameters = function () { return [
|
|
195
|
+
{ type: WebtrekkSmartPixelAngular }
|
|
196
|
+
]; };
|
|
197
|
+
DataDirective.propDecorators = {
|
|
198
|
+
wtAdvancedData: [{ type: core.Input, args: ['wt-advanced-data',] }],
|
|
199
|
+
wtCampaignData: [{ type: core.Input, args: ['wt-campaign-data',] }],
|
|
200
|
+
wtCustomerData: [{ type: core.Input, args: ['wt-customer-data',] }],
|
|
201
|
+
wtInitData: [{ type: core.Input, args: ['wt-init-data',] }],
|
|
202
|
+
wtOrderData: [{ type: core.Input, args: ['wt-order-data',] }],
|
|
203
|
+
wtPageData: [{ type: core.Input, args: ['wt-page-data',] }],
|
|
204
|
+
wtProductData: [{ type: core.Input, args: ['wt-product-data',] }],
|
|
205
|
+
wtSessionData: [{ type: core.Input, args: ['wt-session-data',] }],
|
|
206
|
+
wtTrack: [{ type: core.Input, args: ['wt-track',] }]
|
|
207
|
+
};
|
|
122
208
|
|
|
123
209
|
var TeaserDirective = /** @class */ (function () {
|
|
124
210
|
function TeaserDirective(elementRef, pixel) {
|
|
@@ -129,23 +215,27 @@
|
|
|
129
215
|
var _this = this;
|
|
130
216
|
this.pixel.call(function (pix) {
|
|
131
217
|
pix.extension.teaser_tracking.add({
|
|
132
|
-
selector:
|
|
218
|
+
selector: _this.wtTeaserElement && _this.wtTeaserElement.selector ? _this.wtTeaserElement.selector : _this.elementRef.nativeElement,
|
|
133
219
|
data: _this.wtTeaserElement,
|
|
134
220
|
conversion: _this.wtTeaserElement
|
|
135
221
|
});
|
|
136
222
|
});
|
|
137
223
|
};
|
|
138
|
-
__decorate([
|
|
139
|
-
core.Input('wt-teaser')
|
|
140
|
-
], TeaserDirective.prototype, "wtTeaserElement", void 0);
|
|
141
|
-
TeaserDirective = __decorate([
|
|
142
|
-
core.Directive({
|
|
143
|
-
selector: '[wt-teaser]',
|
|
144
|
-
exportAs: 'wt-teaser'
|
|
145
|
-
})
|
|
146
|
-
], TeaserDirective);
|
|
147
224
|
return TeaserDirective;
|
|
148
225
|
}());
|
|
226
|
+
TeaserDirective.decorators = [
|
|
227
|
+
{ type: core.Directive, args: [{
|
|
228
|
+
selector: '[wt-teaser]',
|
|
229
|
+
exportAs: 'wt-teaser'
|
|
230
|
+
},] }
|
|
231
|
+
];
|
|
232
|
+
TeaserDirective.ctorParameters = function () { return [
|
|
233
|
+
{ type: core.ElementRef },
|
|
234
|
+
{ type: WebtrekkSmartPixelAngular }
|
|
235
|
+
]; };
|
|
236
|
+
TeaserDirective.propDecorators = {
|
|
237
|
+
wtTeaserElement: [{ type: core.Input, args: ['wt-teaser',] }]
|
|
238
|
+
};
|
|
149
239
|
|
|
150
240
|
var ProductListDirective = /** @class */ (function () {
|
|
151
241
|
function ProductListDirective(elementRef, pixel) {
|
|
@@ -156,22 +246,26 @@
|
|
|
156
246
|
var _this = this;
|
|
157
247
|
this.pixel.call(function (pix) {
|
|
158
248
|
pix.extension.product_list_tracking.add({
|
|
159
|
-
selector:
|
|
249
|
+
selector: _this.wtProductListElement && _this.wtProductListElement.selector ? _this.wtProductListElement.selector : _this.elementRef.nativeElement,
|
|
160
250
|
data: _this.wtProductListElement
|
|
161
251
|
});
|
|
162
252
|
});
|
|
163
253
|
};
|
|
164
|
-
__decorate([
|
|
165
|
-
core.Input('wt-product-list')
|
|
166
|
-
], ProductListDirective.prototype, "wtProductListElement", void 0);
|
|
167
|
-
ProductListDirective = __decorate([
|
|
168
|
-
core.Directive({
|
|
169
|
-
selector: '[wt-product-list]',
|
|
170
|
-
exportAs: 'wt-product-list'
|
|
171
|
-
})
|
|
172
|
-
], ProductListDirective);
|
|
173
254
|
return ProductListDirective;
|
|
174
255
|
}());
|
|
256
|
+
ProductListDirective.decorators = [
|
|
257
|
+
{ type: core.Directive, args: [{
|
|
258
|
+
selector: '[wt-product-list]',
|
|
259
|
+
exportAs: 'wt-product-list'
|
|
260
|
+
},] }
|
|
261
|
+
];
|
|
262
|
+
ProductListDirective.ctorParameters = function () { return [
|
|
263
|
+
{ type: core.ElementRef },
|
|
264
|
+
{ type: WebtrekkSmartPixelAngular }
|
|
265
|
+
]; };
|
|
266
|
+
ProductListDirective.propDecorators = {
|
|
267
|
+
wtProductListElement: [{ type: core.Input, args: ['wt-product-list',] }]
|
|
268
|
+
};
|
|
175
269
|
|
|
176
270
|
var ContentEngagementDirective = /** @class */ (function () {
|
|
177
271
|
function ContentEngagementDirective(elementRef, pixel) {
|
|
@@ -182,171 +276,51 @@
|
|
|
182
276
|
var _this = this;
|
|
183
277
|
this.pixel.call(function (pix) {
|
|
184
278
|
pix.extension.content_engagement.add({
|
|
185
|
-
selector:
|
|
186
|
-
name: _this.wtContentEngagementElement.name,
|
|
279
|
+
selector: _this.wtContentEngagementElement && _this.wtContentEngagementElement.selector ? _this.wtContentEngagementElement.selector : _this.elementRef.nativeElement,
|
|
280
|
+
name: _this.wtContentEngagementElement && _this.wtContentEngagementElement.name ? _this.wtContentEngagementElement.name : '',
|
|
187
281
|
config: _this.wtContentEngagementElement
|
|
188
282
|
});
|
|
189
283
|
});
|
|
190
284
|
};
|
|
191
|
-
__decorate([
|
|
192
|
-
core.Input('wt-content-engagement')
|
|
193
|
-
], ContentEngagementDirective.prototype, "wtContentEngagementElement", void 0);
|
|
194
|
-
ContentEngagementDirective = __decorate([
|
|
195
|
-
core.Directive({
|
|
196
|
-
selector: '[wt-content-engagement]',
|
|
197
|
-
exportAs: 'wt-content-engagement'
|
|
198
|
-
})
|
|
199
|
-
], ContentEngagementDirective);
|
|
200
285
|
return ContentEngagementDirective;
|
|
201
286
|
}());
|
|
287
|
+
ContentEngagementDirective.decorators = [
|
|
288
|
+
{ type: core.Directive, args: [{
|
|
289
|
+
selector: '[wt-content-engagement]',
|
|
290
|
+
exportAs: 'wt-content-engagement'
|
|
291
|
+
},] }
|
|
292
|
+
];
|
|
293
|
+
ContentEngagementDirective.ctorParameters = function () { return [
|
|
294
|
+
{ type: core.ElementRef },
|
|
295
|
+
{ type: WebtrekkSmartPixelAngular }
|
|
296
|
+
]; };
|
|
297
|
+
ContentEngagementDirective.propDecorators = {
|
|
298
|
+
wtContentEngagementElement: [{ type: core.Input, args: ['wt-content-engagement',] }]
|
|
299
|
+
};
|
|
202
300
|
|
|
203
301
|
var ExtensionDirective = /** @class */ (function () {
|
|
204
302
|
function ExtensionDirective(pixel) {
|
|
205
303
|
this.pixel = pixel;
|
|
206
304
|
}
|
|
207
305
|
ExtensionDirective.prototype.ngAfterContentInit = function () {
|
|
208
|
-
|
|
306
|
+
if (this.wtExtensionData) {
|
|
307
|
+
this.pixel.extension(this.wtExtensionData.name, this.wtExtensionData.action, this.wtExtensionData.config);
|
|
308
|
+
}
|
|
209
309
|
};
|
|
210
|
-
__decorate([
|
|
211
|
-
core.Input('wt-extension')
|
|
212
|
-
], ExtensionDirective.prototype, "wtExtensionData", void 0);
|
|
213
|
-
ExtensionDirective = __decorate([
|
|
214
|
-
core.Directive({
|
|
215
|
-
selector: '[wt-extension]',
|
|
216
|
-
exportAs: 'wt-extension'
|
|
217
|
-
})
|
|
218
|
-
], ExtensionDirective);
|
|
219
310
|
return ExtensionDirective;
|
|
220
311
|
}());
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
312
|
+
ExtensionDirective.decorators = [
|
|
313
|
+
{ type: core.Directive, args: [{
|
|
314
|
+
selector: '[wt-extension]',
|
|
315
|
+
exportAs: 'wt-extension'
|
|
316
|
+
},] }
|
|
317
|
+
];
|
|
318
|
+
ExtensionDirective.ctorParameters = function () { return [
|
|
319
|
+
{ type: WebtrekkSmartPixelAngular }
|
|
320
|
+
]; };
|
|
321
|
+
ExtensionDirective.propDecorators = {
|
|
322
|
+
wtExtensionData: [{ type: core.Input, args: ['wt-extension',] }]
|
|
225
323
|
};
|
|
226
|
-
var getDocument_ = function () {
|
|
227
|
-
return ((typeof window !== 'undefined' && typeof window.document !== 'undefined') ? window.document : null);
|
|
228
|
-
};
|
|
229
|
-
var emptyObject = {};
|
|
230
|
-
var init_ = function () {
|
|
231
|
-
var window_ = getWindow_();
|
|
232
|
-
var document_ = getDocument_();
|
|
233
|
-
if (window_ !== null && document_ !== null) {
|
|
234
|
-
pixel_ = wtSmart.use(window_, document_);
|
|
235
|
-
window_['wtSmart'] = pixel_;
|
|
236
|
-
}
|
|
237
|
-
};
|
|
238
|
-
var WebtrekkSmartPixelAngular = /** @class */ (function () {
|
|
239
|
-
function WebtrekkSmartPixelAngular() {
|
|
240
|
-
}
|
|
241
|
-
WebtrekkSmartPixelAngular.prototype.call = function (call) {
|
|
242
|
-
if (pixel_ === null) {
|
|
243
|
-
init_();
|
|
244
|
-
}
|
|
245
|
-
if (pixel_ !== null) {
|
|
246
|
-
pixel_.push(call);
|
|
247
|
-
}
|
|
248
|
-
};
|
|
249
|
-
WebtrekkSmartPixelAngular.prototype.init = function (data) {
|
|
250
|
-
if (data === void 0) { data = { trackId: '', trackDomain: '' }; }
|
|
251
|
-
this.call(function (pix) {
|
|
252
|
-
pix.init.add(data);
|
|
253
|
-
});
|
|
254
|
-
};
|
|
255
|
-
WebtrekkSmartPixelAngular.prototype.advanced = function (data) {
|
|
256
|
-
if (data === void 0) { data = emptyObject; }
|
|
257
|
-
this.call(function (pix) {
|
|
258
|
-
pix.advanced.add(data);
|
|
259
|
-
});
|
|
260
|
-
};
|
|
261
|
-
WebtrekkSmartPixelAngular.prototype.page = function (name, data) {
|
|
262
|
-
if (name === void 0) { name = ''; }
|
|
263
|
-
if (data === void 0) { data = emptyObject; }
|
|
264
|
-
this.call(function (pix) {
|
|
265
|
-
pix.page.data.add(name, data);
|
|
266
|
-
});
|
|
267
|
-
};
|
|
268
|
-
WebtrekkSmartPixelAngular.prototype.action = function (data) {
|
|
269
|
-
if (data === void 0) { data = emptyObject; }
|
|
270
|
-
this.call(function (pix) {
|
|
271
|
-
pix.action.data.add(data);
|
|
272
|
-
});
|
|
273
|
-
};
|
|
274
|
-
WebtrekkSmartPixelAngular.prototype.session = function (data) {
|
|
275
|
-
if (data === void 0) { data = emptyObject; }
|
|
276
|
-
this.call(function (pix) {
|
|
277
|
-
pix.session.data.add(data);
|
|
278
|
-
});
|
|
279
|
-
};
|
|
280
|
-
WebtrekkSmartPixelAngular.prototype.campaign = function (data) {
|
|
281
|
-
if (data === void 0) { data = { id: '' }; }
|
|
282
|
-
this.call(function (pix) {
|
|
283
|
-
pix.campaign.data.add(data);
|
|
284
|
-
});
|
|
285
|
-
};
|
|
286
|
-
WebtrekkSmartPixelAngular.prototype.customer = function (id, data, validation) {
|
|
287
|
-
if (id === void 0) { id = ''; }
|
|
288
|
-
if (data === void 0) { data = emptyObject; }
|
|
289
|
-
if (validation === void 0) { validation = false; }
|
|
290
|
-
this.call(function (pix) {
|
|
291
|
-
pix.customer.data.add(id, data, validation);
|
|
292
|
-
});
|
|
293
|
-
};
|
|
294
|
-
WebtrekkSmartPixelAngular.prototype.product = function (action, data) {
|
|
295
|
-
if (action === void 0) { action = 'view'; }
|
|
296
|
-
if (data === void 0) { data = { id: '' }; }
|
|
297
|
-
this.call(function (pix) {
|
|
298
|
-
var method = (action === 'view' || action === 'basket') ? 'set' : 'add';
|
|
299
|
-
pix.product[action].data[method]([data]);
|
|
300
|
-
});
|
|
301
|
-
};
|
|
302
|
-
WebtrekkSmartPixelAngular.prototype.products = function (action, data) {
|
|
303
|
-
if (action === void 0) { action = 'view'; }
|
|
304
|
-
if (data === void 0) { data = []; }
|
|
305
|
-
this.call(function (pix) {
|
|
306
|
-
var method = (action === 'view' || action === 'basket') ? 'set' : 'add';
|
|
307
|
-
pix.product[action].data[method](data);
|
|
308
|
-
});
|
|
309
|
-
};
|
|
310
|
-
WebtrekkSmartPixelAngular.prototype.order = function (data) {
|
|
311
|
-
if (data === void 0) { data = { value: '' }; }
|
|
312
|
-
this.call(function (pix) {
|
|
313
|
-
pix.order.data.add(data);
|
|
314
|
-
});
|
|
315
|
-
};
|
|
316
|
-
WebtrekkSmartPixelAngular.prototype.extension = function (extension, action, config) {
|
|
317
|
-
if (extension === void 0) { extension = ''; }
|
|
318
|
-
if (action === void 0) { action = 'activate'; }
|
|
319
|
-
if (config === void 0) { config = emptyObject; }
|
|
320
|
-
if (!extension) {
|
|
321
|
-
return;
|
|
322
|
-
}
|
|
323
|
-
this.call(function (pix) {
|
|
324
|
-
pix.extension[extension][action](config);
|
|
325
|
-
});
|
|
326
|
-
};
|
|
327
|
-
WebtrekkSmartPixelAngular.prototype.track = function (keepData) {
|
|
328
|
-
if (keepData === void 0) { keepData = false; }
|
|
329
|
-
this.call(function (pix) {
|
|
330
|
-
pix.track(keepData);
|
|
331
|
-
});
|
|
332
|
-
};
|
|
333
|
-
WebtrekkSmartPixelAngular.prototype.trackPage = function (keepData) {
|
|
334
|
-
if (keepData === void 0) { keepData = false; }
|
|
335
|
-
this.call(function (pix) {
|
|
336
|
-
pix.trackPage(keepData);
|
|
337
|
-
});
|
|
338
|
-
};
|
|
339
|
-
WebtrekkSmartPixelAngular.prototype.trackAction = function (keepData) {
|
|
340
|
-
if (keepData === void 0) { keepData = false; }
|
|
341
|
-
this.call(function (pix) {
|
|
342
|
-
pix.trackAction(keepData);
|
|
343
|
-
});
|
|
344
|
-
};
|
|
345
|
-
WebtrekkSmartPixelAngular = __decorate([
|
|
346
|
-
core.Injectable()
|
|
347
|
-
], WebtrekkSmartPixelAngular);
|
|
348
|
-
return WebtrekkSmartPixelAngular;
|
|
349
|
-
}());
|
|
350
324
|
|
|
351
325
|
var WEBTREKK_SMART_PIXEL_TOKEN = new core.InjectionToken('WEBTREKK-SMART-PIXEL-ANGULAR');
|
|
352
326
|
|
|
@@ -380,12 +354,16 @@
|
|
|
380
354
|
});
|
|
381
355
|
}
|
|
382
356
|
}
|
|
383
|
-
WebtrekkSmartPixelAutoTracking = __decorate([
|
|
384
|
-
core.NgModule(),
|
|
385
|
-
__param(2, core.Inject(WEBTREKK_SMART_PIXEL_TOKEN))
|
|
386
|
-
], WebtrekkSmartPixelAutoTracking);
|
|
387
357
|
return WebtrekkSmartPixelAutoTracking;
|
|
388
358
|
}());
|
|
359
|
+
WebtrekkSmartPixelAutoTracking.decorators = [
|
|
360
|
+
{ type: core.NgModule }
|
|
361
|
+
];
|
|
362
|
+
WebtrekkSmartPixelAutoTracking.ctorParameters = function () { return [
|
|
363
|
+
{ type: router.Router },
|
|
364
|
+
{ type: WebtrekkSmartPixelAngular },
|
|
365
|
+
{ type: undefined, decorators: [{ type: core.Inject, args: [WEBTREKK_SMART_PIXEL_TOKEN,] }] }
|
|
366
|
+
]; };
|
|
389
367
|
|
|
390
368
|
var DefaultConfig = /** @class */ (function () {
|
|
391
369
|
function DefaultConfig() {
|
|
@@ -404,15 +382,14 @@
|
|
|
404
382
|
var WebtrekkSmartPixelModule = /** @class */ (function () {
|
|
405
383
|
function WebtrekkSmartPixelModule() {
|
|
406
384
|
}
|
|
407
|
-
WebtrekkSmartPixelModule_1 = WebtrekkSmartPixelModule;
|
|
408
385
|
WebtrekkSmartPixelModule.forRoot = function (conf) {
|
|
409
386
|
if (conf === void 0) { conf = {}; }
|
|
410
387
|
return {
|
|
411
|
-
ngModule:
|
|
388
|
+
ngModule: WebtrekkSmartPixelModule,
|
|
412
389
|
providers: [
|
|
413
390
|
{
|
|
414
391
|
provide: WEBTREKK_SMART_PIXEL_TOKEN,
|
|
415
|
-
useValue:
|
|
392
|
+
useValue: Object.assign(Object.assign({}, defaultConfig), conf)
|
|
416
393
|
},
|
|
417
394
|
{
|
|
418
395
|
provide: WebtrekkSmartPixelAngular,
|
|
@@ -421,48 +398,61 @@
|
|
|
421
398
|
]
|
|
422
399
|
};
|
|
423
400
|
};
|
|
424
|
-
var WebtrekkSmartPixelModule_1;
|
|
425
|
-
WebtrekkSmartPixelModule = WebtrekkSmartPixelModule_1 = __decorate([
|
|
426
|
-
core.NgModule({
|
|
427
|
-
declarations: [
|
|
428
|
-
DataDirective,
|
|
429
|
-
ExtensionDirective,
|
|
430
|
-
TeaserDirective,
|
|
431
|
-
ProductListDirective,
|
|
432
|
-
ContentEngagementDirective
|
|
433
|
-
],
|
|
434
|
-
exports: [
|
|
435
|
-
DataDirective,
|
|
436
|
-
ExtensionDirective,
|
|
437
|
-
TeaserDirective,
|
|
438
|
-
ProductListDirective,
|
|
439
|
-
ContentEngagementDirective,
|
|
440
|
-
WebtrekkSmartPixelAutoTracking
|
|
441
|
-
],
|
|
442
|
-
imports: [
|
|
443
|
-
WebtrekkSmartPixelAutoTracking
|
|
444
|
-
],
|
|
445
|
-
providers: [],
|
|
446
|
-
bootstrap: []
|
|
447
|
-
})
|
|
448
|
-
], WebtrekkSmartPixelModule);
|
|
449
401
|
return WebtrekkSmartPixelModule;
|
|
450
402
|
}());
|
|
403
|
+
WebtrekkSmartPixelModule.decorators = [
|
|
404
|
+
{ type: core.NgModule, args: [{
|
|
405
|
+
declarations: [
|
|
406
|
+
DataDirective,
|
|
407
|
+
ExtensionDirective,
|
|
408
|
+
TeaserDirective,
|
|
409
|
+
ProductListDirective,
|
|
410
|
+
ContentEngagementDirective
|
|
411
|
+
],
|
|
412
|
+
exports: [
|
|
413
|
+
DataDirective,
|
|
414
|
+
ExtensionDirective,
|
|
415
|
+
TeaserDirective,
|
|
416
|
+
ProductListDirective,
|
|
417
|
+
ContentEngagementDirective,
|
|
418
|
+
WebtrekkSmartPixelAutoTracking
|
|
419
|
+
],
|
|
420
|
+
imports: [
|
|
421
|
+
WebtrekkSmartPixelAutoTracking
|
|
422
|
+
],
|
|
423
|
+
providers: [],
|
|
424
|
+
bootstrap: []
|
|
425
|
+
},] }
|
|
426
|
+
];
|
|
451
427
|
|
|
428
|
+
/*
|
|
429
|
+
* Public API Surface of smart-pixel-angular
|
|
430
|
+
*/
|
|
452
431
|
// compatibility for v0
|
|
453
432
|
var webtrekkSmartPixelAngular = new WebtrekkSmartPixelAngular();
|
|
454
|
-
var
|
|
433
|
+
var publicApi = {
|
|
455
434
|
WebtrekkSmartPixelModule: WebtrekkSmartPixelModule,
|
|
456
435
|
WebtrekkSmartPixelAngular: WebtrekkSmartPixelAngular,
|
|
457
436
|
// compatibility for v0
|
|
458
437
|
webtrekkSmartPixelAngular: webtrekkSmartPixelAngular
|
|
459
438
|
};
|
|
460
439
|
|
|
440
|
+
/**
|
|
441
|
+
* Generated bundle index. Do not edit.
|
|
442
|
+
*/
|
|
443
|
+
|
|
444
|
+
exports.ContentEngagementDirective = ContentEngagementDirective;
|
|
445
|
+
exports.DataDirective = DataDirective;
|
|
446
|
+
exports.ExtensionDirective = ExtensionDirective;
|
|
447
|
+
exports.ProductListDirective = ProductListDirective;
|
|
448
|
+
exports.TeaserDirective = TeaserDirective;
|
|
461
449
|
exports.WebtrekkSmartPixelAngular = WebtrekkSmartPixelAngular;
|
|
450
|
+
exports.WebtrekkSmartPixelAutoTracking = WebtrekkSmartPixelAutoTracking;
|
|
462
451
|
exports.WebtrekkSmartPixelModule = WebtrekkSmartPixelModule;
|
|
463
|
-
exports.default = index;
|
|
464
452
|
exports.webtrekkSmartPixelAngular = webtrekkSmartPixelAngular;
|
|
453
|
+
exports["ɵa"] = WEBTREKK_SMART_PIXEL_TOKEN;
|
|
465
454
|
|
|
466
455
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
467
456
|
|
|
468
|
-
}))
|
|
457
|
+
}));
|
|
458
|
+
//# sourceMappingURL=webtrekk-smart-pixel-angular.umd.js.map
|