@jetshop/core 5.15.0-alpha.705c3635 → 5.15.0-alpha.7bbc753c
Sign up to get free protection for your applications and to get access to all the features.
- package/ChannelHandler/ChannelHandler.js +1 -0
- package/ChannelHandler/ChannelHandler.js.map +1 -1
- package/analytics/AnalyticsProvider.d.ts +5 -0
- package/analytics/AnalyticsProvider.js +31 -11
- package/analytics/AnalyticsProvider.js.map +1 -1
- package/analytics/integrations/ga4.js +62 -22
- package/analytics/integrations/ga4.js.map +1 -1
- package/analytics/integrations/gtag/gtag.js +35 -3
- package/analytics/integrations/gtag/gtag.js.map +1 -1
- package/analytics/integrations/gtm/gtm.d.ts +12 -0
- package/analytics/integrations/gtm/gtm.js +236 -0
- package/analytics/integrations/gtm/gtm.js.map +1 -0
- package/analytics/integrations/gtm/index.d.ts +1 -12
- package/analytics/integrations/gtm/index.js +1 -200
- package/analytics/integrations/gtm/index.js.map +1 -1
- package/analytics/trackerRegistry.d.ts +12 -0
- package/analytics/trackerRegistry.js +3 -1
- package/analytics/trackerRegistry.js.map +1 -1
- package/boot/SharedTree.js +1 -1
- package/boot/SharedTree.js.map +1 -1
- package/boot/apollo.js +2 -2
- package/boot/apollo.js.map +1 -1
- package/boot/server/createRenderer.js +4 -3
- package/boot/server/createRenderer.js.map +1 -1
- package/components/ConfigProvider.d.ts +1 -0
- package/components/ConfigProvider.js.map +1 -1
- package/components/DynamicRoute/ProductRoute.js +9 -2
- package/components/DynamicRoute/ProductRoute.js.map +1 -1
- package/components/DynamicRoute/RouteResolver.d.ts +1 -1
- package/components/Head.js +6 -2
- package/components/Head.js.map +1 -1
- package/components/SortOrder/SortOrderContainer.js +7 -1
- package/components/SortOrder/SortOrderContainer.js.map +1 -1
- package/hooks/ProductList/list-transforms.d.ts +2 -0
- package/hooks/useCustomerOrders.test.js +5 -5
- package/package.json +2 -3
- package/types.d.ts +71 -3
@@ -0,0 +1,236 @@
|
|
1
|
+
import { injectScript } from '../../utils/script';
|
2
|
+
import { getBrand } from '@jetshop/core/components/OpenGraph/OpenGraphProductData';
|
3
|
+
import { unSlugify } from '../unslugify';
|
4
|
+
import { breadcrumbsWithoutProduct } from '../../utils/breadcrumbsWithoutProduct';
|
5
|
+
function push(event) {
|
6
|
+
if (window.dataLayer) {
|
7
|
+
if (event.ecommerce) {
|
8
|
+
window.dataLayer.push({ ecommerce: null });
|
9
|
+
}
|
10
|
+
window.dataLayer.push(event);
|
11
|
+
}
|
12
|
+
}
|
13
|
+
function getProductData({ product, selectedVariation, useArticleNumberAsId = false, brandCustomField, category = '' }) {
|
14
|
+
if (useArticleNumberAsId) {
|
15
|
+
return {
|
16
|
+
id: (selectedVariation === null || selectedVariation === void 0 ? void 0 : selectedVariation.articleNumber) || product.articleNumber,
|
17
|
+
productId: product.id,
|
18
|
+
productSKU: product.articleNumber,
|
19
|
+
variant: selectedVariation === null || selectedVariation === void 0 ? void 0 : selectedVariation.values.join('_'),
|
20
|
+
variantSKU: selectedVariation === null || selectedVariation === void 0 ? void 0 : selectedVariation.articleNumber,
|
21
|
+
name: product.name,
|
22
|
+
base_product: product.articleNumber,
|
23
|
+
category,
|
24
|
+
brand: getBrand(product, brandCustomField)
|
25
|
+
};
|
26
|
+
}
|
27
|
+
else {
|
28
|
+
// This is kept as backwards compatibility. Some shops rely on the product id being the internal Jetshop id, instead of the article number.
|
29
|
+
// Changing this could affect the statistics in Google Ads/Merchant/Analytics, so we want the new behaviour to be opt-in.
|
30
|
+
return {
|
31
|
+
id: product.id,
|
32
|
+
variant: selectedVariation
|
33
|
+
? selectedVariation.articleNumber
|
34
|
+
: product.articleNumber,
|
35
|
+
name: product.name,
|
36
|
+
base_product: product.articleNumber,
|
37
|
+
category,
|
38
|
+
brand: getBrand(product, brandCustomField)
|
39
|
+
};
|
40
|
+
}
|
41
|
+
}
|
42
|
+
export const gtmTracker = ({ containerId, currency, useArticleNumberAsId = false, brandCustomField }) => ({
|
43
|
+
name: 'gtm',
|
44
|
+
initBrowser({ config }) {
|
45
|
+
const script = `https://www.googletagmanager.com/gtm.js?id=${containerId}`;
|
46
|
+
const w = window;
|
47
|
+
w.dataLayer = w.dataLayer || [];
|
48
|
+
w.dataLayer.push({
|
49
|
+
'gtm.start': new Date().getTime(),
|
50
|
+
event: 'gtm.js',
|
51
|
+
originalLocation: document.location.protocol +
|
52
|
+
'//' +
|
53
|
+
document.location.hostname +
|
54
|
+
document.location.pathname +
|
55
|
+
document.location.search
|
56
|
+
});
|
57
|
+
if (config.useTrackingConsentAPI) {
|
58
|
+
/**
|
59
|
+
NB:
|
60
|
+
Only cookieless pings will be sent to Google servers.
|
61
|
+
There’s also a wait time of 500 milliseconds before any Google tags are allowed to fire,
|
62
|
+
to give time for the update command to be invoked.
|
63
|
+
*/
|
64
|
+
const consent = config.consentedToTracking ? 'granted' : 'denied';
|
65
|
+
w.dataLayer.push({
|
66
|
+
event: 'gtm_consent_default',
|
67
|
+
ad_storage: consent,
|
68
|
+
// https://www.simoahava.com/analytics/consent-mode-google-tags/#restrict-advertising-storage
|
69
|
+
analytics_storage: consent,
|
70
|
+
personalization_storage: consent,
|
71
|
+
functionality_storage: 'granted',
|
72
|
+
security_storage: 'granted',
|
73
|
+
wait_for_update: 500
|
74
|
+
});
|
75
|
+
}
|
76
|
+
injectScript({ src: script });
|
77
|
+
},
|
78
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
79
|
+
consent() {
|
80
|
+
// Consent updated should be handled from inside GTM
|
81
|
+
},
|
82
|
+
trackProduct({ quantity, action, product, selectedVariation, list, listName, index, category }, context, eventId) {
|
83
|
+
const productData = Object.assign(Object.assign({}, getProductData({
|
84
|
+
product,
|
85
|
+
selectedVariation,
|
86
|
+
useArticleNumberAsId,
|
87
|
+
brandCustomField,
|
88
|
+
category
|
89
|
+
})), { price: (selectedVariation && selectedVariation.price.incVat) ||
|
90
|
+
(product.price && product.price.incVat), quantity, position: index });
|
91
|
+
switch (action) {
|
92
|
+
case 'click':
|
93
|
+
push({
|
94
|
+
event: 'productClick',
|
95
|
+
productIds: product.articleNumber,
|
96
|
+
ecommerce: {
|
97
|
+
click: {
|
98
|
+
actionField: { list: list || listName || context.list },
|
99
|
+
products: [productData]
|
100
|
+
}
|
101
|
+
},
|
102
|
+
eventId
|
103
|
+
});
|
104
|
+
break;
|
105
|
+
case 'view':
|
106
|
+
push({
|
107
|
+
event: 'productDetails',
|
108
|
+
ecommerce: {
|
109
|
+
currencyCode: currency,
|
110
|
+
detail: {
|
111
|
+
products: [productData]
|
112
|
+
}
|
113
|
+
},
|
114
|
+
eventId
|
115
|
+
});
|
116
|
+
break;
|
117
|
+
case 'add':
|
118
|
+
push({
|
119
|
+
event: 'addToCart',
|
120
|
+
productIds: product.articleNumber,
|
121
|
+
ecommerce: {
|
122
|
+
actionField: {
|
123
|
+
list: list || listName || context.list
|
124
|
+
},
|
125
|
+
currencyCode: currency,
|
126
|
+
add: {
|
127
|
+
products: [productData]
|
128
|
+
}
|
129
|
+
},
|
130
|
+
eventId
|
131
|
+
});
|
132
|
+
break;
|
133
|
+
case 'remove':
|
134
|
+
push({
|
135
|
+
event: 'removeFromCart',
|
136
|
+
productIds: product.articleNumber,
|
137
|
+
pageType: 'cart',
|
138
|
+
ecommerce: {
|
139
|
+
currencyCode: currency,
|
140
|
+
remove: {
|
141
|
+
products: [productData]
|
142
|
+
}
|
143
|
+
},
|
144
|
+
eventId
|
145
|
+
});
|
146
|
+
break;
|
147
|
+
default:
|
148
|
+
console.log('Error: Gtag can not track action ' + action);
|
149
|
+
break;
|
150
|
+
}
|
151
|
+
},
|
152
|
+
trackCartCheckout({ cart }, _, eventId) {
|
153
|
+
const items = cart.items.map((item) => {
|
154
|
+
var _a, _b, _c;
|
155
|
+
return (Object.assign(Object.assign({}, getProductData({
|
156
|
+
product: item.product,
|
157
|
+
selectedVariation: item.variant,
|
158
|
+
useArticleNumberAsId,
|
159
|
+
brandCustomField,
|
160
|
+
category: breadcrumbsWithoutProduct((_a = item.product.primaryRoute) === null || _a === void 0 ? void 0 : _a.breadcrumbs) ||
|
161
|
+
unSlugify((_c = (_b = item.product.canonicalCategory) === null || _b === void 0 ? void 0 : _b.primaryRoute) === null || _c === void 0 ? void 0 : _c.path) ||
|
162
|
+
''
|
163
|
+
})), { price: item.total.incVat, quantity: item.quantity }));
|
164
|
+
});
|
165
|
+
push({
|
166
|
+
event: 'checkout',
|
167
|
+
ecommerce: {
|
168
|
+
products: items
|
169
|
+
},
|
170
|
+
eventId
|
171
|
+
});
|
172
|
+
},
|
173
|
+
trackPageView({ pathname, title }, _, eventId) {
|
174
|
+
push({
|
175
|
+
event: 'pageView',
|
176
|
+
pagePath: pathname,
|
177
|
+
pageTitle: title,
|
178
|
+
eventId
|
179
|
+
});
|
180
|
+
},
|
181
|
+
trackList({ listName, products, category }, _, eventId) {
|
182
|
+
const productData = products.map((product, i) => {
|
183
|
+
var _a, _b, _c, _d;
|
184
|
+
return (Object.assign(Object.assign({}, getProductData({
|
185
|
+
product,
|
186
|
+
selectedVariation: null,
|
187
|
+
useArticleNumberAsId,
|
188
|
+
brandCustomField,
|
189
|
+
category: category ||
|
190
|
+
breadcrumbsWithoutProduct((_a = product === null || product === void 0 ? void 0 : product.primaryRoute) === null || _a === void 0 ? void 0 : _a.breadcrumbs) ||
|
191
|
+
unSlugify((_c = (_b = product === null || product === void 0 ? void 0 : product.canonicalCategory) === null || _b === void 0 ? void 0 : _b.primaryRoute) === null || _c === void 0 ? void 0 : _c.path)
|
192
|
+
})), { price: (_d = product.price) === null || _d === void 0 ? void 0 : _d.incVat, position: i, list: listName }));
|
193
|
+
});
|
194
|
+
push({
|
195
|
+
event: 'productList',
|
196
|
+
ecommerce: {
|
197
|
+
currencyCode: currency,
|
198
|
+
impressions: productData
|
199
|
+
},
|
200
|
+
eventId
|
201
|
+
});
|
202
|
+
},
|
203
|
+
trackExperiment({ id, variant }, _, eventId) {
|
204
|
+
push({
|
205
|
+
experiment: `${id}.${variant}`,
|
206
|
+
eventId
|
207
|
+
});
|
208
|
+
},
|
209
|
+
trackUser({ userId }, _, eventId) {
|
210
|
+
push({
|
211
|
+
userId,
|
212
|
+
eventId
|
213
|
+
});
|
214
|
+
},
|
215
|
+
trackLogin(_, __, eventId) {
|
216
|
+
push({
|
217
|
+
event: 'login',
|
218
|
+
eventId
|
219
|
+
});
|
220
|
+
},
|
221
|
+
trackRegister(_, __, eventId) {
|
222
|
+
push({
|
223
|
+
event: 'register',
|
224
|
+
eventId
|
225
|
+
});
|
226
|
+
},
|
227
|
+
trackAddToWishList({ articleNumber, productName }, _, eventId) {
|
228
|
+
push({
|
229
|
+
event: 'addToWishlist',
|
230
|
+
articleNumber,
|
231
|
+
productName,
|
232
|
+
eventId
|
233
|
+
});
|
234
|
+
}
|
235
|
+
});
|
236
|
+
//# sourceMappingURL=gtm.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"gtm.js","sourceRoot":"","sources":["gtm.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,QAAQ,EAAE,MAAM,yDAAyD,CAAC;AACnF,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAC;AAOlF,SAAS,IAAI,CAAC,KAA0B;IACtC,IAAI,MAAM,CAAC,SAAS,EAAE;QACpB,IAAI,KAAK,CAAC,SAAS,EAAE;YACnB,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;SAC5C;QAED,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;KAC9B;AACH,CAAC;AAED,SAAS,cAAc,CAAC,EACtB,OAAO,EACP,iBAAiB,EACjB,oBAAoB,GAAG,KAAK,EAC5B,gBAAgB,EAChB,QAAQ,GAAG,EAAE,EAOd;IACC,IAAI,oBAAoB,EAAE;QACxB,OAAO;YACL,EAAE,EAAE,CAAA,iBAAiB,aAAjB,iBAAiB,u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IAAI,CAAC;YACH,KAAK,EAAE,eAAe;YACtB,aAAa;YACb,WAAW;YACX,OAAO;SACR,CAAC,CAAC;IACL,CAAC;CACF,CAAC,CAAC"}
|
@@ -1,12 +1 @@
|
|
1
|
-
|
2
|
-
declare global {
|
3
|
-
interface Window {
|
4
|
-
dataLayer: any[];
|
5
|
-
}
|
6
|
-
}
|
7
|
-
export declare const gtmTracker: ({ containerId, currency, useArticleNumberAsId, brandCustomField }: {
|
8
|
-
containerId: string;
|
9
|
-
currency: string;
|
10
|
-
brandCustomField?: string;
|
11
|
-
useArticleNumberAsId?: boolean;
|
12
|
-
}) => Tracker;
|
1
|
+
export * from './gtm';
|
@@ -1,201 +1,2 @@
|
|
1
|
-
|
2
|
-
import { getBrand } from '@jetshop/core/components/OpenGraph/OpenGraphProductData';
|
3
|
-
import { unSlugify } from '../unslugify';
|
4
|
-
import { breadcrumbsWithoutProduct } from '../../utils/breadcrumbsWithoutProduct';
|
5
|
-
function push(event) {
|
6
|
-
if (window.dataLayer) {
|
7
|
-
if (event.ecommerce) {
|
8
|
-
window.dataLayer.push({ ecommerce: null });
|
9
|
-
}
|
10
|
-
window.dataLayer.push(event);
|
11
|
-
}
|
12
|
-
}
|
13
|
-
function getProductData({ product, selectedVariation, useArticleNumberAsId = false, brandCustomField, category = '' }) {
|
14
|
-
if (useArticleNumberAsId) {
|
15
|
-
return {
|
16
|
-
id: (selectedVariation === null || selectedVariation === void 0 ? void 0 : selectedVariation.articleNumber) || product.articleNumber,
|
17
|
-
productId: product.id,
|
18
|
-
productSKU: product.articleNumber,
|
19
|
-
variant: selectedVariation === null || selectedVariation === void 0 ? void 0 : selectedVariation.values.join('_'),
|
20
|
-
variantSKU: selectedVariation === null || selectedVariation === void 0 ? void 0 : selectedVariation.articleNumber,
|
21
|
-
name: product.name,
|
22
|
-
base_product: product.articleNumber,
|
23
|
-
category,
|
24
|
-
brand: getBrand(product, brandCustomField)
|
25
|
-
};
|
26
|
-
}
|
27
|
-
else {
|
28
|
-
// This is kept as backwards compatibility. Some shops rely on the product id being the internal Jetshop id, instead of the article number.
|
29
|
-
// Changing this could affect the statistics in Google Ads/Merchant/Analytics, so we want the new behaviour to be opt-in.
|
30
|
-
return {
|
31
|
-
id: product.id,
|
32
|
-
variant: selectedVariation
|
33
|
-
? selectedVariation.articleNumber
|
34
|
-
: product.articleNumber,
|
35
|
-
name: product.name,
|
36
|
-
base_product: product.articleNumber,
|
37
|
-
category,
|
38
|
-
brand: getBrand(product, brandCustomField)
|
39
|
-
};
|
40
|
-
}
|
41
|
-
}
|
42
|
-
export const gtmTracker = ({ containerId, currency, useArticleNumberAsId = false, brandCustomField }) => ({
|
43
|
-
name: 'gtm',
|
44
|
-
initBrowser() {
|
45
|
-
const script = `https://www.googletagmanager.com/gtm.js?id=${containerId}`;
|
46
|
-
const w = window;
|
47
|
-
w.dataLayer = w.dataLayer || [];
|
48
|
-
w.dataLayer.push({
|
49
|
-
'gtm.start': new Date().getTime(),
|
50
|
-
event: 'gtm.js',
|
51
|
-
originalLocation: document.location.protocol +
|
52
|
-
'//' +
|
53
|
-
document.location.hostname +
|
54
|
-
document.location.pathname +
|
55
|
-
document.location.search
|
56
|
-
});
|
57
|
-
injectScript({ src: script });
|
58
|
-
},
|
59
|
-
trackProduct({ quantity, action, product, selectedVariation, list, listName, index, category }, context) {
|
60
|
-
const productData = Object.assign(Object.assign({}, getProductData({
|
61
|
-
product,
|
62
|
-
selectedVariation,
|
63
|
-
useArticleNumberAsId,
|
64
|
-
brandCustomField,
|
65
|
-
category
|
66
|
-
})), { price: (selectedVariation && selectedVariation.price.incVat) ||
|
67
|
-
(product.price && product.price.incVat), quantity, position: index });
|
68
|
-
switch (action) {
|
69
|
-
case 'click':
|
70
|
-
push({
|
71
|
-
event: 'productClick',
|
72
|
-
productIds: product.articleNumber,
|
73
|
-
ecommerce: {
|
74
|
-
click: {
|
75
|
-
actionField: { list: list || listName || context.list },
|
76
|
-
products: [productData]
|
77
|
-
}
|
78
|
-
}
|
79
|
-
});
|
80
|
-
break;
|
81
|
-
case 'view':
|
82
|
-
push({
|
83
|
-
event: 'productDetails',
|
84
|
-
ecommerce: {
|
85
|
-
currencyCode: currency,
|
86
|
-
detail: {
|
87
|
-
products: [productData]
|
88
|
-
}
|
89
|
-
}
|
90
|
-
});
|
91
|
-
break;
|
92
|
-
case 'add':
|
93
|
-
push({
|
94
|
-
event: 'addToCart',
|
95
|
-
productIds: product.articleNumber,
|
96
|
-
ecommerce: {
|
97
|
-
actionField: {
|
98
|
-
list: list || listName || context.list
|
99
|
-
},
|
100
|
-
currencyCode: currency,
|
101
|
-
add: {
|
102
|
-
products: [productData]
|
103
|
-
}
|
104
|
-
}
|
105
|
-
});
|
106
|
-
break;
|
107
|
-
case 'remove':
|
108
|
-
push({
|
109
|
-
event: 'removeFromCart',
|
110
|
-
productIds: product.articleNumber,
|
111
|
-
pageType: 'cart',
|
112
|
-
ecommerce: {
|
113
|
-
currencyCode: currency,
|
114
|
-
remove: {
|
115
|
-
products: [productData]
|
116
|
-
}
|
117
|
-
}
|
118
|
-
});
|
119
|
-
break;
|
120
|
-
default:
|
121
|
-
console.log('Error: Gtag can not track action ' + action);
|
122
|
-
break;
|
123
|
-
}
|
124
|
-
},
|
125
|
-
trackCartCheckout({ cart }) {
|
126
|
-
const items = cart.items.map((item) => {
|
127
|
-
var _a, _b, _c;
|
128
|
-
return (Object.assign(Object.assign({}, getProductData({
|
129
|
-
product: item.product,
|
130
|
-
selectedVariation: item.variant,
|
131
|
-
useArticleNumberAsId,
|
132
|
-
brandCustomField,
|
133
|
-
category: breadcrumbsWithoutProduct((_a = item.product.primaryRoute) === null || _a === void 0 ? void 0 : _a.breadcrumbs) ||
|
134
|
-
unSlugify((_c = (_b = item.product.canonicalCategory) === null || _b === void 0 ? void 0 : _b.primaryRoute) === null || _c === void 0 ? void 0 : _c.path) ||
|
135
|
-
''
|
136
|
-
})), { price: item.total.incVat, quantity: item.quantity }));
|
137
|
-
});
|
138
|
-
push({
|
139
|
-
event: 'checkout',
|
140
|
-
ecommerce: {
|
141
|
-
products: items
|
142
|
-
}
|
143
|
-
});
|
144
|
-
},
|
145
|
-
trackPageView({ pathname, title }) {
|
146
|
-
push({
|
147
|
-
event: 'pageView',
|
148
|
-
pagePath: pathname,
|
149
|
-
pageTitle: title
|
150
|
-
});
|
151
|
-
},
|
152
|
-
trackList({ listName, products, category }) {
|
153
|
-
const productData = products.map((product, i) => {
|
154
|
-
var _a, _b, _c, _d;
|
155
|
-
return (Object.assign(Object.assign({}, getProductData({
|
156
|
-
product,
|
157
|
-
selectedVariation: null,
|
158
|
-
useArticleNumberAsId,
|
159
|
-
brandCustomField,
|
160
|
-
category: category ||
|
161
|
-
breadcrumbsWithoutProduct((_a = product === null || product === void 0 ? void 0 : product.primaryRoute) === null || _a === void 0 ? void 0 : _a.breadcrumbs) ||
|
162
|
-
unSlugify((_c = (_b = product === null || product === void 0 ? void 0 : product.canonicalCategory) === null || _b === void 0 ? void 0 : _b.primaryRoute) === null || _c === void 0 ? void 0 : _c.path)
|
163
|
-
})), { price: (_d = product.price) === null || _d === void 0 ? void 0 : _d.incVat, position: i, list: listName }));
|
164
|
-
});
|
165
|
-
push({
|
166
|
-
event: 'productList',
|
167
|
-
ecommerce: {
|
168
|
-
currencyCode: currency,
|
169
|
-
impressions: productData
|
170
|
-
}
|
171
|
-
});
|
172
|
-
},
|
173
|
-
trackExperiment({ id, variant }) {
|
174
|
-
push({
|
175
|
-
experiment: `${id}.${variant}`
|
176
|
-
});
|
177
|
-
},
|
178
|
-
trackUser({ userId }) {
|
179
|
-
push({
|
180
|
-
userId
|
181
|
-
});
|
182
|
-
},
|
183
|
-
trackLogin() {
|
184
|
-
push({
|
185
|
-
event: 'login'
|
186
|
-
});
|
187
|
-
},
|
188
|
-
trackRegister() {
|
189
|
-
push({
|
190
|
-
event: 'register'
|
191
|
-
});
|
192
|
-
},
|
193
|
-
trackAddToWishList({ articleNumber, productName }) {
|
194
|
-
push({
|
195
|
-
event: 'addToWishlist',
|
196
|
-
articleNumber,
|
197
|
-
productName
|
198
|
-
});
|
199
|
-
}
|
200
|
-
});
|
1
|
+
export * from './gtm';
|
201
2
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC"}
|
@@ -55,8 +55,18 @@ export interface TrackingProps {
|
|
55
55
|
}
|
56
56
|
export interface InitOptions {
|
57
57
|
trackerRegistry: TrackerRegistry;
|
58
|
+
config: AnalyticsConfig;
|
59
|
+
}
|
60
|
+
declare type Consent = 'granted' | 'denied';
|
61
|
+
interface BaseConsentEvents {
|
62
|
+
ad_storage: Consent;
|
63
|
+
analytics_storage: Consent;
|
64
|
+
personalization_storage: Consent;
|
65
|
+
security_storage: Consent;
|
66
|
+
[key: string]: Consent;
|
58
67
|
}
|
59
68
|
export interface BaseTrackingEvents {
|
69
|
+
consent: (props: BaseConsentEvents, context: TrackingFunctionContext, eventId?: string) => void;
|
60
70
|
trackProduct: (props: TrackProductProps, context: TrackingFunctionContext, eventId?: string) => void;
|
61
71
|
trackCartCheckout: (props: TrackCartProps, context: TrackingFunctionContext, eventId?: string, callback?: (response: Response) => void) => void;
|
62
72
|
trackCart: (props: TrackCartProps, context: TrackingFunctionContext, eventId?: string) => void;
|
@@ -88,6 +98,7 @@ export interface TrackerRegistry {
|
|
88
98
|
* - Runs `initBrowser`
|
89
99
|
*/
|
90
100
|
add: (tracker: Tracker) => void;
|
101
|
+
trackers: () => string[];
|
91
102
|
}
|
92
103
|
export declare function createServerTracker({ currency, useArticleNumberAsId, pixelId, token }: {
|
93
104
|
currency: string;
|
@@ -99,3 +110,4 @@ export declare function trackerRegistry({ config, inServer }: {
|
|
99
110
|
config: AnalyticsConfig;
|
100
111
|
inServer: boolean;
|
101
112
|
}): TrackerRegistry;
|
113
|
+
export {};
|
@@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
9
9
|
};
|
10
10
|
import eventemitter3 from 'eventemitter3';
|
11
11
|
export const trackingEvents = [
|
12
|
+
'consent',
|
12
13
|
'trackProduct',
|
13
14
|
'trackCartCheckout',
|
14
15
|
'trackCart',
|
@@ -213,7 +214,8 @@ export function trackerRegistry({ config, inServer }) {
|
|
213
214
|
opts
|
214
215
|
});
|
215
216
|
}
|
216
|
-
}
|
217
|
+
},
|
218
|
+
trackers: () => trackers.flatMap((t) => t.name)
|
217
219
|
};
|
218
220
|
return registry;
|
219
221
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"trackerRegistry.js","sourceRoot":"","sources":["trackerRegistry.ts"],"names":[],"mappings":";;;;;;;;;AAEA,OAAO,aAAa,MAAM,eAAe,CAAC;
|
1
|
+
{"version":3,"file":"trackerRegistry.js","sourceRoot":"","sources":["trackerRegistry.ts"],"names":[],"mappings":";;;;;;;;;AAEA,OAAO,aAAa,MAAM,eAAe,CAAC;AAmJ1C,MAAM,CAAC,MAAM,cAAc,GAAiC;IAC1D,SAAS;IACT,cAAc;IACd,mBAAmB;IACnB,WAAW;IACX,WAAW;IACX,eAAe;IACf,iBAAiB;IACjB,WAAW;IACX,YAAY;IACZ,eAAe;IACf,oBAAoB;CACrB,CAAC;AA6BF,MAAM,UAAU,mBAAmB,CAAC,EAClC,QAAQ,EACR,oBAAoB,EACpB,OAAO,EACP,KAAK,EAMN;IACC,MAAM,QAAQ,GAAG;QACf,oBAAoB;QACpB,QAAQ;QACR,OAAO;QACP,KAAK;KACN,CAAC;IACF,MAAM,aAAa,GAAY;QAC7B,IAAI,EAAE,QAAQ;QACd,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO;YAClC,KAAK,CAAC,4BAA4B,EAAE;gBAClC,MAAM,EAAE,MAAM;gBACd,OAAO,EAAE;oBACP,cAAc,EAAE,k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AE,EAAE;gBAChC,IAAI,OAAO,CAAC,MAAM,CAAC,EAAE;oBACnB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;iBAC9D;YACH,CAAC,CAAC,CAAC;YAEH,IAAI,QAAQ,EAAE;gBACZ,OAAO;aACR;YAED,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE;gBACxB,OAAO;aACR;YAED,IAAI,OAAO,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,eAAe,CAAA,KAAK,IAAI,IAAI,CAAC,MAAM,CAAC,eAAe,EAAE;gBACtE,OAAO;aACR;YAED,MAAM,IAAI,GAAG,EAAE,MAAM,EAAE,eAAe,EAAE,QAAQ,EAAE,CAAC;YAEnD,IAAI;gBACF,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;aAC3B;YAAC,OAAO,GAAG,EAAE;gBACZ,OAAO,CAAC,KAAK,CAAC,SAAS,OAAO,CAAC,IAAI,cAAc,EAAE;oBACjD,GAAG;oBACH,IAAI;iBACL,CAAC,CAAC;aACJ;QACH,CAAC;QACD,QAAQ,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;KAChD,CAAC;IACF,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
package/boot/SharedTree.js
CHANGED
@@ -20,7 +20,7 @@ const SharedTree = ({ activeBreakpoint, cookies, helmetContext, releware, client
|
|
20
20
|
React.createElement(BreakpointProvider, { value: activeBreakpoint },
|
21
21
|
React.createElement(ApolloProvider, { client: client },
|
22
22
|
React.createElement(ChannelProvider, { config: config, channelHandler: channelHandler },
|
23
|
-
React.createElement(AnalyticsProvider, { releware: releware },
|
23
|
+
React.createElement(AnalyticsProvider, { releware: releware, cookies: cookies },
|
24
24
|
React.createElement(PreviewProvider, { previewHandler: previewHandler },
|
25
25
|
React.createElement(Router, Object.assign({ basename: channelHandler.getChannelBasename() || undefined }, routerProps),
|
26
26
|
React.createElement(AuthProvider, { auth: authHandler }, children))))))))))));
|
package/boot/SharedTree.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"SharedTree.js","sourceRoot":"","sources":["SharedTree.tsx"],"names":[],"mappings":"AAAA,OAAO,iBAEN,MAAM,2CAA2C,CAAC;AAEnD,OAAO,KAAuB,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,UAAU;AACV,OAAO,EAAW,eAAe,EAAE,MAAM,cAAc,CAAC;AACxD,WAAW;AACX,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGpD,OAAO,YAAY,MAAM,wCAAwC,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,mBAAmB;AACnB,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAe,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAG3E,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAgBpE,MAAM,UAAU,GAAG,CAAC,EAClB,gBAAgB,EAChB,OAAO,EACP,aAAa,EACb,QAAQ,EACR,MAAM,EACN,MAAM,EACN,WAAW,EACX,MAAM,EACN,WAAW,EACX,QAAQ,EACR,cAAc,EACd,cAAc,EACE,EAAgB,EAAE;IAClC,OAAO,CACL,oBAAC,cAAc,IAAC,MAAM,EAAE,MAAM;QAC5B,oBAAC,qBAAqB;YACpB,oBAAC,eAAe,IAAC,OAAO,EAAE,OAAO;gBAC/B,oBAAC,cAAc,IAAC,OAAO,EAAE,aAAa;oBACpC,oBAAC,kBAAkB,IAAC,KAAK,EAAE,gBAAgB;wBACzC,oBAAC,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;4BAC5B,oBAAC,eAAe,IACd,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,cAAc;gCAE9B,oBAAC,iBAAiB,IAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO;oCACrD,oBAAC,eAAe,IAAC,cAAc,EAAE,cAAc;wCAC7C,oBAAC,MAAM,kBACL,QAAQ,EACN,cAAc,CAAC,kBAAkB,EAAE,IAAI,SAAS,IAE9C,WAAW;4CAEf,oBAAC,YAAY,IAAC,IAAI,EAAE,WAAW,IAC5B,QAAQ,CACI,CACR,CACO,CACA,CACJ,CACH,CACE,CACN,CACD,CACI,CACT,CAClB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
package/boot/apollo.js
CHANGED
@@ -115,7 +115,7 @@ export const createClient = ({ apolloConfig: { token, shopid, enableGateway, gra
|
|
115
115
|
return forward ? forward(operation) : null;
|
116
116
|
});
|
117
117
|
const errorMiddleware = onError((_a) => {
|
118
|
-
var _b
|
118
|
+
var _b;
|
119
119
|
var { graphQLErrors, networkError, operation } = _a, rest = __rest(_a, ["graphQLErrors", "networkError", "operation"]);
|
120
120
|
if (graphQLErrors) {
|
121
121
|
graphQLErrors.forEach((error) => {
|
@@ -151,7 +151,7 @@ export const createClient = ({ apolloConfig: { token, shopid, enableGateway, gra
|
|
151
151
|
}
|
152
152
|
// 503
|
153
153
|
if (networkError) {
|
154
|
-
const errors = (
|
154
|
+
const errors = (_b = networkError === null || networkError === void 0 ? void 0 : networkError.result) === null || _b === void 0 ? void 0 : _b.Errors;
|
155
155
|
if (errors) {
|
156
156
|
errors.forEach((error) => {
|
157
157
|
if ((error === null || error === void 0 ? void 0 : error.Message) === 'Token has expired') {
|
package/boot/apollo.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"apollo.js","sourceRoot":"","sources":["apollo.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;A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AW,EAAE,CAAC;IAE5B,MAAM,MAAM,GAAwC,IAAI,YAAY,CAAC;QACnE,IAAI;QACJ,sBAAsB,EAAE,IAAI;QAC5B,KAAK,EAAE,aAAa;YAClB,CAAC,CAAC,KAAK;YACP,CAAC,CAAC,KAAK,CAAC,OAAO,CAAE,MAAc,CAAC,gBAAgB,CAAC;QACnD,OAAO,EAAE,CAAC,CAAC,aAAa;QACxB,SAAS,EAAE,SAAS,CAClB,EAAE,CAAC,SAAS,CAAC,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC,CACnE;QACD,QAAQ;KACT,CAAC,CAAC;IAEH,OAAO,EAAE,MAAM,EAAE,CAAC;AACpB,CAAC,CAAC"}
|
@@ -151,6 +151,7 @@ const createRenderer = (template, tree, options) => {
|
|
151
151
|
preserveRedirect: true,
|
152
152
|
routes: options.routes
|
153
153
|
});
|
154
|
+
console.log({ redirectUrl });
|
154
155
|
return res.redirect(302, redirectUrl);
|
155
156
|
}
|
156
157
|
const persistedQueries = yield ((_a = getPersistedQueriesForRequest(persistedQueryClients, createClientOpts)) === null || _a === void 0 ? void 0 : _a.extractCache());
|
@@ -216,10 +217,10 @@ const createRenderer = (template, tree, options) => {
|
|
216
217
|
apolloState: apolloState,
|
217
218
|
polyfill,
|
218
219
|
preloadLinks,
|
219
|
-
preloadScripts:
|
220
|
-
geoipCountryScript +
|
220
|
+
preloadScripts: geoipCountryScript +
|
221
221
|
acceptedLanguagesScript +
|
222
|
-
statusCodeScript
|
222
|
+
statusCodeScript +
|
223
|
+
preloadScripts,
|
223
224
|
title: title.toString(),
|
224
225
|
meta: meta.toString() + link.toString(),
|
225
226
|
style: style.toString() + breakpointScript + preloadStyles,
|