@segment/analytics-browser-actions-google-analytics-4 1.0.0 → 1.3.0
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/.eslintcache +1 -0
- package/dist/cjs/addPaymentInfo/generated-types.d.ts +34 -0
- package/dist/cjs/addPaymentInfo/generated-types.js +3 -0
- package/dist/cjs/addPaymentInfo/generated-types.js.map +1 -0
- package/dist/cjs/addPaymentInfo/index.d.ts +5 -0
- package/dist/cjs/addPaymentInfo/index.js +36 -0
- package/dist/cjs/addPaymentInfo/index.js.map +1 -0
- package/dist/cjs/addToCart/generated-types.d.ts +32 -0
- package/dist/cjs/addToCart/generated-types.js +3 -0
- package/dist/cjs/addToCart/generated-types.js.map +1 -0
- package/dist/cjs/addToCart/index.d.ts +5 -0
- package/dist/cjs/addToCart/index.js +32 -0
- package/dist/cjs/addToCart/index.js.map +1 -0
- package/dist/cjs/addToWishlist/generated-types.d.ts +32 -0
- package/dist/cjs/addToWishlist/generated-types.js +3 -0
- package/dist/cjs/addToWishlist/generated-types.js.map +1 -0
- package/dist/cjs/addToWishlist/index.d.ts +5 -0
- package/dist/cjs/addToWishlist/index.js +32 -0
- package/dist/cjs/addToWishlist/index.js.map +1 -0
- package/dist/cjs/beginCheckout/generated-types.d.ts +33 -0
- package/dist/cjs/beginCheckout/generated-types.js +3 -0
- package/dist/cjs/beginCheckout/generated-types.js.map +1 -0
- package/dist/cjs/beginCheckout/index.d.ts +5 -0
- package/dist/cjs/beginCheckout/index.js +34 -0
- package/dist/cjs/beginCheckout/index.js.map +1 -0
- package/dist/cjs/customEvent/generated-types.d.ts +11 -0
- package/dist/cjs/customEvent/generated-types.js +3 -0
- package/dist/cjs/customEvent/generated-types.js.map +1 -0
- package/dist/cjs/customEvent/index.d.ts +5 -0
- package/dist/cjs/customEvent/index.js +45 -0
- package/dist/cjs/customEvent/index.js.map +1 -0
- package/dist/cjs/ga4-functions.d.ts +1 -0
- package/dist/cjs/ga4-functions.js +13 -0
- package/dist/cjs/ga4-functions.js.map +1 -0
- package/dist/cjs/ga4-properties.d.ts +26 -0
- package/dist/cjs/ga4-properties.js +346 -0
- package/dist/cjs/ga4-properties.js.map +1 -0
- package/dist/cjs/ga4-types.d.ts +27 -0
- package/dist/cjs/ga4-types.js +3 -0
- package/dist/cjs/ga4-types.js.map +1 -0
- package/dist/cjs/generateLead/generated-types.d.ts +11 -0
- package/dist/cjs/generateLead/generated-types.js +3 -0
- package/dist/cjs/generateLead/generated-types.js.map +1 -0
- package/dist/cjs/generateLead/index.d.ts +5 -0
- package/dist/cjs/generateLead/index.js +27 -0
- package/dist/cjs/generateLead/index.js.map +1 -0
- package/dist/cjs/generated-types.d.ts +15 -0
- package/dist/cjs/generated-types.js +3 -0
- package/dist/cjs/generated-types.js.map +1 -0
- package/dist/cjs/index.d.ts +11 -0
- package/dist/cjs/index.js +177 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/login/generated-types.d.ts +10 -0
- package/dist/cjs/login/generated-types.js +3 -0
- package/dist/cjs/login/generated-types.js.map +1 -0
- package/dist/cjs/login/index.d.ts +5 -0
- package/dist/cjs/login/index.js +25 -0
- package/dist/cjs/login/index.js.map +1 -0
- package/dist/cjs/purchase/generated-types.d.ts +36 -0
- package/dist/cjs/purchase/generated-types.js +3 -0
- package/dist/cjs/purchase/generated-types.js.map +1 -0
- package/dist/cjs/purchase/index.d.ts +5 -0
- package/dist/cjs/purchase/index.js +40 -0
- package/dist/cjs/purchase/index.js.map +1 -0
- package/dist/cjs/refund/generated-types.d.ts +37 -0
- package/dist/cjs/refund/generated-types.js +3 -0
- package/dist/cjs/refund/generated-types.js.map +1 -0
- package/dist/cjs/refund/index.d.ts +5 -0
- package/dist/cjs/refund/index.js +41 -0
- package/dist/cjs/refund/index.js.map +1 -0
- package/dist/cjs/removeFromCart/generated-types.d.ts +32 -0
- package/dist/cjs/removeFromCart/generated-types.js +3 -0
- package/dist/cjs/removeFromCart/generated-types.js.map +1 -0
- package/dist/cjs/removeFromCart/index.d.ts +5 -0
- package/dist/cjs/removeFromCart/index.js +32 -0
- package/dist/cjs/removeFromCart/index.js.map +1 -0
- package/dist/cjs/search/generated-types.d.ts +10 -0
- package/dist/cjs/search/generated-types.js +3 -0
- package/dist/cjs/search/generated-types.js.map +1 -0
- package/dist/cjs/search/index.d.ts +5 -0
- package/dist/cjs/search/index.js +25 -0
- package/dist/cjs/search/index.js.map +1 -0
- package/dist/cjs/selectItem/generated-types.d.ts +32 -0
- package/dist/cjs/selectItem/generated-types.js +3 -0
- package/dist/cjs/selectItem/generated-types.js.map +1 -0
- package/dist/cjs/selectItem/index.d.ts +5 -0
- package/dist/cjs/selectItem/index.js +32 -0
- package/dist/cjs/selectItem/index.js.map +1 -0
- package/dist/cjs/selectPromotion/generated-types.d.ts +39 -0
- package/dist/cjs/selectPromotion/generated-types.js +3 -0
- package/dist/cjs/selectPromotion/generated-types.js.map +1 -0
- package/dist/cjs/selectPromotion/index.d.ts +5 -0
- package/dist/cjs/selectPromotion/index.js +52 -0
- package/dist/cjs/selectPromotion/index.js.map +1 -0
- package/dist/cjs/setConfigurationFields/generated-types.d.ts +20 -0
- package/dist/cjs/setConfigurationFields/generated-types.js +3 -0
- package/dist/cjs/setConfigurationFields/generated-types.js.map +1 -0
- package/dist/cjs/setConfigurationFields/index.d.ts +5 -0
- package/dist/cjs/setConfigurationFields/index.js +132 -0
- package/dist/cjs/setConfigurationFields/index.js.map +1 -0
- package/dist/cjs/signUp/generated-types.d.ts +10 -0
- package/dist/cjs/signUp/generated-types.js +3 -0
- package/dist/cjs/signUp/generated-types.js.map +1 -0
- package/dist/cjs/signUp/index.d.ts +5 -0
- package/dist/cjs/signUp/index.js +25 -0
- package/dist/cjs/signUp/index.js.map +1 -0
- package/dist/cjs/types.d.ts +3 -0
- package/dist/cjs/types.js +3 -0
- package/dist/cjs/types.js.map +1 -0
- package/dist/cjs/viewCart/generated-types.d.ts +32 -0
- package/dist/cjs/viewCart/generated-types.js +3 -0
- package/dist/cjs/viewCart/generated-types.js.map +1 -0
- package/dist/cjs/viewCart/index.d.ts +5 -0
- package/dist/cjs/viewCart/index.js +32 -0
- package/dist/cjs/viewCart/index.js.map +1 -0
- package/dist/cjs/viewItem/generated-types.d.ts +32 -0
- package/dist/cjs/viewItem/generated-types.js +3 -0
- package/dist/cjs/viewItem/generated-types.js.map +1 -0
- package/dist/cjs/viewItem/index.d.ts +5 -0
- package/dist/cjs/viewItem/index.js +32 -0
- package/dist/cjs/viewItem/index.js.map +1 -0
- package/dist/cjs/viewItemList/generated-types.d.ts +32 -0
- package/dist/cjs/viewItemList/generated-types.js +3 -0
- package/dist/cjs/viewItemList/generated-types.js.map +1 -0
- package/dist/cjs/viewItemList/index.d.ts +5 -0
- package/dist/cjs/viewItemList/index.js +32 -0
- package/dist/cjs/viewItemList/index.js.map +1 -0
- package/dist/cjs/viewPromotion/generated-types.d.ts +39 -0
- package/dist/cjs/viewPromotion/generated-types.js +3 -0
- package/dist/cjs/viewPromotion/generated-types.js.map +1 -0
- package/dist/cjs/viewPromotion/index.d.ts +5 -0
- package/dist/cjs/viewPromotion/index.js +53 -0
- package/dist/cjs/viewPromotion/index.js.map +1 -0
- package/dist/esm/addPaymentInfo/generated-types.d.ts +34 -0
- package/dist/esm/addPaymentInfo/generated-types.js +2 -0
- package/dist/esm/addPaymentInfo/generated-types.js.map +1 -0
- package/dist/esm/addPaymentInfo/index.d.ts +5 -0
- package/dist/esm/addPaymentInfo/index.js +34 -0
- package/dist/esm/addPaymentInfo/index.js.map +1 -0
- package/dist/esm/addToCart/generated-types.d.ts +32 -0
- package/dist/esm/addToCart/generated-types.js +2 -0
- package/dist/esm/addToCart/generated-types.js.map +1 -0
- package/dist/esm/addToCart/index.d.ts +5 -0
- package/dist/esm/addToCart/index.js +30 -0
- package/dist/esm/addToCart/index.js.map +1 -0
- package/dist/esm/addToWishlist/generated-types.d.ts +32 -0
- package/dist/esm/addToWishlist/generated-types.js +2 -0
- package/dist/esm/addToWishlist/generated-types.js.map +1 -0
- package/dist/esm/addToWishlist/index.d.ts +5 -0
- package/dist/esm/addToWishlist/index.js +30 -0
- package/dist/esm/addToWishlist/index.js.map +1 -0
- package/dist/esm/beginCheckout/generated-types.d.ts +33 -0
- package/dist/esm/beginCheckout/generated-types.js +2 -0
- package/dist/esm/beginCheckout/generated-types.js.map +1 -0
- package/dist/esm/beginCheckout/index.d.ts +5 -0
- package/dist/esm/beginCheckout/index.js +32 -0
- package/dist/esm/beginCheckout/index.js.map +1 -0
- package/dist/esm/customEvent/generated-types.d.ts +11 -0
- package/dist/esm/customEvent/generated-types.js +2 -0
- package/dist/esm/customEvent/generated-types.js.map +1 -0
- package/dist/esm/customEvent/index.d.ts +5 -0
- package/dist/esm/customEvent/index.js +43 -0
- package/dist/esm/customEvent/index.js.map +1 -0
- package/dist/esm/ga4-functions.d.ts +1 -0
- package/dist/esm/ga4-functions.js +9 -0
- package/dist/esm/ga4-functions.js.map +1 -0
- package/dist/esm/ga4-properties.d.ts +26 -0
- package/dist/esm/ga4-properties.js +342 -0
- package/dist/esm/ga4-properties.js.map +1 -0
- package/dist/esm/ga4-types.d.ts +27 -0
- package/dist/esm/ga4-types.js +2 -0
- package/dist/esm/ga4-types.js.map +1 -0
- package/dist/esm/generateLead/generated-types.d.ts +11 -0
- package/dist/esm/generateLead/generated-types.js +2 -0
- package/dist/esm/generateLead/generated-types.js.map +1 -0
- package/dist/esm/generateLead/index.d.ts +5 -0
- package/dist/esm/generateLead/index.js +25 -0
- package/dist/esm/generateLead/index.js.map +1 -0
- package/dist/esm/generated-types.d.ts +15 -0
- package/dist/esm/generated-types.js +2 -0
- package/dist/esm/generated-types.js.map +1 -0
- package/dist/esm/index.d.ts +11 -0
- package/dist/esm/index.js +173 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/login/generated-types.d.ts +10 -0
- package/dist/esm/login/generated-types.js +2 -0
- package/dist/esm/login/generated-types.js.map +1 -0
- package/dist/esm/login/index.d.ts +5 -0
- package/dist/esm/login/index.js +23 -0
- package/dist/esm/login/index.js.map +1 -0
- package/dist/esm/purchase/generated-types.d.ts +36 -0
- package/dist/esm/purchase/generated-types.js +2 -0
- package/dist/esm/purchase/generated-types.js.map +1 -0
- package/dist/esm/purchase/index.d.ts +5 -0
- package/dist/esm/purchase/index.js +38 -0
- package/dist/esm/purchase/index.js.map +1 -0
- package/dist/esm/refund/generated-types.d.ts +37 -0
- package/dist/esm/refund/generated-types.js +2 -0
- package/dist/esm/refund/generated-types.js.map +1 -0
- package/dist/esm/refund/index.d.ts +5 -0
- package/dist/esm/refund/index.js +39 -0
- package/dist/esm/refund/index.js.map +1 -0
- package/dist/esm/removeFromCart/generated-types.d.ts +32 -0
- package/dist/esm/removeFromCart/generated-types.js +2 -0
- package/dist/esm/removeFromCart/generated-types.js.map +1 -0
- package/dist/esm/removeFromCart/index.d.ts +5 -0
- package/dist/esm/removeFromCart/index.js +30 -0
- package/dist/esm/removeFromCart/index.js.map +1 -0
- package/dist/esm/search/generated-types.d.ts +10 -0
- package/dist/esm/search/generated-types.js +2 -0
- package/dist/esm/search/generated-types.js.map +1 -0
- package/dist/esm/search/index.d.ts +5 -0
- package/dist/esm/search/index.js +23 -0
- package/dist/esm/search/index.js.map +1 -0
- package/dist/esm/selectItem/generated-types.d.ts +32 -0
- package/dist/esm/selectItem/generated-types.js +2 -0
- package/dist/esm/selectItem/generated-types.js.map +1 -0
- package/dist/esm/selectItem/index.d.ts +5 -0
- package/dist/esm/selectItem/index.js +30 -0
- package/dist/esm/selectItem/index.js.map +1 -0
- package/dist/esm/selectPromotion/generated-types.d.ts +39 -0
- package/dist/esm/selectPromotion/generated-types.js +2 -0
- package/dist/esm/selectPromotion/generated-types.js.map +1 -0
- package/dist/esm/selectPromotion/index.d.ts +5 -0
- package/dist/esm/selectPromotion/index.js +50 -0
- package/dist/esm/selectPromotion/index.js.map +1 -0
- package/dist/esm/setConfigurationFields/generated-types.d.ts +20 -0
- package/dist/esm/setConfigurationFields/generated-types.js +2 -0
- package/dist/esm/setConfigurationFields/generated-types.js.map +1 -0
- package/dist/esm/setConfigurationFields/index.d.ts +5 -0
- package/dist/esm/setConfigurationFields/index.js +130 -0
- package/dist/esm/setConfigurationFields/index.js.map +1 -0
- package/dist/esm/signUp/generated-types.d.ts +10 -0
- package/dist/esm/signUp/generated-types.js +2 -0
- package/dist/esm/signUp/generated-types.js.map +1 -0
- package/dist/esm/signUp/index.d.ts +5 -0
- package/dist/esm/signUp/index.js +23 -0
- package/dist/esm/signUp/index.js.map +1 -0
- package/dist/esm/types.d.ts +3 -0
- package/dist/esm/types.js +2 -0
- package/dist/esm/types.js.map +1 -0
- package/dist/esm/viewCart/generated-types.d.ts +32 -0
- package/dist/esm/viewCart/generated-types.js +2 -0
- package/dist/esm/viewCart/generated-types.js.map +1 -0
- package/dist/esm/viewCart/index.d.ts +5 -0
- package/dist/esm/viewCart/index.js +30 -0
- package/dist/esm/viewCart/index.js.map +1 -0
- package/dist/esm/viewItem/generated-types.d.ts +32 -0
- package/dist/esm/viewItem/generated-types.js +2 -0
- package/dist/esm/viewItem/generated-types.js.map +1 -0
- package/dist/esm/viewItem/index.d.ts +5 -0
- package/dist/esm/viewItem/index.js +30 -0
- package/dist/esm/viewItem/index.js.map +1 -0
- package/dist/esm/viewItemList/generated-types.d.ts +32 -0
- package/dist/esm/viewItemList/generated-types.js +2 -0
- package/dist/esm/viewItemList/generated-types.js.map +1 -0
- package/dist/esm/viewItemList/index.d.ts +5 -0
- package/dist/esm/viewItemList/index.js +30 -0
- package/dist/esm/viewItemList/index.js.map +1 -0
- package/dist/esm/viewPromotion/generated-types.d.ts +39 -0
- package/dist/esm/viewPromotion/generated-types.js +2 -0
- package/dist/esm/viewPromotion/generated-types.js.map +1 -0
- package/dist/esm/viewPromotion/index.d.ts +5 -0
- package/dist/esm/viewPromotion/index.js +51 -0
- package/dist/esm/viewPromotion/index.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +5 -4
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.items_multi_products = exports.items_single_products = exports.minimal_items = exports.location_id = exports.item_list_id = exports.item_list_name = exports.search_term = exports.method = exports.payment_type = exports.coupon = exports.value = exports.currency = exports.client_id = exports.affiliation = exports.transaction_id = exports.shipping = exports.tax = exports.creative_name = exports.creative_slot = exports.promotion_name = exports.promotion_id = exports.user_id = exports.params = exports.user_properties = exports.formatUserProperties = void 0;
|
|
4
|
+
const formatUserProperties = (userProperties) => {
|
|
5
|
+
if (!userProperties) {
|
|
6
|
+
return undefined;
|
|
7
|
+
}
|
|
8
|
+
let properties = {};
|
|
9
|
+
Object.entries(userProperties).forEach(([key, value]) => {
|
|
10
|
+
properties = { ...properties, ...{ [key]: { value: value } } };
|
|
11
|
+
});
|
|
12
|
+
return { user_properties: properties };
|
|
13
|
+
};
|
|
14
|
+
exports.formatUserProperties = formatUserProperties;
|
|
15
|
+
exports.user_properties = {
|
|
16
|
+
label: 'User Properties',
|
|
17
|
+
description: 'The user properties to send to Google Analytics 4. You must create user-scoped dimensions to ensure custom properties are picked up by Google. See Google’s [Custom user properties](https://support.google.com/analytics/answer/9269570) to learn how to set and register user properties. ',
|
|
18
|
+
type: 'object',
|
|
19
|
+
additionalProperties: true,
|
|
20
|
+
defaultObjectUI: 'keyvalue'
|
|
21
|
+
};
|
|
22
|
+
exports.params = {
|
|
23
|
+
label: 'Event Parameters',
|
|
24
|
+
description: 'The event parameters to send to Google Analytics 4.',
|
|
25
|
+
type: 'object',
|
|
26
|
+
additionalProperties: true,
|
|
27
|
+
defaultObjectUI: 'keyvalue'
|
|
28
|
+
};
|
|
29
|
+
exports.user_id = {
|
|
30
|
+
label: 'User ID',
|
|
31
|
+
type: 'string',
|
|
32
|
+
description: "A unique identifier for a user. See Google's [User-ID for cross-platform analysis](https://support.google.com/analytics/answer/9213390) and [Reporting: deduplicate user counts](https://support.google.com/analytics/answer/9355949?hl=en) documentation for more information on this identifier."
|
|
33
|
+
};
|
|
34
|
+
exports.promotion_id = {
|
|
35
|
+
label: 'Promotion ID',
|
|
36
|
+
type: 'string',
|
|
37
|
+
description: 'The ID of the promotion associated with the event.'
|
|
38
|
+
};
|
|
39
|
+
exports.promotion_name = {
|
|
40
|
+
label: 'Promotion Name',
|
|
41
|
+
type: 'string',
|
|
42
|
+
description: 'The name of the promotion associated with the event.'
|
|
43
|
+
};
|
|
44
|
+
exports.creative_slot = {
|
|
45
|
+
label: 'Creative Slot',
|
|
46
|
+
type: 'string',
|
|
47
|
+
description: 'The name of the promotional creative slot associated with the event.'
|
|
48
|
+
};
|
|
49
|
+
exports.creative_name = {
|
|
50
|
+
label: 'Creative Name',
|
|
51
|
+
type: 'string',
|
|
52
|
+
description: 'The name of the promotional creative.'
|
|
53
|
+
};
|
|
54
|
+
exports.tax = {
|
|
55
|
+
label: 'Tax',
|
|
56
|
+
type: 'number',
|
|
57
|
+
description: 'Total tax associated with the transaction.',
|
|
58
|
+
default: {
|
|
59
|
+
'@path': '$.properties.tax'
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
exports.shipping = {
|
|
63
|
+
label: 'Shipping',
|
|
64
|
+
type: 'number',
|
|
65
|
+
description: 'Shipping cost associated with the transaction.',
|
|
66
|
+
default: {
|
|
67
|
+
'@path': '$.properties.shipping'
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
exports.transaction_id = {
|
|
71
|
+
label: 'Order Id',
|
|
72
|
+
type: 'string',
|
|
73
|
+
description: 'The unique identifier of a transaction.',
|
|
74
|
+
default: {
|
|
75
|
+
'@path': '$.properties.order_id'
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
exports.affiliation = {
|
|
79
|
+
label: 'Affiliation',
|
|
80
|
+
type: 'string',
|
|
81
|
+
description: 'Store or affiliation from which this transaction occurred (e.g. Google Store).',
|
|
82
|
+
default: {
|
|
83
|
+
'@path': '$.properties.affiliation'
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
exports.client_id = {
|
|
87
|
+
label: 'Client ID',
|
|
88
|
+
description: 'Uniquely identifies a user instance of a web client.',
|
|
89
|
+
type: 'string',
|
|
90
|
+
required: true,
|
|
91
|
+
default: {
|
|
92
|
+
'@if': {
|
|
93
|
+
exists: { '@path': '$.userId' },
|
|
94
|
+
then: { '@path': '$.userId' },
|
|
95
|
+
else: { '@path': '$.anonymousId' }
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
exports.currency = {
|
|
100
|
+
label: 'Currency',
|
|
101
|
+
type: 'string',
|
|
102
|
+
description: 'Currency of the items associated with the event, in 3-letter ISO 4217 format.',
|
|
103
|
+
default: { '@path': '$.properties.currency' }
|
|
104
|
+
};
|
|
105
|
+
exports.value = {
|
|
106
|
+
label: 'Value',
|
|
107
|
+
type: 'number',
|
|
108
|
+
description: 'The monetary value of the event.',
|
|
109
|
+
default: {
|
|
110
|
+
'@path': '$.properties.value'
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
exports.coupon = {
|
|
114
|
+
label: 'Coupon',
|
|
115
|
+
type: 'string',
|
|
116
|
+
description: 'Coupon code used for a purchase.'
|
|
117
|
+
};
|
|
118
|
+
exports.payment_type = {
|
|
119
|
+
label: 'Payment Type',
|
|
120
|
+
type: 'string',
|
|
121
|
+
description: 'The chosen method of payment.',
|
|
122
|
+
default: {
|
|
123
|
+
'@path': '$.properties.payment_method'
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
exports.method = {
|
|
127
|
+
label: 'Method',
|
|
128
|
+
type: 'string',
|
|
129
|
+
description: 'The method used to login.',
|
|
130
|
+
default: {
|
|
131
|
+
'@path': '$.properties.method'
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
exports.search_term = {
|
|
135
|
+
label: 'Search Term',
|
|
136
|
+
type: 'string',
|
|
137
|
+
description: 'The term that was searched for.',
|
|
138
|
+
default: {
|
|
139
|
+
'@path': `$.properties.query`
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
exports.item_list_name = {
|
|
143
|
+
label: 'Item List Name',
|
|
144
|
+
description: 'The name of the list in which the item was presented to the user.',
|
|
145
|
+
type: 'string',
|
|
146
|
+
default: {
|
|
147
|
+
'@path': `$.properties.item_list_name`
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
exports.item_list_id = {
|
|
151
|
+
label: 'Item List Id',
|
|
152
|
+
description: 'The ID of the list in which the item was presented to the user.',
|
|
153
|
+
type: 'string',
|
|
154
|
+
default: {
|
|
155
|
+
'@path': `$.properties.item_list_id`
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
exports.location_id = {
|
|
159
|
+
label: 'Location ID',
|
|
160
|
+
type: 'string',
|
|
161
|
+
description: 'The ID of the location.',
|
|
162
|
+
default: {
|
|
163
|
+
'@path': '$.properties.position'
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
exports.minimal_items = {
|
|
167
|
+
label: 'Products',
|
|
168
|
+
description: 'The list of products purchased.',
|
|
169
|
+
type: 'object',
|
|
170
|
+
multiple: true,
|
|
171
|
+
properties: {
|
|
172
|
+
item_id: {
|
|
173
|
+
label: 'Product ID',
|
|
174
|
+
type: 'string',
|
|
175
|
+
description: 'Identifier for the product being purchased.'
|
|
176
|
+
},
|
|
177
|
+
item_name: {
|
|
178
|
+
label: 'Name',
|
|
179
|
+
type: 'string',
|
|
180
|
+
description: 'Name of the product being purchased.'
|
|
181
|
+
},
|
|
182
|
+
affiliation: {
|
|
183
|
+
label: 'Affiliation',
|
|
184
|
+
type: 'string',
|
|
185
|
+
description: 'A product affiliation to designate a supplying company or brick and mortar store location.'
|
|
186
|
+
},
|
|
187
|
+
coupon: {
|
|
188
|
+
label: 'Coupon',
|
|
189
|
+
type: 'string',
|
|
190
|
+
description: 'Coupon code used for a purchase.'
|
|
191
|
+
},
|
|
192
|
+
currency: {
|
|
193
|
+
label: 'Currency',
|
|
194
|
+
type: 'string',
|
|
195
|
+
description: 'Currency of the purchase or items associated with the event, in 3-letter ISO 4217 format.'
|
|
196
|
+
},
|
|
197
|
+
discount: {
|
|
198
|
+
label: 'Discount',
|
|
199
|
+
type: 'number',
|
|
200
|
+
description: 'Monetary value of discount associated with a purchase.'
|
|
201
|
+
},
|
|
202
|
+
index: {
|
|
203
|
+
label: 'Index',
|
|
204
|
+
type: 'number',
|
|
205
|
+
description: 'The index/position of the item in a list.'
|
|
206
|
+
},
|
|
207
|
+
item_brand: {
|
|
208
|
+
label: 'Brand',
|
|
209
|
+
type: 'string',
|
|
210
|
+
description: 'Brand associated with the product.'
|
|
211
|
+
},
|
|
212
|
+
item_category: {
|
|
213
|
+
label: 'Category',
|
|
214
|
+
type: 'string',
|
|
215
|
+
description: 'Product category.'
|
|
216
|
+
},
|
|
217
|
+
item_category2: {
|
|
218
|
+
label: 'Category 2',
|
|
219
|
+
type: 'string',
|
|
220
|
+
description: 'Product category 2.'
|
|
221
|
+
},
|
|
222
|
+
item_category3: {
|
|
223
|
+
label: 'Category 3',
|
|
224
|
+
type: 'string',
|
|
225
|
+
description: 'Product category 3.'
|
|
226
|
+
},
|
|
227
|
+
item_category4: {
|
|
228
|
+
label: 'Category 4',
|
|
229
|
+
type: 'string',
|
|
230
|
+
description: 'Product category 4.'
|
|
231
|
+
},
|
|
232
|
+
item_category5: {
|
|
233
|
+
label: 'Category 5',
|
|
234
|
+
type: 'string',
|
|
235
|
+
description: 'Product category 5.'
|
|
236
|
+
},
|
|
237
|
+
item_list_id: {
|
|
238
|
+
label: 'Item List ID',
|
|
239
|
+
type: 'string',
|
|
240
|
+
description: 'The ID of the list in which the item was presented to the user.'
|
|
241
|
+
},
|
|
242
|
+
item_list_name: {
|
|
243
|
+
label: 'Item List Name',
|
|
244
|
+
type: 'string',
|
|
245
|
+
description: 'The name of the list in which the item was presented to the user.'
|
|
246
|
+
},
|
|
247
|
+
item_variant: {
|
|
248
|
+
label: 'Variant',
|
|
249
|
+
type: 'string',
|
|
250
|
+
description: 'Variant of the product (e.g. Black).'
|
|
251
|
+
},
|
|
252
|
+
location_id: {
|
|
253
|
+
label: 'Location ID',
|
|
254
|
+
type: 'string',
|
|
255
|
+
description: 'The location associated with the item.'
|
|
256
|
+
},
|
|
257
|
+
price: {
|
|
258
|
+
label: 'Price',
|
|
259
|
+
type: 'number',
|
|
260
|
+
description: 'Price of the product being purchased, in units of the specified currency parameter.'
|
|
261
|
+
},
|
|
262
|
+
quantity: {
|
|
263
|
+
label: 'Quantity',
|
|
264
|
+
type: 'integer',
|
|
265
|
+
description: 'Item quantity.'
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
};
|
|
269
|
+
exports.items_single_products = {
|
|
270
|
+
...exports.minimal_items,
|
|
271
|
+
default: {
|
|
272
|
+
'@arrayPath': [
|
|
273
|
+
'$.properties.products',
|
|
274
|
+
{
|
|
275
|
+
item_id: {
|
|
276
|
+
'@path': '$.product_id'
|
|
277
|
+
},
|
|
278
|
+
item_name: {
|
|
279
|
+
'@path': '$.name'
|
|
280
|
+
},
|
|
281
|
+
affiliation: {
|
|
282
|
+
'@path': '$.affiliation'
|
|
283
|
+
},
|
|
284
|
+
coupon: {
|
|
285
|
+
'@path': '$.coupon'
|
|
286
|
+
},
|
|
287
|
+
item_brand: {
|
|
288
|
+
'@path': '$.brand'
|
|
289
|
+
},
|
|
290
|
+
item_category: {
|
|
291
|
+
'@path': '$.category'
|
|
292
|
+
},
|
|
293
|
+
item_variant: {
|
|
294
|
+
'@path': '$.variant'
|
|
295
|
+
},
|
|
296
|
+
price: {
|
|
297
|
+
'@path': '$.price'
|
|
298
|
+
},
|
|
299
|
+
quantity: {
|
|
300
|
+
'@path': '$.quantity'
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
]
|
|
304
|
+
}
|
|
305
|
+
};
|
|
306
|
+
exports.items_multi_products = {
|
|
307
|
+
...exports.minimal_items,
|
|
308
|
+
default: {
|
|
309
|
+
'@arrayPath': [
|
|
310
|
+
'$.properties.products',
|
|
311
|
+
{
|
|
312
|
+
item_id: {
|
|
313
|
+
'@path': '$.product_id'
|
|
314
|
+
},
|
|
315
|
+
item_name: {
|
|
316
|
+
'@path': '$.name'
|
|
317
|
+
},
|
|
318
|
+
affiliation: {
|
|
319
|
+
'@path': '$.affiliation'
|
|
320
|
+
},
|
|
321
|
+
coupon: {
|
|
322
|
+
'@path': '$.coupon'
|
|
323
|
+
},
|
|
324
|
+
index: {
|
|
325
|
+
'@path': '$.position'
|
|
326
|
+
},
|
|
327
|
+
item_brand: {
|
|
328
|
+
'@path': '$.brand'
|
|
329
|
+
},
|
|
330
|
+
item_category: {
|
|
331
|
+
'@path': '$.category'
|
|
332
|
+
},
|
|
333
|
+
item_variant: {
|
|
334
|
+
'@path': '$.variant'
|
|
335
|
+
},
|
|
336
|
+
price: {
|
|
337
|
+
'@path': '$.price'
|
|
338
|
+
},
|
|
339
|
+
quantity: {
|
|
340
|
+
'@path': '$.quantity'
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
]
|
|
344
|
+
}
|
|
345
|
+
};
|
|
346
|
+
//# sourceMappingURL=ga4-properties.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ga4-properties.js","sourceRoot":"","sources":["../../src/ga4-properties.ts"],"names":[],"mappings":";;;AAEO,MAAM,oBAAoB,GAAG,CAAC,cAAkC,EAAsB,EAAE;IAC7F,IAAI,CAAC,cAAc,EAAE;QACnB,OAAO,SAAS,CAAA;KACjB;IAED,IAAI,UAAU,GAAG,EAAE,CAAA;IAEnB,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;QACtD,UAAU,GAAG,EAAE,GAAG,UAAU,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAA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;oBACX,OAAO,EAAE,eAAe;iBACzB;gBACD,MAAM,EAAE;oBACN,OAAO,EAAE,UAAU;iBACpB;gBACD,KAAK,EAAE;oBACL,OAAO,EAAE,YAAY;iBACtB;gBACD,UAAU,EAAE;oBACV,OAAO,EAAE,SAAS;iBACnB;gBACD,aAAa,EAAE;oBACb,OAAO,EAAE,YAAY;iBACtB;gBACD,YAAY,EAAE;oBACZ,OAAO,EAAE,WAAW;iBACrB;gBACD,KAAK,EAAE;oBACL,OAAO,EAAE,SAAS;iBACnB;gBACD,QAAQ,EAAE;oBACR,OAAO,EAAE,YAAY;iBACtB;aACF;SACF;KACF;CACF,CAAA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export interface ProductItem {
|
|
2
|
+
item_id?: string;
|
|
3
|
+
item_name?: string;
|
|
4
|
+
affiliation?: string;
|
|
5
|
+
coupon?: string;
|
|
6
|
+
currency?: string;
|
|
7
|
+
discount?: number;
|
|
8
|
+
index?: number;
|
|
9
|
+
item_brand?: string;
|
|
10
|
+
item_category?: string;
|
|
11
|
+
item_category2?: string;
|
|
12
|
+
item_category3?: string;
|
|
13
|
+
item_category4?: string;
|
|
14
|
+
item_category5?: string;
|
|
15
|
+
item_list_id?: string;
|
|
16
|
+
item_list_name?: string;
|
|
17
|
+
item_variant?: string;
|
|
18
|
+
location_id?: string;
|
|
19
|
+
price?: number;
|
|
20
|
+
quantity?: number;
|
|
21
|
+
}
|
|
22
|
+
export interface PromotionProductItem extends ProductItem {
|
|
23
|
+
creative_name?: string;
|
|
24
|
+
creative_slot?: string;
|
|
25
|
+
promotion_id?: string;
|
|
26
|
+
promotion_name?: string;
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ga4-types.js","sourceRoot":"","sources":["../../src/ga4-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../src/generateLead/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { BrowserActionDefinition } from '@segment/browser-destination-runtime/types';
|
|
2
|
+
import type { Settings } from '../generated-types';
|
|
3
|
+
import type { Payload } from './generated-types';
|
|
4
|
+
declare const action: BrowserActionDefinition<Settings, Function, Payload>;
|
|
5
|
+
export default action;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const ga4_properties_1 = require("../ga4-properties");
|
|
4
|
+
const ga4_functions_1 = require("../ga4-functions");
|
|
5
|
+
const action = {
|
|
6
|
+
title: 'Generate Lead',
|
|
7
|
+
description: 'Log this event when a lead has been generated to understand the efficacy of your re-engagement campaigns.',
|
|
8
|
+
platform: 'web',
|
|
9
|
+
defaultSubscription: 'type = "track"',
|
|
10
|
+
fields: {
|
|
11
|
+
user_id: ga4_properties_1.user_id,
|
|
12
|
+
currency: ga4_properties_1.currency,
|
|
13
|
+
value: ga4_properties_1.value,
|
|
14
|
+
user_properties: ga4_properties_1.user_properties,
|
|
15
|
+
params: ga4_properties_1.params
|
|
16
|
+
},
|
|
17
|
+
perform: (gtag, { payload }) => {
|
|
18
|
+
ga4_functions_1.updateUser(payload.user_id, payload.user_properties, gtag);
|
|
19
|
+
gtag('event', 'generate_lead', {
|
|
20
|
+
currency: payload.currency,
|
|
21
|
+
value: payload.value,
|
|
22
|
+
...payload.params
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
exports.default = action;
|
|
27
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/generateLead/index.ts"],"names":[],"mappings":";;AAIA,sDAAqF;AACrF,oDAA6C;AAE7C,MAAM,MAAM,GAAyD;IACnE,KAAK,EAAE,eAAe;IACtB,WAAW,EACT,2GAA2G;IAC7G,QAAQ,EAAE,KAAK;IACf,mBAAmB,EAAE,gBAAgB;IACrC,MAAM,EAAE;QACN,OAAO,EAAE,wBAAO;QAChB,QAAQ,EAAE,yBAAQ;QAClB,KAAK,EAAE,sBAAK;QACZ,eAAe,EAAE,gCAAe;QAChC,MAAM,EAAE,uBAAM;KACf;IACD,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QAC7B,0BAAU,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,eAAe,EAAE,IAAI,CAAC,CAAA;QAE1D,IAAI,CAAC,OAAO,EAAE,eAAe,EAAE;YAC7B,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,GAAG,OAAO,CAAC,MAAM;SAClB,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface Settings {
|
|
2
|
+
measurementID: string;
|
|
3
|
+
allowGoogleSignals?: boolean;
|
|
4
|
+
allowAdPersonalizationSignals?: boolean;
|
|
5
|
+
cookieDomain?: string;
|
|
6
|
+
cookieExpirationInSeconds?: number;
|
|
7
|
+
cookieFlags?: string[];
|
|
8
|
+
cookiePath?: string[];
|
|
9
|
+
cookiePrefix?: string[];
|
|
10
|
+
cookieUpdate?: boolean;
|
|
11
|
+
enableConsentMode?: boolean;
|
|
12
|
+
defaultAdsStorageConsentState?: string;
|
|
13
|
+
defaultAnalyticsStorageConsentState?: string;
|
|
14
|
+
waitTimeToUpdateConsentStage?: number;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../src/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Settings } from './generated-types';
|
|
2
|
+
import type { BrowserDestinationDefinition } from '@segment/browser-destination-runtime/types';
|
|
3
|
+
declare global {
|
|
4
|
+
interface Window {
|
|
5
|
+
gtag: Function;
|
|
6
|
+
dataLayer: any;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export declare const destination: BrowserDestinationDefinition<Settings, Function>;
|
|
10
|
+
declare const _default: import("@segment/browser-destination-runtime/types").PluginFactory;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.destination = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const shim_1 = require("@segment/browser-destination-runtime/shim");
|
|
6
|
+
const addPaymentInfo_1 = tslib_1.__importDefault(require("./addPaymentInfo"));
|
|
7
|
+
const addToCart_1 = tslib_1.__importDefault(require("./addToCart"));
|
|
8
|
+
const addToWishlist_1 = tslib_1.__importDefault(require("./addToWishlist"));
|
|
9
|
+
const beginCheckout_1 = tslib_1.__importDefault(require("./beginCheckout"));
|
|
10
|
+
const customEvent_1 = tslib_1.__importDefault(require("./customEvent"));
|
|
11
|
+
const login_1 = tslib_1.__importDefault(require("./login"));
|
|
12
|
+
const generateLead_1 = tslib_1.__importDefault(require("./generateLead"));
|
|
13
|
+
const purchase_1 = tslib_1.__importDefault(require("./purchase"));
|
|
14
|
+
const refund_1 = tslib_1.__importDefault(require("./refund"));
|
|
15
|
+
const removeFromCart_1 = tslib_1.__importDefault(require("./removeFromCart"));
|
|
16
|
+
const search_1 = tslib_1.__importDefault(require("./search"));
|
|
17
|
+
const selectItem_1 = tslib_1.__importDefault(require("./selectItem"));
|
|
18
|
+
const selectPromotion_1 = tslib_1.__importDefault(require("./selectPromotion"));
|
|
19
|
+
const signUp_1 = tslib_1.__importDefault(require("./signUp"));
|
|
20
|
+
const viewCart_1 = tslib_1.__importDefault(require("./viewCart"));
|
|
21
|
+
const viewItem_1 = tslib_1.__importDefault(require("./viewItem"));
|
|
22
|
+
const viewItemList_1 = tslib_1.__importDefault(require("./viewItemList"));
|
|
23
|
+
const viewPromotion_1 = tslib_1.__importDefault(require("./viewPromotion"));
|
|
24
|
+
const setConfigurationFields_1 = tslib_1.__importDefault(require("./setConfigurationFields"));
|
|
25
|
+
const actions_core_1 = require("@segment/actions-core");
|
|
26
|
+
const presets = [
|
|
27
|
+
{
|
|
28
|
+
name: `Set Configuration Fields`,
|
|
29
|
+
subscribe: 'type = "page" or type = "identify"',
|
|
30
|
+
partnerAction: 'setConfigurationFields',
|
|
31
|
+
mapping: actions_core_1.defaultValues(setConfigurationFields_1.default.fields)
|
|
32
|
+
}
|
|
33
|
+
];
|
|
34
|
+
exports.destination = {
|
|
35
|
+
name: 'Google Analytics 4 Web',
|
|
36
|
+
slug: 'actions-google-analytics-4-web',
|
|
37
|
+
mode: 'device',
|
|
38
|
+
settings: {
|
|
39
|
+
measurementID: {
|
|
40
|
+
description: 'The measurement ID associated with the web stream. Found in the Google Analytics UI under: Admin > Data Streams > Web > Measurement ID.',
|
|
41
|
+
label: 'Measurement ID',
|
|
42
|
+
type: 'string',
|
|
43
|
+
required: true
|
|
44
|
+
},
|
|
45
|
+
allowGoogleSignals: {
|
|
46
|
+
description: 'Set to false to disable all advertising features. Set to true by default.',
|
|
47
|
+
label: 'Allow Google Signals',
|
|
48
|
+
type: 'boolean',
|
|
49
|
+
default: true
|
|
50
|
+
},
|
|
51
|
+
allowAdPersonalizationSignals: {
|
|
52
|
+
description: 'Set to false to disable all advertising features. Set to true by default.',
|
|
53
|
+
label: 'Allow Ad Personalization Signals',
|
|
54
|
+
type: 'boolean',
|
|
55
|
+
default: true
|
|
56
|
+
},
|
|
57
|
+
cookieDomain: {
|
|
58
|
+
description: 'Specifies the domain used to store the analytics cookie. Set to “auto” by default.',
|
|
59
|
+
label: 'Cookie Domain',
|
|
60
|
+
type: 'string',
|
|
61
|
+
default: 'auto'
|
|
62
|
+
},
|
|
63
|
+
cookieExpirationInSeconds: {
|
|
64
|
+
description: `Every time a hit is sent to GA4, the analytics cookie expiration time is updated to be the current time plus the value of this field. The default value is two years (63072000 seconds). Please input the expiration value in seconds. More information in [Google Documentation](https://developers.google.com/analytics/devguides/collection/ga4/reference/config#)`,
|
|
65
|
+
label: 'Cookie Expiration In Seconds',
|
|
66
|
+
type: 'number',
|
|
67
|
+
default: 63072000
|
|
68
|
+
},
|
|
69
|
+
cookieFlags: {
|
|
70
|
+
description: `Appends additional flags to the analytics cookie. See [write a new cookie](https://developer.mozilla.org/en-US/docs/Web/API/Document/cookie#write_a_new_cookie) for some examples of flags to set.`,
|
|
71
|
+
label: 'Cookie Flag',
|
|
72
|
+
type: 'string',
|
|
73
|
+
multiple: true
|
|
74
|
+
},
|
|
75
|
+
cookiePath: {
|
|
76
|
+
description: `Specifies the subpath used to store the analytics cookie.`,
|
|
77
|
+
label: 'Cookie Path',
|
|
78
|
+
type: 'string',
|
|
79
|
+
multiple: true
|
|
80
|
+
},
|
|
81
|
+
cookiePrefix: {
|
|
82
|
+
description: `Specifies a prefix to prepend to the analytics cookie name.`,
|
|
83
|
+
label: 'Cookie Prefix',
|
|
84
|
+
type: 'string',
|
|
85
|
+
multiple: true
|
|
86
|
+
},
|
|
87
|
+
cookieUpdate: {
|
|
88
|
+
description: `Set to false to not update cookies on each page load. This has the effect of cookie expiration being relative to the first time a user visited. Set to true by default so update cookies on each page load.`,
|
|
89
|
+
label: 'Cookie Update',
|
|
90
|
+
type: 'boolean',
|
|
91
|
+
default: true
|
|
92
|
+
},
|
|
93
|
+
enableConsentMode: {
|
|
94
|
+
description: `Set to true to enable Google’s [Consent Mode](https://support.google.com/analytics/answer/9976101?hl=en). Set to false by default.`,
|
|
95
|
+
label: 'Enable Consent Mode',
|
|
96
|
+
type: 'boolean',
|
|
97
|
+
default: false
|
|
98
|
+
},
|
|
99
|
+
defaultAdsStorageConsentState: {
|
|
100
|
+
description: 'The default value for ad cookies consent state. This is only used if Enable Consent Mode is on. Set to “granted” if it is not explicitly set. Consent state can be updated for each user in the Set Configuration Fields action.',
|
|
101
|
+
label: 'Default Ads Storage Consent State',
|
|
102
|
+
type: 'string',
|
|
103
|
+
choices: [
|
|
104
|
+
{ label: 'Granted', value: 'granted' },
|
|
105
|
+
{ label: 'Denied', value: 'denied' }
|
|
106
|
+
],
|
|
107
|
+
default: 'granted'
|
|
108
|
+
},
|
|
109
|
+
defaultAnalyticsStorageConsentState: {
|
|
110
|
+
description: 'The default value for analytics cookies consent state. This is only used if Enable Consent Mode is on. Set to “granted” if it is not explicitly set. Consent state can be updated for each user in the Set Configuration Fields action.',
|
|
111
|
+
label: 'Default Analytics Storage Consent State',
|
|
112
|
+
type: 'string',
|
|
113
|
+
choices: [
|
|
114
|
+
{ label: 'Granted', value: 'granted' },
|
|
115
|
+
{ label: 'Denied', value: 'denied' }
|
|
116
|
+
],
|
|
117
|
+
default: 'granted'
|
|
118
|
+
},
|
|
119
|
+
waitTimeToUpdateConsentStage: {
|
|
120
|
+
description: 'If your CMP loads asynchronously, it might not always run before the Google tag. To handle such situations, specify a millisecond value to control how long to wait before the consent state update is sent. Please input the wait_for_update in milliseconds.',
|
|
121
|
+
label: 'Wait Time to Update Consent State',
|
|
122
|
+
type: 'number'
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
initialize: async ({ settings }, deps) => {
|
|
126
|
+
const config = {
|
|
127
|
+
send_page_view: false,
|
|
128
|
+
cookie_update: settings.cookieUpdate,
|
|
129
|
+
cookie_domain: settings.cookieDomain,
|
|
130
|
+
cookie_prefix: settings.cookiePrefix,
|
|
131
|
+
cookie_expires: settings.cookieExpirationInSeconds,
|
|
132
|
+
cookie_path: settings.cookiePath,
|
|
133
|
+
allow_ad_personalization_signals: settings.allowAdPersonalizationSignals,
|
|
134
|
+
allow_google_signals: settings.allowGoogleSignals
|
|
135
|
+
};
|
|
136
|
+
window.dataLayer = window.dataLayer || [];
|
|
137
|
+
window.gtag = function () {
|
|
138
|
+
window.dataLayer.push(arguments);
|
|
139
|
+
};
|
|
140
|
+
window.gtag('js', new Date());
|
|
141
|
+
window.gtag('config', settings.measurementID, config);
|
|
142
|
+
if (settings.enableConsentMode) {
|
|
143
|
+
window.gtag('consent', 'default', {
|
|
144
|
+
ad_storage: settings.defaultAdsStorageConsentState,
|
|
145
|
+
analytics_storage: settings.defaultAnalyticsStorageConsentState,
|
|
146
|
+
wait_for_update: settings.waitTimeToUpdateConsentStage
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
const script = `https://www.googletagmanager.com/gtag/js?id=${settings.measurementID}`;
|
|
150
|
+
await deps.loadScript(script);
|
|
151
|
+
return window.gtag;
|
|
152
|
+
},
|
|
153
|
+
presets,
|
|
154
|
+
actions: {
|
|
155
|
+
addPaymentInfo: addPaymentInfo_1.default,
|
|
156
|
+
login: login_1.default,
|
|
157
|
+
signUp: signUp_1.default,
|
|
158
|
+
search: search_1.default,
|
|
159
|
+
addToCart: addToCart_1.default,
|
|
160
|
+
addToWishlist: addToWishlist_1.default,
|
|
161
|
+
removeFromCart: removeFromCart_1.default,
|
|
162
|
+
selectItem: selectItem_1.default,
|
|
163
|
+
selectPromotion: selectPromotion_1.default,
|
|
164
|
+
viewItem: viewItem_1.default,
|
|
165
|
+
viewPromotion: viewPromotion_1.default,
|
|
166
|
+
beginCheckout: beginCheckout_1.default,
|
|
167
|
+
purchase: purchase_1.default,
|
|
168
|
+
refund: refund_1.default,
|
|
169
|
+
viewCart: viewCart_1.default,
|
|
170
|
+
viewItemList: viewItemList_1.default,
|
|
171
|
+
generateLead: generateLead_1.default,
|
|
172
|
+
customEvent: customEvent_1.default,
|
|
173
|
+
setConfigurationFields: setConfigurationFields_1.default
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
exports.default = shim_1.browserDestination(exports.destination);
|
|
177
|
+
//# sourceMappingURL=index.js.map
|