@jetshop/core 5.16.0-alpha.86c426f4 → 5.16.0
Sign up to get free protection for your applications and to get access to all the features.
- package/ChannelHandler/ChannelHandler.d.ts +1 -0
- package/ChannelHandler/ChannelHandler.js +4 -5
- package/ChannelHandler/ChannelHandler.js.map +1 -1
- package/ChannelHandler/channelUtils.d.ts +1 -0
- package/ChannelHandler/channelUtils.js +2 -1
- package/ChannelHandler/channelUtils.js.map +1 -1
- package/analytics/AnalyticsProvider.d.ts +6 -9
- package/analytics/AnalyticsProvider.js +87 -80
- package/analytics/AnalyticsProvider.js.map +1 -1
- package/analytics/integrations/ga4.d.ts +9 -5
- package/analytics/integrations/ga4.js +36 -31
- package/analytics/integrations/ga4.js.map +1 -1
- package/analytics/integrations/gtag/gtag.js +19 -19
- package/analytics/integrations/gtag/gtag.js.map +1 -1
- package/boot/client/startClient.js +2 -1
- package/boot/client/startClient.js.map +1 -1
- package/boot/server/createRenderer.js +2 -1
- package/boot/server/createRenderer.js.map +1 -1
- package/data/fragments/ChannelsFragment.gql +5 -0
- package/data/fragments/StockStatusFragment.gql +1 -0
- package/package.json +1 -1
- package/server/tracking/facebook.js +16 -1
- package/server/tracking/facebook.js.map +1 -1
- package/types.d.ts +35 -6
@@ -22,6 +22,7 @@ export declare class ChannelHandler {
|
|
22
22
|
setRecommendedChannel: (recommendedChannel: SelectedChannel) => void;
|
23
23
|
getRecommendedChannel: () => SelectedChannel;
|
24
24
|
setChannels: (channels: Channel[]) => void;
|
25
|
+
setChannelGroup: (channels: Channel[]) => void;
|
25
26
|
getChannels: () => Channel[];
|
26
27
|
getChannelHeaders: () => {
|
27
28
|
currency: string;
|
@@ -10,7 +10,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
10
10
|
return t;
|
11
11
|
};
|
12
12
|
import qs from 'qs';
|
13
|
-
import { getChannelBasename, getChannelHeaders, getLanguageFromCulture, isInDev
|
13
|
+
import { getChannelBasename, getChannelHeaders, getLanguageFromCulture, isInDev } from './channelUtils';
|
14
14
|
export class ChannelHandler {
|
15
15
|
constructor(args = {
|
16
16
|
selectedChannel: undefined,
|
@@ -30,10 +30,9 @@ export class ChannelHandler {
|
|
30
30
|
this.getRecommendedChannel = () => this.recommendedChannel;
|
31
31
|
this.setChannels = (channels) => {
|
32
32
|
this.channels = channels;
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
});
|
33
|
+
};
|
34
|
+
this.setChannelGroup = (channels) => {
|
35
|
+
this.selectedChannelGroup = channels;
|
37
36
|
};
|
38
37
|
this.getChannels = () => this.channels;
|
39
38
|
this.getChannelHeaders = () => getChannelHeaders(this.selectedChannel);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ChannelHandler.js","sourceRoot":"","sources":["ChannelHandler.ts"],"names":[],"mappings":";;;;;;;;;;;AAEA,OAAO,EAAE,MAAM,IAAI,CAAC;AAGpB,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,sBAAsB,EACtB,OAAO,
|
1
|
+
{"version":3,"file":"ChannelHandler.js","sourceRoot":"","sources":["ChannelHandler.ts"],"names":[],"mappings":";;;;;;;;;;;AAEA,OAAO,EAAE,MAAM,IAAI,CAAC;AAGpB,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,sBAAsB,EACtB,OAAO,EACR,MAAM,gBAAgB,CAAC;AAGxB,MAAM,OAAO,cAAc;IAOzB,YACE,OAMI;QACF,eAAe,EAAE,SAAS;QAC1B,kBAAkB,EAAE,SAAS;QAC7B,QAAQ,EAAE,SAAS;QACnB,mBAAmB,EAAE,SAAS;QAC9B,oBAAoB,EAAE,SAAS;KAChC;QAgBH,2BAAsB,GAAG,CAAC,mBAAwC,EAAE,EAAE,CACpE,CAAC,IAAI,CAAC,mBAAmB,GAAG,mBAAmB,CAAC,CAAC;QAEnD,uBAAkB,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,eAAe,CAAC;QAEhD,uBAAkB,GAAG,CAAC,eAAgC,EAAE,EAAE;YACxD,IAAI,CAAC,eAAe,GAA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ACR,mBAAmB,EACnB,oBAAoB,EACrB,GAAG,IAAI,CAAC;QACT,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;QACvC,IAAI,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;QAC7C,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,mBAAmB,GAAG,mBAAmB,CAAC;QAC/C,IAAI,CAAC,oBAAoB,GAAG,oBAAoB,CAAC;IACnD,CAAC;IAqIO,sBAAsB,CAAC,GAAW;QACxC,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;QAC/B,MAAM,QAAQ,GAAG,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAC3C,MAAM,aAAa,GAAG,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,KAAK,CAAC,GAAG,CAAC,KAAI,EAAE,CAAC;QACjD,aAAa,CAAC,KAAK,EAAE,CAAC;QACtB,IAAI,IAAI,GAAG,SAAS,CAAC,QAAQ,CAAC;QAC9B,aAAa,CAAC,OAAO,CACnB,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAC7D,CAAC;QACF,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
|
@@ -56,6 +56,7 @@ export declare function getSelectedAndRecommendedChannel({ url, singleDomainMode
|
|
56
56
|
selectedChannel: SelectedChannel;
|
57
57
|
recommendedChannel: SelectedChannel;
|
58
58
|
channels: Channel[];
|
59
|
+
group: Channel[];
|
59
60
|
};
|
60
61
|
export declare function getChannelHeaders(channel?: SelectedChannel): {
|
61
62
|
currency: string;
|
@@ -295,7 +295,8 @@ export function getSelectedAndRecommendedChannel({ url, singleDomainMode, channe
|
|
295
295
|
selectedChannel,
|
296
296
|
recommendedChannel,
|
297
297
|
// for testing purposes mainly
|
298
|
-
channels: availableChannels
|
298
|
+
channels: availableChannels,
|
299
|
+
group: availableChannels
|
299
300
|
};
|
300
301
|
}
|
301
302
|
export function getChannelHeaders(channel) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"channelUtils.js","sourceRoot":"","sources":["channelUtils.ts"],"names":[],"mappings":"AAEA,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAG1D,OAAO,EAAE,MAAM,IAAI,CAAC;AAapB,MAAM,kBAAkB,GAAG,CAAC,iBAA4B,EAAE,EAAE,CAC1D,iBAAiB,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,EAAE,WAAC,OAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,SAAS,0CAAE,MAAM,CAAA,EAAA,CAAC,CAAC;AAEnE,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAChC,iBAA4B,EAC5B,EAAE,SAAS,EAAyB,EACtB,EAAE;IAChB,MAAM,cAAc,GAAG,iBAAiB,CAAC,IAAI,CAC3C,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,SAAS,KAAK,SAAS,CAC7C,CAAC;IAEF,IAAI,CAAC,cAAc,EAAE;QACnB,OAAO,SAAS,CAAC;KAClB;IAED,MAAM,oBAAoB,GAAG,iBAAiB,CAAC,MAAM,CACnD,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,SAAS,KAAK,cAAc,CAAC,SAAS,CAC5D,CAAC;IAEF,IAAI,oBAAoB,CAAC,MAAM,GAAG,CAAC,EAAE;QACnC,OAAO,oBAAoB,CAAC;KAC7B;SAAM;QACL,OAAO,SAAS,CAAC;KAClB;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,GAAQ,EAAE,EAAE;IACzC,OAAO,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AACpC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG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,6 +1,5 @@
|
|
1
1
|
import React, { Context } from 'react';
|
2
2
|
import { SelectedChannel } from '../components/ChannelContext/ChannelContext';
|
3
|
-
import { BootOptions } from '../components/ConfigProvider';
|
4
3
|
import { TrackerRegistry } from './trackerRegistry';
|
5
4
|
import { Scalars } from '../types';
|
6
5
|
import { Cookies } from 'react-cookie';
|
@@ -10,13 +9,18 @@ export interface AnalyticsConfigReleware {
|
|
10
9
|
uid?: string;
|
11
10
|
}
|
12
11
|
export interface AnalyticsConfig {
|
13
|
-
|
12
|
+
ga: {
|
14
13
|
trackingId: string;
|
15
14
|
useArticleNumberAsId?: boolean;
|
16
15
|
additionalGtagTrackingIds: string[];
|
17
16
|
};
|
17
|
+
ga4: {
|
18
|
+
trackingId: string;
|
19
|
+
useArticleNumberAsId?: boolean;
|
20
|
+
};
|
18
21
|
gtm: {
|
19
22
|
containerId: string;
|
23
|
+
useGa4Events: boolean;
|
20
24
|
};
|
21
25
|
releware?: AnalyticsConfigReleware;
|
22
26
|
trackingAllowed: boolean;
|
@@ -46,12 +50,5 @@ export declare const getFacebookCapi: (selectedChannel: SelectedChannel) => {
|
|
46
50
|
token: string;
|
47
51
|
pixelId: string;
|
48
52
|
};
|
49
|
-
export declare const getGoogleAnalytics: (config: BootOptions, selectedChannel: SelectedChannel) => {
|
50
|
-
trackingID: string;
|
51
|
-
useArticleNumberAsId: boolean;
|
52
|
-
tagManagerID: string;
|
53
|
-
additionalGtagTrackingIds: string[];
|
54
|
-
useTrackingConsentAPI: boolean;
|
55
|
-
};
|
56
53
|
declare const AnalyticsProvider: React.FC<AnalyticsProviderProps>;
|
57
54
|
export default AnalyticsProvider;
|
@@ -22,12 +22,16 @@ function isMSExternal(external) {
|
|
22
22
|
return 'msTrackingProtectionEnabled' in external;
|
23
23
|
}
|
24
24
|
const initialAnalyticsConfig = {
|
25
|
-
|
26
|
-
trackingId:
|
25
|
+
ga: {
|
26
|
+
trackingId: '',
|
27
27
|
useArticleNumberAsId: false,
|
28
|
-
additionalGtagTrackingIds:
|
28
|
+
additionalGtagTrackingIds: []
|
29
29
|
},
|
30
|
-
|
30
|
+
ga4: {
|
31
|
+
trackingId: '',
|
32
|
+
useArticleNumberAsId: false
|
33
|
+
},
|
34
|
+
gtm: { containerId: '', useGa4Events: false },
|
31
35
|
releware: {
|
32
36
|
enabled: false,
|
33
37
|
baseUrl: null,
|
@@ -55,32 +59,14 @@ export const getFacebookCapi = (selectedChannel) => {
|
|
55
59
|
pixelId
|
56
60
|
};
|
57
61
|
};
|
58
|
-
|
59
|
-
var _a
|
60
|
-
|
61
|
-
const
|
62
|
-
? config.channelOverrides[selectedChannel.name]
|
63
|
-
: {};
|
64
|
-
let { trackingID, tagManagerID, useArticleNumberAsId,
|
65
|
-
// eslint-disable-next-line prefer-const
|
66
|
-
additionalGtagTrackingIds,
|
67
|
-
// eslint-disable-next-line prefer-const
|
68
|
-
useTrackingConsentAPI } = Object.assign(Object.assign({}, config), channelOverrides);
|
69
|
-
if ((_c = (_b = (_a = selectedChannel.settings) === null || _a === void 0 ? void 0 : _a.tracking) === null || _b === void 0 ? void 0 : _b.ga) === null || _c === void 0 ? void 0 : _c.trackingId) {
|
70
|
-
trackingID = selectedChannel.settings.tracking.ga.trackingId;
|
71
|
-
}
|
72
|
-
if ((_f = (_e = (_d = selectedChannel.settings) === null || _d === void 0 ? void 0 : _d.tracking) === null || _e === void 0 ? void 0 : _e.ga) === null || _f === void 0 ? void 0 : _f.useArticleNumberAsId) {
|
73
|
-
useArticleNumberAsId =
|
74
|
-
selectedChannel.settings.tracking.ga.useArticleNumberAsId;
|
75
|
-
}
|
76
|
-
if ((_j = (_h = (_g = selectedChannel.settings) === null || _g === void 0 ? void 0 : _g.tracking) === null || _h === void 0 ? void 0 : _h.gtm) === null || _j === void 0 ? void 0 : _j.containerId) {
|
77
|
-
tagManagerID = selectedChannel.settings.tracking.gtm.containerId;
|
78
|
-
}
|
62
|
+
const getGoogleAnalytics = (shopConfig, selectedChannel) => {
|
63
|
+
var _a;
|
64
|
+
const { additionalGtagTrackingIds, useTrackingConsentAPI } = shopConfig;
|
65
|
+
const { ga, gtm, ga4 } = ((_a = selectedChannel.settings) === null || _a === void 0 ? void 0 : _a.tracking) || initialAnalyticsConfig;
|
79
66
|
return {
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
additionalGtagTrackingIds,
|
67
|
+
ga: Object.assign(Object.assign({}, ga), { additionalGtagTrackingIds }),
|
68
|
+
gtm,
|
69
|
+
ga4,
|
84
70
|
useTrackingConsentAPI
|
85
71
|
};
|
86
72
|
};
|
@@ -88,80 +74,101 @@ const AnalyticsProvider = function AnalyticsProvider(props) {
|
|
88
74
|
const shopConfig = useShopConfig();
|
89
75
|
const { selectedChannel } = useContext(ChannelContext);
|
90
76
|
const consentedToTracking = props.cookies.get('cookieConsent');
|
91
|
-
const
|
77
|
+
const config = getGoogleAnalytics(shopConfig, selectedChannel);
|
92
78
|
const { pixelId, token } = getFacebookCapi(selectedChannel);
|
93
79
|
const trackingAllowed = allowsTrackingWithDNT();
|
94
80
|
const analyticsConfig = React.useMemo(() => ({
|
95
|
-
|
96
|
-
trackingId:
|
97
|
-
additionalGtagTrackingIds: additionalGtagTrackingIds,
|
98
|
-
useArticleNumberAsId: useArticleNumberAsId
|
81
|
+
ga: {
|
82
|
+
trackingId: config.ga.trackingId,
|
83
|
+
additionalGtagTrackingIds: config.ga.additionalGtagTrackingIds,
|
84
|
+
useArticleNumberAsId: config.ga.useArticleNumberAsId
|
85
|
+
},
|
86
|
+
ga4: {
|
87
|
+
trackingId: config.ga4.trackingId,
|
88
|
+
useArticleNumberAsId: config.ga4.useArticleNumberAsId
|
99
89
|
},
|
100
90
|
gtm: {
|
101
|
-
containerId:
|
91
|
+
containerId: config.gtm.containerId,
|
92
|
+
useGa4Events: config.gtm.useGa4Events
|
102
93
|
},
|
103
94
|
releware: props.releware,
|
104
95
|
trackingAllowed: trackingAllowed,
|
105
96
|
consentedToTracking: consentedToTracking === 'agreed',
|
106
97
|
cookies: props.cookies,
|
107
|
-
useTrackingConsentAPI
|
98
|
+
useTrackingConsentAPI: config.useTrackingConsentAPI
|
108
99
|
}), [
|
109
|
-
|
110
|
-
additionalGtagTrackingIds,
|
111
|
-
useArticleNumberAsId,
|
112
|
-
|
100
|
+
config.ga.trackingId,
|
101
|
+
config.ga.additionalGtagTrackingIds,
|
102
|
+
config.ga.useArticleNumberAsId,
|
103
|
+
config.ga4.trackingId,
|
104
|
+
config.ga4.useArticleNumberAsId,
|
105
|
+
config.gtm.containerId,
|
106
|
+
config.gtm.useGa4Events,
|
107
|
+
config.useTrackingConsentAPI,
|
113
108
|
props.releware,
|
114
|
-
trackingAllowed,
|
115
|
-
consentedToTracking,
|
116
109
|
props.cookies,
|
117
|
-
|
110
|
+
trackingAllowed,
|
111
|
+
consentedToTracking
|
118
112
|
]);
|
119
|
-
const { gtm,
|
113
|
+
const { gtm, ga, ga4, releware } = analyticsConfig;
|
120
114
|
const registry = useMemo(() => trackerRegistry({
|
121
115
|
config: analyticsConfig,
|
122
116
|
inServer: __IN_SERVER__
|
123
117
|
}), [analyticsConfig]);
|
124
|
-
if (
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
}));
|
133
|
-
}
|
134
|
-
else if (gtag === null || gtag === void 0 ? void 0 : gtag.trackingId) {
|
135
|
-
registry.add(gtagTracker({
|
136
|
-
currency: selectedChannel.currency.format.code,
|
137
|
-
trackingId: gtag.trackingId,
|
138
|
-
additionalGtagTrackingIds: gtag.additionalGtagTrackingIds,
|
139
|
-
brandCustomField: shopConfig.brandCustomField,
|
140
|
-
useArticleNumberAsId: gtag.useArticleNumberAsId
|
141
|
-
}));
|
142
|
-
}
|
118
|
+
if (ga.trackingId) {
|
119
|
+
registry.add(gtagTracker({
|
120
|
+
currency: selectedChannel.currency.format.code,
|
121
|
+
trackingId: ga.trackingId,
|
122
|
+
additionalGtagTrackingIds: ga.additionalGtagTrackingIds,
|
123
|
+
brandCustomField: shopConfig.brandCustomField,
|
124
|
+
useArticleNumberAsId: ga.useArticleNumberAsId
|
125
|
+
}));
|
143
126
|
}
|
144
|
-
if (
|
145
|
-
registry.add(
|
127
|
+
else if (ga.trackingId.startsWith('G-')) {
|
128
|
+
registry.add(ga4Tracker({
|
129
|
+
currency: selectedChannel.currency.format.code,
|
130
|
+
trackingId: ga.trackingId,
|
131
|
+
additionalGtagTrackingIds: [],
|
132
|
+
brandCustomField: shopConfig.brandCustomField,
|
133
|
+
useArticleNumberAsId: ga.useArticleNumberAsId
|
134
|
+
}));
|
135
|
+
}
|
136
|
+
if (ga4.trackingId || gtm.useGa4Events) {
|
137
|
+
registry.add(ga4Tracker({
|
138
|
+
currency: selectedChannel.currency.format.code,
|
139
|
+
trackingId: ga4.trackingId,
|
140
|
+
additionalGtagTrackingIds: [],
|
141
|
+
brandCustomField: shopConfig.brandCustomField,
|
142
|
+
useArticleNumberAsId: ga4.useArticleNumberAsId
|
143
|
+
}));
|
146
144
|
}
|
147
|
-
if (gtm
|
148
|
-
referrerModifier(
|
145
|
+
if (gtm.containerId) {
|
146
|
+
referrerModifier(ga.trackingId || ga4.trackingId);
|
149
147
|
registry.add(gtmTracker({
|
150
148
|
containerId: gtm.containerId,
|
151
149
|
currency: selectedChannel.currency.format.code,
|
152
150
|
brandCustomField: shopConfig.brandCustomField,
|
153
|
-
useArticleNumberAsId
|
151
|
+
useArticleNumberAsId: ga.useArticleNumberAsId || ga4.useArticleNumberAsId
|
154
152
|
}));
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
153
|
+
}
|
154
|
+
// What do we do about this?
|
155
|
+
// This is something we did for B***an* so that they'd have GTAG events in GTM,
|
156
|
+
// this can safely be removed since they already have a 'dummy-UA' added in admin (we can run everything in paralell now)
|
157
|
+
// const registred = registry.trackers();
|
158
|
+
// if (!registred.includes('ga4') && !registred.includes('gtag')) {
|
159
|
+
// registry.add(
|
160
|
+
// gtagTracker({
|
161
|
+
// currency: selectedChannel.currency.format.code,
|
162
|
+
// trackingId: gtm.containerId,
|
163
|
+
// additionalGtagTrackingIds: [],
|
164
|
+
// brandCustomField: shopConfig.brandCustomField,
|
165
|
+
// useArticleNumberAsId:
|
166
|
+
// ga.useArticleNumberAsId || ga4.useArticleNumberAsId
|
167
|
+
// })
|
168
|
+
// );
|
169
|
+
// }
|
170
|
+
if (releware === null || releware === void 0 ? void 0 : releware.enabled) {
|
171
|
+
registry.add(relewareTracker(releware));
|
165
172
|
}
|
166
173
|
if (shopConfig.trackers) {
|
167
174
|
shopConfig.trackers.forEach((tracker) => {
|
@@ -171,7 +178,7 @@ const AnalyticsProvider = function AnalyticsProvider(props) {
|
|
171
178
|
if (shopConfig.serverTrackers) {
|
172
179
|
registry.add(createServerTracker({
|
173
180
|
currency: selectedChannel.currency.format.code,
|
174
|
-
useArticleNumberAsId:
|
181
|
+
useArticleNumberAsId: ga.useArticleNumberAsId || ga4.useArticleNumberAsId,
|
175
182
|
pixelId,
|
176
183
|
token
|
177
184
|
}));
|
@@ -183,7 +190,7 @@ const AnalyticsProvider = function AnalyticsProvider(props) {
|
|
183
190
|
};
|
184
191
|
}, [analyticsConfig, registry]);
|
185
192
|
const preconnectLinks = usePreconnectLinks({
|
186
|
-
ga: consentedToTracking && !!(
|
193
|
+
ga: consentedToTracking && !!(ga === null || ga === void 0 ? void 0 : ga.trackingId),
|
187
194
|
gtm: consentedToTracking && !!(gtm === null || gtm === void 0 ? void 0 : gtm.containerId)
|
188
195
|
});
|
189
196
|
return (React.createElement(AnalyticsContext.Provider, { value: value },
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"AnalyticsProvider.js","sourceRoot":"","sources":["AnalyticsProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAW,aAAa,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC3E,O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EAAE,mBAAmB,IAAI,CAAC,CAAC,CAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,WAAW,CAAA;KAC/C,CAAC,CAAC;IAEH,OAAO,CACL,oBAAC,gBAAgB,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK;QACrC,oBAAC,MAAM,QACJ,eAAe,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CAC9C,4CACE,GAAG,EAAC,YAAY,EAChB,IAAI,EAAE,IAAI,IACN,CAAC,WAAW,IAAI,EAAE,WAAW,EAAE,CAAC,IACpC,GAAG,EAAE,IAAI,IACT,CACH,CAAC,CACK;QACR,KAAK,CAAC,QAAQ,CACW,CAC7B,CAAC;AACJ,CAAC,CAAC;AAEJ,SAAS,qBAAqB;IAC5B,IAAI,OAAO,MAAM,KAAK,WAAW;QAAE,OAAO,KAAK,CAAC;IAEhD,MAAM,GAAG,GACN,MAAc,CAAC,UAAU;QAC1B,SAAS,CAAC,UAAU;QACpB,8BAA8B;QAC7B,SAAyB,CAAC,YAAY,CAAC;IAE1C,IAAI,GAAG,KAAK,GAAG,IAAI,GAAG,KAAK,KAAK,EAAE;QAChC,OAAO,KAAK,CAAC;KACd;IAED,qBAAqB;IACrB,IAAI,MAAM,CAAC,QAAQ,IAAI,YAAY,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE;QACpD,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,2BAA2B,EAAE,CAAC;KACvD;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED,eAAe,iBAAiB,CAAC"}
|
@@ -1,13 +1,16 @@
|
|
1
1
|
import { Tracker } from '../trackerRegistry';
|
2
|
-
|
3
|
-
item_name: string;
|
4
|
-
item_id: string;
|
5
|
-
price: number;
|
6
|
-
item_brand?: string;
|
2
|
+
interface GA4Categories {
|
7
3
|
item_category: string;
|
8
4
|
item_category2?: string;
|
9
5
|
item_category3?: string;
|
10
6
|
item_category4?: string;
|
7
|
+
item_category5?: string;
|
8
|
+
}
|
9
|
+
export interface GA4Item extends GA4Categories {
|
10
|
+
item_name: string;
|
11
|
+
item_id: string;
|
12
|
+
price: number;
|
13
|
+
item_brand?: string;
|
11
14
|
item_variant: string;
|
12
15
|
item_list_name?: string;
|
13
16
|
item_list_id?: string;
|
@@ -21,3 +24,4 @@ export declare function ga4Tracker({ trackingId, additionalGtagTrackingIds, curr
|
|
21
24
|
brandCustomField: string;
|
22
25
|
useArticleNumberAsId?: boolean;
|
23
26
|
}): Tracker;
|
27
|
+
export {};
|
@@ -2,19 +2,24 @@ import { injectScript } from '../utils/script';
|
|
2
2
|
import { getBrand } from '../../../core/components/OpenGraph/OpenGraphProductData';
|
3
3
|
import { Cookies } from 'react-cookie';
|
4
4
|
import { CONSENT_COOKIE_NAME, defaultConsentSettings } from '../AnalyticsProvider';
|
5
|
-
const
|
5
|
+
const ga4 = () => window.gtag;
|
6
6
|
function productToItem(product, selectedVariation, useArticleNumberAsId = false, brandCustomField, category) {
|
7
7
|
var _a, _b, _c, _d;
|
8
|
-
|
9
|
-
|
10
|
-
|
8
|
+
const item_categories = category
|
9
|
+
.split('/')
|
10
|
+
.filter(Boolean)
|
11
|
+
.reduce((acc, c, i) => {
|
12
|
+
if (i === 0) {
|
13
|
+
acc.item_category = c;
|
14
|
+
}
|
15
|
+
else {
|
16
|
+
acc[`item_category${i + 1}`] = c;
|
17
|
+
}
|
18
|
+
return acc;
|
19
|
+
}, {});
|
20
|
+
return Object.assign({ item_name: product === null || product === void 0 ? void 0 : product.name, item_id: useArticleNumberAsId
|
11
21
|
? product === null || product === void 0 ? void 0 : product.articleNumber
|
12
|
-
: (_a = product === null || product === void 0 ? void 0 : product.id) === null || _a === void 0 ? void 0 : _a.toString(),
|
13
|
-
price: ((_b = selectedVariation === null || selectedVariation === void 0 ? void 0 : selectedVariation.price) === null || _b === void 0 ? void 0 : _b.incVat) || ((_c = product === null || product === void 0 ? void 0 : product.price) === null || _c === void 0 ? void 0 : _c.incVat),
|
14
|
-
item_category: category,
|
15
|
-
item_variant: (_d = selectedVariation === null || selectedVariation === void 0 ? void 0 : selectedVariation.values) === null || _d === void 0 ? void 0 : _d.join('_'),
|
16
|
-
item_brand: getBrand(product, brandCustomField)
|
17
|
-
};
|
22
|
+
: (_a = product === null || product === void 0 ? void 0 : product.id) === null || _a === void 0 ? void 0 : _a.toString(), price: ((_b = selectedVariation === null || selectedVariation === void 0 ? void 0 : selectedVariation.price) === null || _b === void 0 ? void 0 : _b.incVat) || ((_c = product === null || product === void 0 ? void 0 : product.price) === null || _c === void 0 ? void 0 : _c.incVat), item_variant: (_d = selectedVariation === null || selectedVariation === void 0 ? void 0 : selectedVariation.values) === null || _d === void 0 ? void 0 : _d.join('_'), item_brand: getBrand(product, brandCustomField) }, item_categories);
|
18
23
|
}
|
19
24
|
export function ga4Tracker({ trackingId, additionalGtagTrackingIds = [], currency, brandCustomField, useArticleNumberAsId = false }) {
|
20
25
|
return {
|
@@ -36,30 +41,30 @@ export function ga4Tracker({ trackingId, additionalGtagTrackingIds = [], currenc
|
|
36
41
|
};
|
37
42
|
if (config.useTrackingConsentAPI) {
|
38
43
|
const consents = config.cookies.get(CONSENT_COOKIE_NAME) || defaultConsentSettings;
|
39
|
-
// NB: Only cookieless pings will be sent to Google servers.
|
44
|
+
// NB: Only cookieless pings will be sent to Google servers. https://support.google.com/analytics/answer/9976101?hl=en
|
40
45
|
// There’s also a wait time of 500 milliseconds before any Google tags are allowed to fire,
|
41
46
|
// to give time for the update command to be invoked.
|
42
|
-
|
47
|
+
ga4()('consent', 'default', Object.assign({}, consents));
|
43
48
|
// NB: This only works when you set ad_storage to denied.
|
44
49
|
// https://developers.google.com/tag-platform/devguides/consent#redact_ads_data
|
45
|
-
|
50
|
+
ga4()('set', 'ads_data_redaction', true);
|
46
51
|
}
|
47
52
|
w.gtag('js', new Date());
|
48
53
|
if (process.env.REACT_APP_DEBUG_MODE === 'true') {
|
49
|
-
|
54
|
+
ga4()('config', trackingId, {
|
50
55
|
debug_mode: true
|
51
56
|
});
|
52
57
|
}
|
53
58
|
else {
|
54
|
-
|
59
|
+
ga4()('config', trackingId);
|
55
60
|
}
|
56
61
|
additionalGtagTrackingIds.forEach((id) => {
|
57
|
-
|
62
|
+
ga4()('config', id);
|
58
63
|
});
|
59
64
|
injectScript({
|
60
65
|
src: `https://www.googletagmanager.com/gtag/js?id=${trackingId}`
|
61
66
|
});
|
62
|
-
|
67
|
+
ga4();
|
63
68
|
},
|
64
69
|
consent(consents) {
|
65
70
|
const cookies = new Cookies();
|
@@ -73,14 +78,14 @@ export function ga4Tracker({ trackingId, additionalGtagTrackingIds = [], currenc
|
|
73
78
|
functionality_storage: 'granted',
|
74
79
|
security_storage: 'granted'
|
75
80
|
};
|
76
|
-
|
81
|
+
ga4()('consent', 'update', Object.assign({}, consent));
|
77
82
|
cookies.set(CONSENT_COOKIE_NAME, JSON.stringify(Object.assign({}, consent)));
|
78
83
|
},
|
79
84
|
trackProduct({ quantity, action, product, selectedVariation, list, listName, index, category }, context, eventId) {
|
80
85
|
const productItem = Object.assign(Object.assign({}, productToItem(product, selectedVariation, useArticleNumberAsId, brandCustomField, category)), { quantity, item_list_name: list || listName || context.list, index: index });
|
81
86
|
switch (action) {
|
82
87
|
case 'click':
|
83
|
-
|
88
|
+
ga4()('event', 'select_item', {
|
84
89
|
content_type: 'product',
|
85
90
|
currency,
|
86
91
|
value: product.price.incVat,
|
@@ -89,7 +94,7 @@ export function ga4Tracker({ trackingId, additionalGtagTrackingIds = [], currenc
|
|
89
94
|
});
|
90
95
|
break;
|
91
96
|
case 'view':
|
92
|
-
|
97
|
+
ga4()('event', 'view_item', {
|
93
98
|
currency,
|
94
99
|
value: product.price.incVat,
|
95
100
|
items: [productItem],
|
@@ -97,7 +102,7 @@ export function ga4Tracker({ trackingId, additionalGtagTrackingIds = [], currenc
|
|
97
102
|
});
|
98
103
|
break;
|
99
104
|
case 'add':
|
100
|
-
|
105
|
+
ga4()('event', 'add_to_cart', {
|
101
106
|
currency,
|
102
107
|
value: product.price.incVat,
|
103
108
|
items: [productItem],
|
@@ -105,7 +110,7 @@ export function ga4Tracker({ trackingId, additionalGtagTrackingIds = [], currenc
|
|
105
110
|
});
|
106
111
|
break;
|
107
112
|
case 'remove':
|
108
|
-
|
113
|
+
ga4()('event', 'remove_from_cart', {
|
109
114
|
currency,
|
110
115
|
value: product.price.incVat,
|
111
116
|
items: [productItem],
|
@@ -128,14 +133,14 @@ export function ga4Tracker({ trackingId, additionalGtagTrackingIds = [], currenc
|
|
128
133
|
// ),
|
129
134
|
// quantity: item.quantity
|
130
135
|
// }));
|
131
|
-
//
|
136
|
+
// ga4()('event', 'begin_checkout', {
|
132
137
|
// currency: currency,
|
133
138
|
// value: cart.productTotal.incVat,
|
134
139
|
// items
|
135
140
|
// });
|
136
141
|
// },
|
137
142
|
trackPageView({ pathname, title }, _context, eventId) {
|
138
|
-
|
143
|
+
ga4()('event', 'page_view', {
|
139
144
|
currency,
|
140
145
|
page_path: pathname,
|
141
146
|
page_title: title,
|
@@ -145,9 +150,9 @@ export function ga4Tracker({ trackingId, additionalGtagTrackingIds = [], currenc
|
|
145
150
|
trackList({ listName, products, category }, _context, eventId) {
|
146
151
|
const items = products.map((product, i) => {
|
147
152
|
var _a;
|
148
|
-
return (Object.assign(Object.assign({}, productToItem(product, null, useArticleNumberAsId, brandCustomField)), { price: (_a = product.price) === null || _a === void 0 ? void 0 : _a.incVat, item_list_name: listName, index: i }));
|
153
|
+
return (Object.assign(Object.assign({}, productToItem(product, null, useArticleNumberAsId, brandCustomField, category)), { price: (_a = product.price) === null || _a === void 0 ? void 0 : _a.incVat, item_list_name: listName, index: i }));
|
149
154
|
});
|
150
|
-
|
155
|
+
ga4()('event', 'view_item_list', {
|
151
156
|
item_list_id: category,
|
152
157
|
item_list_name: listName,
|
153
158
|
items,
|
@@ -155,22 +160,22 @@ export function ga4Tracker({ trackingId, additionalGtagTrackingIds = [], currenc
|
|
155
160
|
});
|
156
161
|
},
|
157
162
|
trackExperiment({ id, variant }, _context, eventId) {
|
158
|
-
|
163
|
+
ga4()('config', trackingId, {
|
159
164
|
experiments: [{ id, variant }],
|
160
165
|
eventId
|
161
166
|
});
|
162
167
|
},
|
163
168
|
trackUser({ userId }, _context, eventId) {
|
164
|
-
|
169
|
+
ga4()('event', 'authentication', { user_id: userId, eventId });
|
165
170
|
},
|
166
171
|
trackLogin(_props, _context, eventId) {
|
167
|
-
|
172
|
+
ga4()('event', 'login', { trackingId, eventId });
|
168
173
|
},
|
169
174
|
trackRegister(_props, _context, eventId) {
|
170
|
-
|
175
|
+
ga4()('event', 'sign_up', { trackingId, eventId });
|
171
176
|
},
|
172
177
|
trackAddToWishList({ articleNumber, productName }, _context, eventId) {
|
173
|
-
|
178
|
+
ga4()('event', 'add_to_wishlist', {
|
174
179
|
articleNumber,
|
175
180
|
productName,
|
176
181
|
eventId
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ga4.js","sourceRoot":"","sources":["ga4.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,QAAQ,EAAE,MAAM,yDAAyD,CAAC;AACnF,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACvB,MAAM,sBAAsB,CAAC;AAE9B,MAAM,
|
1
|
+
{"version":3,"file":"ga4.js","sourceRoot":"","sources":["ga4.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,QAAQ,EAAE,MAAM,yDAAyD,CAAC;AACnF,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACvB,MAAM,sBAAsB,CAAC;AAE9B,MAAM,GAAG,GAAG,GAAG,EAAE,CAAE,MAAc,CAAC,IAAI,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,CAAC,CAAC;QACnD,CAAC;QACD,aAAa,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO;YACrC,GAAG,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC,CAAC;QACrD,CAAC;QACD,kBAAkB,CAAC,EAAE,aAAa,EAAE,WAAW,EAAE,EAAE,QAAQ,EAAE,OAAO;YAClE,GAAG,EAAE,CAAC,OAAO,EAAE,iBAAiB,EAAE;gBAChC,aAAa;gBACb,WAAW;gBACX,OAAO;aACR,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC"}
|
@@ -4,7 +4,7 @@ import { unSlugify } from '../unslugify';
|
|
4
4
|
import { breadcrumbsWithoutProduct } from '../../utils/breadcrumbsWithoutProduct';
|
5
5
|
import { CONSENT_COOKIE_NAME, defaultConsentSettings } from '../../AnalyticsProvider';
|
6
6
|
import { Cookies } from 'react-cookie';
|
7
|
-
const
|
7
|
+
const ua = () => window.gtag;
|
8
8
|
function getProductData({ product, selectedVariation, useArticleNumberAsId = false, brandCustomField, category = '' }) {
|
9
9
|
const brand = getBrand(product, brandCustomField);
|
10
10
|
if (useArticleNumberAsId) {
|
@@ -55,18 +55,18 @@ export const gtagTracker = ({ trackingId, additionalGtagTrackingIds = [], curren
|
|
55
55
|
// NB: Only cookieless pings will be sent to Google servers.
|
56
56
|
// There’s also a wait time of 500 milliseconds before any Google tags are allowed to fire,
|
57
57
|
// to give time for the update command to be invoked.
|
58
|
-
|
58
|
+
ua()('consent', 'default', Object.assign({}, consents));
|
59
59
|
// NB: This only works when you set ad_storage to denied.
|
60
60
|
// https://developers.google.com/tag-platform/devguides/consent#redact_ads_data
|
61
|
-
|
61
|
+
ua()('set', 'ads_data_redaction', true);
|
62
62
|
}
|
63
63
|
w.gtag('js', new Date());
|
64
|
-
|
64
|
+
ua()('config', trackingId, {
|
65
65
|
currency,
|
66
66
|
send_page_view: false
|
67
67
|
});
|
68
68
|
additionalGtagTrackingIds.forEach((id) => {
|
69
|
-
|
69
|
+
ua()('config', id, {
|
70
70
|
currency,
|
71
71
|
send_page_view: false
|
72
72
|
});
|
@@ -74,7 +74,7 @@ export const gtagTracker = ({ trackingId, additionalGtagTrackingIds = [], curren
|
|
74
74
|
injectScript({
|
75
75
|
src: `https://www.googletagmanager.com/gtag/js?id=${trackingId}`
|
76
76
|
});
|
77
|
-
|
77
|
+
ua();
|
78
78
|
},
|
79
79
|
consent(consents) {
|
80
80
|
const cookies = new Cookies();
|
@@ -88,7 +88,7 @@ export const gtagTracker = ({ trackingId, additionalGtagTrackingIds = [], curren
|
|
88
88
|
functionality_storage: 'granted',
|
89
89
|
security_storage: 'granted'
|
90
90
|
};
|
91
|
-
|
91
|
+
ua()('consent', 'update', Object.assign({}, consent));
|
92
92
|
cookies.set(CONSENT_COOKIE_NAME, JSON.stringify(Object.assign({}, consent)));
|
93
93
|
},
|
94
94
|
trackProduct({ quantity, action, product, selectedVariation, list, listName, index, category }, context, eventId) {
|
@@ -102,7 +102,7 @@ export const gtagTracker = ({ trackingId, additionalGtagTrackingIds = [], curren
|
|
102
102
|
(product.price && product.price.incVat), quantity, list_name: list || listName || context.list, list_position: index });
|
103
103
|
switch (action) {
|
104
104
|
case 'click':
|
105
|
-
|
105
|
+
ua()('event', 'select_content', {
|
106
106
|
currency,
|
107
107
|
content_type: 'product',
|
108
108
|
items: [productData],
|
@@ -110,7 +110,7 @@ export const gtagTracker = ({ trackingId, additionalGtagTrackingIds = [], curren
|
|
110
110
|
});
|
111
111
|
break;
|
112
112
|
case 'view':
|
113
|
-
|
113
|
+
ua()('event', 'view_item', {
|
114
114
|
currency,
|
115
115
|
items: [productData],
|
116
116
|
non_interaction: true,
|
@@ -118,14 +118,14 @@ export const gtagTracker = ({ trackingId, additionalGtagTrackingIds = [], curren
|
|
118
118
|
});
|
119
119
|
break;
|
120
120
|
case 'add':
|
121
|
-
|
121
|
+
ua()('event', 'add_to_cart', {
|
122
122
|
currency,
|
123
123
|
items: [productData],
|
124
124
|
eventId
|
125
125
|
});
|
126
126
|
break;
|
127
127
|
case 'remove':
|
128
|
-
|
128
|
+
ua()('event', 'remove_from_cart', {
|
129
129
|
currency,
|
130
130
|
items: [productData],
|
131
131
|
eventId
|
@@ -149,14 +149,14 @@ export const gtagTracker = ({ trackingId, additionalGtagTrackingIds = [], curren
|
|
149
149
|
''
|
150
150
|
})), { price: item.total.incVat, quantity: item.quantity }));
|
151
151
|
});
|
152
|
-
|
152
|
+
ua()('event', 'begin_checkout', {
|
153
153
|
currency,
|
154
154
|
items,
|
155
155
|
eventId
|
156
156
|
});
|
157
157
|
},
|
158
158
|
trackPageView({ pathname, title }, _context, eventId) {
|
159
|
-
|
159
|
+
ua()('event', 'page_view', {
|
160
160
|
currency,
|
161
161
|
page_path: pathname,
|
162
162
|
page_title: title,
|
@@ -176,7 +176,7 @@ export const gtagTracker = ({ trackingId, additionalGtagTrackingIds = [], curren
|
|
176
176
|
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)
|
177
177
|
})), { price: (_d = product.price) === null || _d === void 0 ? void 0 : _d.incVat, list_name: listName, list_position: i }));
|
178
178
|
});
|
179
|
-
|
179
|
+
ua()('event', 'view_item_list', {
|
180
180
|
currency,
|
181
181
|
items: productData,
|
182
182
|
non_interaction: true,
|
@@ -184,22 +184,22 @@ export const gtagTracker = ({ trackingId, additionalGtagTrackingIds = [], curren
|
|
184
184
|
});
|
185
185
|
},
|
186
186
|
trackExperiment({ id, variant }, _context, eventId) {
|
187
|
-
|
187
|
+
ua()('config', trackingId, {
|
188
188
|
experiments: [{ id, variant }],
|
189
189
|
eventId
|
190
190
|
});
|
191
191
|
},
|
192
192
|
trackUser({ userId }, _context, eventId) {
|
193
|
-
|
193
|
+
ua()('event', 'authentication', { user_id: userId, eventId });
|
194
194
|
},
|
195
195
|
trackLogin(_props, _context, eventId) {
|
196
|
-
|
196
|
+
ua()('event', 'login', { trackingId, eventId });
|
197
197
|
},
|
198
198
|
trackRegister(_props, _context, eventId) {
|
199
|
-
|
199
|
+
ua()('event', 'sign_up', { trackingId, eventId });
|
200
200
|
},
|
201
201
|
trackAddToWishList({ articleNumber, productName }, _context, eventId) {
|
202
|
-
|
202
|
+
ua()('event', 'add_to_wishlist', {
|
203
203
|
articleNumber,
|
204
204
|
productName,
|
205
205
|
eventId
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"gtag.js","sourceRoot":"","sources":["gtag.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,QAAQ,EAAE,MAAM,oDAAoD,CAAC;AAC9E,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAC;AAClF,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,MAAM,
|
1
|
+
{"version":3,"file":"gtag.js","sourceRoot":"","sources":["gtag.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,QAAQ,EAAE,MAAM,oDAAoD,CAAC;AAC9E,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAC;AAClF,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,MAAM,EAAE,GAAG,GAAG,EAAE,CAAE,MAAc,CAAC,IAAI,CAAC;AAEtC,SAAS,cAAc,CAAC,EACtB,OAAO,EACP,iBAAiB,EACjB,oBAAoB,GAAG,KAAK,E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AAO;QAChD,EAAE,EAAE,CAAC,QAAQ,EAAE,UAAU,EAAE;YACzB,WAAW,EAAE,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC;YAC9B,OAAO;SACR,CAAC,CAAC;IACL,CAAC;IACD,SAAS,CAAC,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,OAAO;QACrC,EAAE,EAAE,CAAC,OAAO,EAAE,gBAAgB,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;IAChE,CAAC;IACD,UAAU,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO;QAClC,EAAE,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC,CAAC;IAClD,CAAC;IACD,aAAa,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO;QACrC,EAAE,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC,CAAC;IACpD,CAAC;IACD,kBAAkB,CAAC,EAAE,aAAa,EAAE,WAAW,EAAE,EAAE,QAAQ,EAAE,OAAO;QAClE,EAAE,EAAE,CAAC,OAAO,EAAE,iBAAiB,EAAE;YAC/B,aAAa;YACb,WAAW;YACX,OAAO;SACR,CAAC,CAAC;IACL,CAAC;CACF,CAAC,CAAC"}
|
@@ -82,7 +82,7 @@ const startClient = (tree, config) => {
|
|
82
82
|
const channels = data.channels;
|
83
83
|
const geoipCountry = window.__GEOIP_COUNTRY__;
|
84
84
|
const acceptedLanguages = JSON.parse(window.__ACCEPTED_LANGUAGES__);
|
85
|
-
const { selectedChannel, recommendedChannel } = getSelectedAndRecommendedChannel({
|
85
|
+
const { selectedChannel, recommendedChannel, group } = getSelectedAndRecommendedChannel({
|
86
86
|
url: window.location.href,
|
87
87
|
cookies,
|
88
88
|
channels,
|
@@ -93,6 +93,7 @@ const startClient = (tree, config) => {
|
|
93
93
|
channelHandler.setSelectedChannel(selectedChannel);
|
94
94
|
channelHandler.setRecommendedChannel(recommendedChannel);
|
95
95
|
channelHandler.setChannels(channels);
|
96
|
+
channelHandler.setChannelGroup(group);
|
96
97
|
const channelOverrides = config.channelOverrides && selectedChannel.name
|
97
98
|
? config.channelOverrides[selectedChannel.name]
|
98
99
|
: {};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"startClient.js","sourceRoot":"","sources":["startClient.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,KAAK,MAAM,MAAM,qBAAqB,CAAC;AAC9C,OAAO,KAAuB,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,EAAE,gCAAgC,EAAE,MAAM,mCAAmC,CAAC;AACrF,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AAErE,OAAO,eAAe,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAClF,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,aAAa,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,UAAU,MAAM,eAAe,CAAC;AACvC,OAAO,iBAAiB,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA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C,qBAAqB,GAAG,IAAI,CAAC;YAEpC,MAAM,WAAW,GAAG,CAClB,oBAAC,UAAU,IACT,gBAAgB,EAAE,gBAAgB,EAClC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,aAAa,EACrB,WAAW,EAAE,WAAW,EACxB,cAAc,EAAE,cAAc,EAC9B,cAAc,EAAE,cAAc;gBAE9B,oBAAC,cAAc,QAAE,IAAI,CAAkB,CAC5B,CACd,CAAC;YACF,OAAO,WAAW,CAAC;QACrB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;SACD,IAAI,CAAC,CAAC,IAAkB,EAAE,EAAE;QAC3B,OAAO,aAAa,CAAC,GAAG,EAAE;YACxB,MAAM,IAAI,GAAG,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;YAC7C,WAAW,CACT,IAAI,EACJ,IAAI,EACJ,GAAG,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,qBAAqB,GAAG,KAAK,CAAC,CAClD,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACP,CAAC,CAAC;AAEF,MAAM,IAAI,GAAG,CAAC,IAAkB,EAAE,MAAmB,EAAE,EAAE;IACvD,2HAA2H;IAC3H,IAAK,MAAc,CAAC,eAAe,EAAE;QACnC,OAAO,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;KAClC;SAAM;QACL,2KAA2K;QAC1K,MAAc,CAAC,QAAQ,GAAG,GAAG,EAAE,CAAC,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;KAC5D;AACH,CAAC,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
@@ -116,7 +116,7 @@ const createRenderer = (template, tree, options) => {
|
|
116
116
|
? req.headers['accept-language']
|
117
117
|
: '';
|
118
118
|
const channels = yield globalClient.getChannels();
|
119
|
-
const { selectedChannel, recommendedChannel, redirect } = getSelectedAndRecommendedChannel({
|
119
|
+
const { selectedChannel, recommendedChannel, redirect, group } = getSelectedAndRecommendedChannel({
|
120
120
|
url: fullUrl,
|
121
121
|
singleDomainMode,
|
122
122
|
channels,
|
@@ -134,6 +134,7 @@ const createRenderer = (template, tree, options) => {
|
|
134
134
|
recommendedChannel,
|
135
135
|
channels
|
136
136
|
});
|
137
|
+
channelHandler.setChannelGroup(group);
|
137
138
|
const createClientOpts = {
|
138
139
|
apolloConfig,
|
139
140
|
schema,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"createRenderer.js","sourceRoot":"","sources":["createRenderer.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,gCAAgC,EAAE,MAAM,2CAA2C,CAAC;AAC7F,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,WAAW,MAAM,uBAAuB,CAAC;AAIhD,OAAO,KAAuB,MAAM,OAAO,CAAC;AAE5C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAGhD,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAClF,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,UAAU,MAAM,eAAe,CAAC;AACvC,OAAO,iBAAiB,MAAM,2BAA2B,CAAC;AAE1D,OAAO,uBAAuB,MAAM,2CAA2C,CAAC;AAChF,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,mB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WAAW,EAAE,WAAW;YACxB,QAAQ;YACR,YAAY;YACZ,cAAc,EACZ,kBAAkB;gBAClB,uBAAuB;gBACvB,gBAAgB;gBAChB,cAAc;YAChB,KAAK,EAAE,KAAK,CAAC,QAAQ,EAAE;YACvB,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,GAAG,IAAI,CAAC,QAAQ,EAAE;YACvC,KAAK,EAAE,KAAK,CAAC,QAAQ,EAAE,GAAG,gBAAgB,GAAG,aAAa;YAC1D,cAAc,EAAE,cAAc,CAAC,QAAQ,EAAE;SAC1C,CAAC;QAEF,MAAM,IAAI,GAAG,mBAAmB,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QACjD,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC;QAEvD,aAAa,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;QACzC,GAAG,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC,CAAC;QACvC,WAAW,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC;IAC7B,CAAC,CAAA,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
package/package.json
CHANGED
@@ -9,13 +9,28 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
9
9
|
};
|
10
10
|
import fetch from 'node-fetch';
|
11
11
|
import requestIp from 'request-ip';
|
12
|
+
import { createHash } from 'crypto';
|
13
|
+
const cache = new Map();
|
14
|
+
function hashedValue(key) {
|
15
|
+
const inChache = cache.get(key);
|
16
|
+
if (inChache) {
|
17
|
+
return inChache;
|
18
|
+
}
|
19
|
+
else {
|
20
|
+
const hash = createHash('sha256').update(key).digest('hex');
|
21
|
+
cache.set(key, hash);
|
22
|
+
return hash;
|
23
|
+
}
|
24
|
+
}
|
12
25
|
function getUserData(req) {
|
26
|
+
// Only create hash once
|
27
|
+
const country = hashedValue(req.header('x-geoip-country') || '');
|
13
28
|
return {
|
14
29
|
client_ip_address: req.header('true-client-ip') || requestIp.getClientIp(req),
|
15
30
|
client_user_agent: req.headers['user-agent'],
|
16
31
|
fbc: req.universalCookies.get('_fbc') || '',
|
17
32
|
fbp: req.universalCookies.get('_fbp') || '',
|
18
|
-
country
|
33
|
+
country
|
19
34
|
};
|
20
35
|
}
|
21
36
|
function createTrackFacebookEvent({ pixelId, token }) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"facebook.js","sourceRoot":"","sources":["facebook.ts"],"names":[],"mappings":";;;;;;;;;AAGA,OAAO,KAAK,MAAM,YAAY,CAAC;AAC/B,OAAO,SAAS,MAAM,YAAY,CAAC;
|
1
|
+
{"version":3,"file":"facebook.js","sourceRoot":"","sources":["facebook.ts"],"names":[],"mappings":";;;;;;;;;AAGA,OAAO,KAAK,MAAM,YAAY,CAAC;AAC/B,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAuJpC,MAAM,KAAK,GAAG,IAAI,GAAG,EAAkB,CAAC;AACxC,SAAS,WAAW,CAAC,GAAW;IAC9B,MAAM,QAAQ,GAAG,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAChC,IAAI,QAAQ,EAAE;QACZ,OAAO,QAAQ,CAAC;KACjB;SAAM;QACL,MAAM,IAAI,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC5D,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACrB,OAAO,IAAI,CAAC;KACb;AACH,CAAC;AAED,SAAS,WAAW,CAClB,GAAgE;IAEhE,wBAAwB;IACxB,MAAM,OAAO,GAAG,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,iBAAiB,CAAC,IAAI,EAAE,C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ANGED
@@ -237,8 +237,8 @@ export type Category = Document & {
|
|
237
237
|
*/
|
238
238
|
dynamicFiltering?: Maybe<Array<Maybe<CategoryDynamicFilter>>>;
|
239
239
|
/**
|
240
|
-
* Get content data set via the Content Editor.NB: Carries a performance cost,
|
241
|
-
* asking for this will result in a separate API call in the backend.
|
240
|
+
* Get content data set via the Content Editor. NB: Carries a performance cost,
|
241
|
+
* as asking for this will result in a separate API call in the backend.
|
242
242
|
*/
|
243
243
|
data?: Maybe<Content>;
|
244
244
|
/**
|
@@ -340,12 +340,15 @@ export type Consent = {
|
|
340
340
|
|
341
341
|
export type Content = {
|
342
342
|
__typename?: 'Content';
|
343
|
+
name?: Maybe<Scalars['String']>;
|
343
344
|
id: Scalars['ID'];
|
344
345
|
items?: Maybe<Array<Maybe<ContentItem>>>;
|
346
|
+
tags?: Maybe<Array<Maybe<Scalars['String']>>>;
|
345
347
|
};
|
346
348
|
|
347
349
|
export type ContentItem = {
|
348
350
|
__typename?: 'ContentItem';
|
351
|
+
name?: Maybe<Scalars['String']>;
|
349
352
|
type: Scalars['String'];
|
350
353
|
properties?: Maybe<Array<Maybe<ContentItemProperty>>>;
|
351
354
|
children?: Maybe<Array<Maybe<ContentItem>>>;
|
@@ -840,6 +843,12 @@ export type ExternalCustomerResult = {
|
|
840
843
|
customer?: Maybe<ExternalCustomer>;
|
841
844
|
};
|
842
845
|
|
846
|
+
export type ExternalOrderData = {
|
847
|
+
__typename?: 'ExternalOrderData';
|
848
|
+
name: Scalars['String'];
|
849
|
+
value: Scalars['String'];
|
850
|
+
};
|
851
|
+
|
843
852
|
export type FacebookConversionsApi = {
|
844
853
|
__typename?: 'FacebookConversionsApi';
|
845
854
|
accessToken?: Maybe<Scalars['String']>;
|
@@ -870,9 +879,16 @@ export type GoogleAnalytics = {
|
|
870
879
|
useArticleNumberAsId?: Maybe<Scalars['Boolean']>;
|
871
880
|
};
|
872
881
|
|
882
|
+
export type GoogleAnalytics4 = {
|
883
|
+
__typename?: 'GoogleAnalytics4';
|
884
|
+
trackingId?: Maybe<Scalars['String']>;
|
885
|
+
useArticleNumberAsId?: Maybe<Scalars['Boolean']>;
|
886
|
+
};
|
887
|
+
|
873
888
|
export type GoogleTagManager = {
|
874
889
|
__typename?: 'GoogleTagManager';
|
875
890
|
containerId?: Maybe<Scalars['String']>;
|
891
|
+
useGa4Events?: Maybe<Scalars['Boolean']>;
|
876
892
|
};
|
877
893
|
|
878
894
|
export type HtmlHead = {
|
@@ -1527,6 +1543,8 @@ export type OrderItem = {
|
|
1527
1543
|
*/
|
1528
1544
|
variantValue?: Maybe<Scalars['String']>;
|
1529
1545
|
preOrderDate?: Maybe<Scalars['DateTime']>;
|
1546
|
+
/** list of name, value fields from orders coming from external systems. */
|
1547
|
+
externalOrderData?: Maybe<Array<Maybe<ExternalOrderData>>>;
|
1530
1548
|
};
|
1531
1549
|
|
1532
1550
|
export type OrderItemDiscount = {
|
@@ -1609,7 +1627,10 @@ export type Page = Document & {
|
|
1609
1627
|
*/
|
1610
1628
|
primaryRoute?: Maybe<Route>;
|
1611
1629
|
breadcrumbText?: Maybe<Scalars['String']>;
|
1612
|
-
/**
|
1630
|
+
/**
|
1631
|
+
* Get content data set via the Content Editor. NB: Carries a performance cost,
|
1632
|
+
* as asking for this will result in a separate API call in the backend.
|
1633
|
+
*/
|
1613
1634
|
data?: Maybe<Content>;
|
1614
1635
|
/**
|
1615
1636
|
* * If this page was fetched by ID using the `page(id)` query, `parent` will be returned even if it is hidden.
|
@@ -2145,7 +2166,10 @@ export type Query = {
|
|
2145
2166
|
externalCustomerLookup?: Maybe<ExternalCustomerResult>;
|
2146
2167
|
/** Get information on person by Key(personal id number or phone number) */
|
2147
2168
|
personLookup?: Maybe<PersonLookup>;
|
2148
|
-
/**
|
2169
|
+
/**
|
2170
|
+
* Returns content found, either by a list of content Ids, or filtered by tags.
|
2171
|
+
* In the case of filtering by ids, not found content Ids are listed as well.
|
2172
|
+
*/
|
2149
2173
|
content?: Maybe<MultipleContent>;
|
2150
2174
|
/** get channel by id, null gets default channel */
|
2151
2175
|
channel?: Maybe<Channel>;
|
@@ -2236,7 +2260,8 @@ export type QueryPersonLookupArgs = {
|
|
2236
2260
|
|
2237
2261
|
|
2238
2262
|
export type QueryContentArgs = {
|
2239
|
-
ids
|
2263
|
+
ids?: Maybe<Array<Maybe<Scalars['String']>>>;
|
2264
|
+
tags?: Maybe<Array<Maybe<Scalars['String']>>>;
|
2240
2265
|
};
|
2241
2266
|
|
2242
2267
|
|
@@ -2511,7 +2536,10 @@ export type StartPage = Document & {
|
|
2511
2536
|
/** The primary route of this StartPage */
|
2512
2537
|
primaryRoute?: Maybe<Route>;
|
2513
2538
|
breadcrumbText?: Maybe<Scalars['String']>;
|
2514
|
-
/**
|
2539
|
+
/**
|
2540
|
+
* Get content data set via the Content Editor. NB: Carries a performance cost,
|
2541
|
+
* as asking for this will result in a separate API call in the backend.
|
2542
|
+
*/
|
2515
2543
|
data?: Maybe<Content>;
|
2516
2544
|
};
|
2517
2545
|
|
@@ -2574,6 +2602,7 @@ export type Token = {
|
|
2574
2602
|
export type Tracking = {
|
2575
2603
|
__typename?: 'Tracking';
|
2576
2604
|
ga?: Maybe<GoogleAnalytics>;
|
2605
|
+
ga4?: Maybe<GoogleAnalytics4>;
|
2577
2606
|
gtm?: Maybe<GoogleTagManager>;
|
2578
2607
|
fca?: Maybe<FacebookConversionsApi>;
|
2579
2608
|
};
|