@segment/action-destinations 3.101.1-alpha.0 → 3.102.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/dist/destinations/actions-pardot/prospects/index.js.map +1 -1
- package/dist/destinations/amplitude/logEvent/generated-types.d.ts +0 -21
- package/dist/destinations/amplitude/logEvent/index.js +10 -96
- package/dist/destinations/amplitude/logEvent/index.js.map +1 -1
- package/dist/destinations/cordial/addProductToCart/index.js +1 -1
- package/dist/destinations/cordial/addProductToCart/index.js.map +1 -1
- package/dist/destinations/cordial/index.js +1 -1
- package/dist/destinations/cordial/index.js.map +1 -1
- package/dist/destinations/cordial/removeProductFromCart/index.js.map +1 -1
- package/dist/destinations/cordial/upsertOrder/index.js +8 -8
- package/dist/destinations/cordial/upsertOrder/index.js.map +1 -1
- package/dist/destinations/customerio/trackEvent/index.js.map +1 -1
- package/dist/destinations/engage-messaging-sendgrid/generated-types.d.ts +0 -1
- package/dist/destinations/engage-messaging-sendgrid/index.js +0 -5
- package/dist/destinations/engage-messaging-sendgrid/index.js.map +1 -1
- package/dist/destinations/engage-messaging-sendgrid/sendEmail/generated-types.d.ts +0 -4
- package/dist/destinations/engage-messaging-sendgrid/sendEmail/index.js +1 -38
- package/dist/destinations/engage-messaging-sendgrid/sendEmail/index.js.map +1 -1
- package/dist/destinations/engage-messaging-twilio/sendSms/index.js +0 -1
- package/dist/destinations/engage-messaging-twilio/sendSms/index.js.map +1 -1
- package/dist/destinations/google-enhanced-conversions/generated-types.d.ts +1 -2
- package/dist/destinations/google-enhanced-conversions/index.js +8 -15
- package/dist/destinations/google-enhanced-conversions/index.js.map +1 -1
- package/dist/destinations/google-enhanced-conversions/postConversion/index.js +1 -7
- package/dist/destinations/google-enhanced-conversions/postConversion/index.js.map +1 -1
- package/dist/destinations/google-sheets/postSheet/index.js +1 -1
- package/dist/destinations/index.js +1 -2
- package/dist/destinations/index.js.map +1 -1
- package/dist/destinations/{salesforce-marketing-cloud → linkedin-audiences}/generated-types.d.ts +1 -0
- package/dist/destinations/{google-enhanced-conversions/uploadCallConversion → linkedin-audiences}/generated-types.js +0 -0
- package/dist/destinations/linkedin-audiences/generated-types.js.map +1 -0
- package/dist/destinations/{salesforce-marketing-cloud → linkedin-audiences}/index.d.ts +0 -0
- package/dist/destinations/linkedin-audiences/index.js +59 -0
- package/dist/destinations/linkedin-audiences/index.js.map +1 -0
- package/dist/destinations/linkedin-audiences/linkedin-properties.d.ts +1 -0
- package/dist/destinations/linkedin-audiences/linkedin-properties.js +5 -0
- package/dist/destinations/linkedin-audiences/linkedin-properties.js.map +1 -0
- package/dist/destinations/linkedin-audiences/updateAudience/generated-types.d.ts +11 -0
- package/dist/destinations/{google-enhanced-conversions/uploadClickConversion → linkedin-audiences/updateAudience}/generated-types.js +0 -0
- package/dist/destinations/linkedin-audiences/updateAudience/generated-types.js.map +1 -0
- package/dist/destinations/{salesforce-marketing-cloud/contact → linkedin-audiences/updateAudience}/index.d.ts +0 -0
- package/dist/destinations/linkedin-audiences/updateAudience/index.js +171 -0
- package/dist/destinations/linkedin-audiences/updateAudience/index.js.map +1 -0
- package/dist/destinations/mixpanel/index.js +1 -1
- package/dist/destinations/mixpanel/trackEvent/index.js.map +1 -1
- package/dist/destinations/salesforce/lead/index.js +1 -2
- package/dist/destinations/salesforce/lead/index.js.map +1 -1
- package/dist/lib/engage-test-data/create-messaging-test-event.d.ts +1 -15
- package/dist/lib/engage-test-data/create-messaging-test-event.js +0 -15
- package/dist/lib/engage-test-data/create-messaging-test-event.js.map +1 -1
- package/package.json +4 -4
- package/dist/destinations/google-enhanced-conversions/constants.d.ts +0 -1
- package/dist/destinations/google-enhanced-conversions/constants.js +0 -185
- package/dist/destinations/google-enhanced-conversions/constants.js.map +0 -1
- package/dist/destinations/google-enhanced-conversions/functions.d.ts +0 -3
- package/dist/destinations/google-enhanced-conversions/functions.js +0 -36
- package/dist/destinations/google-enhanced-conversions/functions.js.map +0 -1
- package/dist/destinations/google-enhanced-conversions/uploadCallConversion/generated-types.d.ts +0 -11
- package/dist/destinations/google-enhanced-conversions/uploadCallConversion/generated-types.js.map +0 -1
- package/dist/destinations/google-enhanced-conversions/uploadCallConversion/index.d.ts +0 -5
- package/dist/destinations/google-enhanced-conversions/uploadCallConversion/index.js +0 -99
- package/dist/destinations/google-enhanced-conversions/uploadCallConversion/index.js.map +0 -1
- package/dist/destinations/google-enhanced-conversions/uploadClickConversion/generated-types.d.ts +0 -25
- package/dist/destinations/google-enhanced-conversions/uploadClickConversion/generated-types.js.map +0 -1
- package/dist/destinations/google-enhanced-conversions/uploadClickConversion/index.d.ts +0 -5
- package/dist/destinations/google-enhanced-conversions/uploadClickConversion/index.js +0 -238
- package/dist/destinations/google-enhanced-conversions/uploadClickConversion/index.js.map +0 -1
- package/dist/destinations/google-enhanced-conversions/uploadClickConversion/types.d.ts +0 -5
- package/dist/destinations/google-enhanced-conversions/uploadClickConversion/types.js +0 -3
- package/dist/destinations/google-enhanced-conversions/uploadClickConversion/types.js.map +0 -1
- package/dist/destinations/google-enhanced-conversions/uploadConversionAdjustment/generated-types.d.ts +0 -20
- package/dist/destinations/google-enhanced-conversions/uploadConversionAdjustment/generated-types.js +0 -3
- package/dist/destinations/google-enhanced-conversions/uploadConversionAdjustment/generated-types.js.map +0 -1
- package/dist/destinations/google-enhanced-conversions/uploadConversionAdjustment/index.d.ts +0 -5
- package/dist/destinations/google-enhanced-conversions/uploadConversionAdjustment/index.js +0 -269
- package/dist/destinations/google-enhanced-conversions/uploadConversionAdjustment/index.js.map +0 -1
- package/dist/destinations/salesforce-marketing-cloud/contact/generated-types.d.ts +0 -2
- package/dist/destinations/salesforce-marketing-cloud/contact/generated-types.js +0 -3
- package/dist/destinations/salesforce-marketing-cloud/contact/generated-types.js.map +0 -1
- package/dist/destinations/salesforce-marketing-cloud/contact/index.js +0 -11
- package/dist/destinations/salesforce-marketing-cloud/contact/index.js.map +0 -1
- package/dist/destinations/salesforce-marketing-cloud/generated-types.js +0 -3
- package/dist/destinations/salesforce-marketing-cloud/generated-types.js.map +0 -1
- package/dist/destinations/salesforce-marketing-cloud/index.js +0 -27
- package/dist/destinations/salesforce-marketing-cloud/index.js.map +0 -1
- package/dist/destinations/sendgrid/generated-types.d.ts +0 -3
- package/dist/destinations/sendgrid/generated-types.js +0 -3
- package/dist/destinations/sendgrid/generated-types.js.map +0 -1
- package/dist/destinations/sendgrid/index.d.ts +0 -4
- package/dist/destinations/sendgrid/index.js +0 -31
- package/dist/destinations/sendgrid/index.js.map +0 -1
- package/dist/destinations/sendgrid/sendgrid-properties.d.ts +0 -23
- package/dist/destinations/sendgrid/sendgrid-properties.js +0 -23
- package/dist/destinations/sendgrid/sendgrid-properties.js.map +0 -1
- package/dist/destinations/sendgrid/updateUserProfile/generated-types.d.ts +0 -21
- package/dist/destinations/sendgrid/updateUserProfile/generated-types.js +0 -3
- package/dist/destinations/sendgrid/updateUserProfile/generated-types.js.map +0 -1
- package/dist/destinations/sendgrid/updateUserProfile/index.d.ts +0 -5
- package/dist/destinations/sendgrid/updateUserProfile/index.js +0 -239
- package/dist/destinations/sendgrid/updateUserProfile/index.js.map +0 -1
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CURRENCY_ISO_CODES = void 0;
|
|
4
|
-
exports.CURRENCY_ISO_CODES = [
|
|
5
|
-
'AED',
|
|
6
|
-
'AFN',
|
|
7
|
-
'ALL',
|
|
8
|
-
'AMD',
|
|
9
|
-
'ANG',
|
|
10
|
-
'AOA',
|
|
11
|
-
'ARS',
|
|
12
|
-
'AUD',
|
|
13
|
-
'AWG',
|
|
14
|
-
'AZN',
|
|
15
|
-
'BAM',
|
|
16
|
-
'BBD',
|
|
17
|
-
'BDT',
|
|
18
|
-
'BGN',
|
|
19
|
-
'BHD',
|
|
20
|
-
'BIF',
|
|
21
|
-
'BMD',
|
|
22
|
-
'BND',
|
|
23
|
-
'BOB',
|
|
24
|
-
'BOV',
|
|
25
|
-
'BRL',
|
|
26
|
-
'BSD',
|
|
27
|
-
'BTN',
|
|
28
|
-
'BWP',
|
|
29
|
-
'BYN',
|
|
30
|
-
'BZD',
|
|
31
|
-
'CAD',
|
|
32
|
-
'CDF',
|
|
33
|
-
'CHE',
|
|
34
|
-
'CHF',
|
|
35
|
-
'CHW',
|
|
36
|
-
'CLF',
|
|
37
|
-
'CLP',
|
|
38
|
-
'CNY',
|
|
39
|
-
'COP',
|
|
40
|
-
'COU',
|
|
41
|
-
'CRC',
|
|
42
|
-
'CUC',
|
|
43
|
-
'CUP',
|
|
44
|
-
'CVE',
|
|
45
|
-
'CZK',
|
|
46
|
-
'DJF',
|
|
47
|
-
'DKK',
|
|
48
|
-
'DOP',
|
|
49
|
-
'DZD',
|
|
50
|
-
'EGP',
|
|
51
|
-
'ERN',
|
|
52
|
-
'ETB',
|
|
53
|
-
'EUR',
|
|
54
|
-
'FJD',
|
|
55
|
-
'FKP',
|
|
56
|
-
'GBP',
|
|
57
|
-
'GEL',
|
|
58
|
-
'GHS',
|
|
59
|
-
'GIP',
|
|
60
|
-
'GMD',
|
|
61
|
-
'GNF',
|
|
62
|
-
'GTQ',
|
|
63
|
-
'GYD',
|
|
64
|
-
'HKD',
|
|
65
|
-
'HNL',
|
|
66
|
-
'HRK',
|
|
67
|
-
'HTG',
|
|
68
|
-
'HUF',
|
|
69
|
-
'IDR',
|
|
70
|
-
'ILS',
|
|
71
|
-
'INR',
|
|
72
|
-
'IQD',
|
|
73
|
-
'IRR',
|
|
74
|
-
'ISK',
|
|
75
|
-
'JMD',
|
|
76
|
-
'JOD',
|
|
77
|
-
'JPY',
|
|
78
|
-
'KES',
|
|
79
|
-
'KGS',
|
|
80
|
-
'KHR',
|
|
81
|
-
'KMF',
|
|
82
|
-
'KPW',
|
|
83
|
-
'KRW',
|
|
84
|
-
'KWD',
|
|
85
|
-
'KYD',
|
|
86
|
-
'KZT',
|
|
87
|
-
'LAK',
|
|
88
|
-
'LBP',
|
|
89
|
-
'LKR',
|
|
90
|
-
'LRD',
|
|
91
|
-
'LSL',
|
|
92
|
-
'LYD',
|
|
93
|
-
'MAD',
|
|
94
|
-
'MDL',
|
|
95
|
-
'MGA',
|
|
96
|
-
'MKD',
|
|
97
|
-
'MMK',
|
|
98
|
-
'MNT',
|
|
99
|
-
'MOP',
|
|
100
|
-
'MRU',
|
|
101
|
-
'MUR',
|
|
102
|
-
'MVR',
|
|
103
|
-
'MWK',
|
|
104
|
-
'MXN',
|
|
105
|
-
'MXV',
|
|
106
|
-
'MYR',
|
|
107
|
-
'MZN',
|
|
108
|
-
'NAD',
|
|
109
|
-
'NGN',
|
|
110
|
-
'NIO',
|
|
111
|
-
'NOK',
|
|
112
|
-
'NPR',
|
|
113
|
-
'NZD',
|
|
114
|
-
'OMR',
|
|
115
|
-
'PAB',
|
|
116
|
-
'PEN',
|
|
117
|
-
'PGK',
|
|
118
|
-
'PHP',
|
|
119
|
-
'PKR',
|
|
120
|
-
'PLN',
|
|
121
|
-
'PYG',
|
|
122
|
-
'QAR',
|
|
123
|
-
'RON',
|
|
124
|
-
'RSD',
|
|
125
|
-
'RUB',
|
|
126
|
-
'RWF',
|
|
127
|
-
'SAR',
|
|
128
|
-
'SBD',
|
|
129
|
-
'SCR',
|
|
130
|
-
'SDG',
|
|
131
|
-
'SEK',
|
|
132
|
-
'SGD',
|
|
133
|
-
'SHP',
|
|
134
|
-
'SLL',
|
|
135
|
-
'SOS',
|
|
136
|
-
'SRD',
|
|
137
|
-
'SSP',
|
|
138
|
-
'STN',
|
|
139
|
-
'SVC',
|
|
140
|
-
'SYP',
|
|
141
|
-
'SZL',
|
|
142
|
-
'THB',
|
|
143
|
-
'TJS',
|
|
144
|
-
'TMT',
|
|
145
|
-
'TND',
|
|
146
|
-
'TOP',
|
|
147
|
-
'TRY',
|
|
148
|
-
'TTD',
|
|
149
|
-
'TWD',
|
|
150
|
-
'TZS',
|
|
151
|
-
'UAH',
|
|
152
|
-
'UGX',
|
|
153
|
-
'USD',
|
|
154
|
-
'USN',
|
|
155
|
-
'UYI',
|
|
156
|
-
'UYU',
|
|
157
|
-
'UYW',
|
|
158
|
-
'UZS',
|
|
159
|
-
'VES',
|
|
160
|
-
'VND',
|
|
161
|
-
'VUV',
|
|
162
|
-
'WST',
|
|
163
|
-
'XAF',
|
|
164
|
-
'XAG',
|
|
165
|
-
'XAU',
|
|
166
|
-
'XBA',
|
|
167
|
-
'XBB',
|
|
168
|
-
'XBC',
|
|
169
|
-
'XBD',
|
|
170
|
-
'XCD',
|
|
171
|
-
'XDR',
|
|
172
|
-
'XOF',
|
|
173
|
-
'XPD',
|
|
174
|
-
'XPF',
|
|
175
|
-
'XPT',
|
|
176
|
-
'XSU',
|
|
177
|
-
'XTS',
|
|
178
|
-
'XUA',
|
|
179
|
-
'XXX',
|
|
180
|
-
'YER',
|
|
181
|
-
'ZAR',
|
|
182
|
-
'ZMW',
|
|
183
|
-
'ZWC'
|
|
184
|
-
];
|
|
185
|
-
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/destinations/google-enhanced-conversions/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,kBAAkB,GAAG;IAChC,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;CACN,CAAA"}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export declare function verifyCurrency(currency: string): void;
|
|
2
|
-
export declare const formatCustomVariables: (customVariables: object | undefined, customer_id: string | undefined) => object | undefined;
|
|
3
|
-
export declare const hash: (value: string | undefined) => string | undefined;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.hash = exports.formatCustomVariables = exports.verifyCurrency = void 0;
|
|
4
|
-
const actions_core_1 = require("@segment/actions-core");
|
|
5
|
-
const constants_1 = require("./constants");
|
|
6
|
-
const crypto_1 = require("crypto");
|
|
7
|
-
function verifyCurrency(currency) {
|
|
8
|
-
if (!constants_1.CURRENCY_ISO_CODES.includes(currency.toUpperCase())) {
|
|
9
|
-
throw new actions_core_1.IntegrationError(`${currency} is not a valid currency code.`, 'Incorrect value format', 400);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
exports.verifyCurrency = verifyCurrency;
|
|
13
|
-
const formatCustomVariables = (customVariables, customer_id) => {
|
|
14
|
-
if (!customVariables) {
|
|
15
|
-
return undefined;
|
|
16
|
-
}
|
|
17
|
-
const variables = [];
|
|
18
|
-
Object.entries(customVariables).forEach(([key, value]) => {
|
|
19
|
-
const variable = {
|
|
20
|
-
conversionCustomVariable: `customers/${customer_id}/conversionCustomVariables/${key}`,
|
|
21
|
-
value: value
|
|
22
|
-
};
|
|
23
|
-
variables.push(variable);
|
|
24
|
-
});
|
|
25
|
-
return variables;
|
|
26
|
-
};
|
|
27
|
-
exports.formatCustomVariables = formatCustomVariables;
|
|
28
|
-
const hash = (value) => {
|
|
29
|
-
if (value === undefined)
|
|
30
|
-
return;
|
|
31
|
-
const hash = crypto_1.createHash('sha256');
|
|
32
|
-
hash.update(value);
|
|
33
|
-
return hash.digest('hex');
|
|
34
|
-
};
|
|
35
|
-
exports.hash = hash;
|
|
36
|
-
//# sourceMappingURL=functions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"functions.js","sourceRoot":"","sources":["../../../src/destinations/google-enhanced-conversions/functions.ts"],"names":[],"mappings":";;;AAAA,wDAAwD;AACxD,2CAAgD;AAChD,mCAAmC;AAEnC,SAAgB,cAAc,CAAC,QAAgB;IAC7C,IAAI,CAAC,8BAAkB,CAAC,QAAQ,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,EAAE;QACxD,MAAM,IAAI,+BAAgB,CAAC,GAAG,QAAQ,gCAAgC,EAAE,wBAAwB,EAAE,GAAG,CAAC,CAAA;KACvG;AACH,CAAC;AAJD,wCAIC;AAEM,MAAM,qBAAqB,GAAG,CACnC,eAAmC,EACnC,WAA+B,EACX,EAAE;IACtB,IAAI,CAAC,eAAe,EAAE;QACpB,OAAO,SAAS,CAAA;KACjB;IAED,MAAM,SAAS,GAA0D,EAAE,CAAA;IAE3E,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;QACvD,MAAM,QAAQ,GAAG;YACf,wBAAwB,EAAE,aAAa,WAAW,8BAA8B,GAAG,EAAE;YACrF,KAAK,EAAE,KAAK;SACb,CAAA;QACD,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IAC1B,CAAC,CAAC,CAAA;IAEF,OAAO,SAAS,CAAA;AAClB,CAAC,CAAA;AAnBY,QAAA,qBAAqB,yBAmBjC;AAEM,MAAM,IAAI,GAAG,CAAC,KAAyB,EAAsB,EAAE;IACpE,IAAI,KAAK,KAAK,SAAS;QAAE,OAAM;IAE/B,MAAM,IAAI,GAAG,mBAAU,CAAC,QAAQ,CAAC,CAAA;IACjC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;IAClB,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;AAC3B,CAAC,CAAA;AANY,QAAA,IAAI,QAMhB"}
|
package/dist/destinations/google-enhanced-conversions/uploadCallConversion/generated-types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/google-enhanced-conversions/uploadCallConversion/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const actions_core_1 = require("@segment/actions-core");
|
|
4
|
-
const functions_1 = require("../functions");
|
|
5
|
-
const action = {
|
|
6
|
-
title: 'Upload Call Conversion',
|
|
7
|
-
description: 'Upload an offline call conversion to the Google Ads API.',
|
|
8
|
-
fields: {
|
|
9
|
-
conversion_action: {
|
|
10
|
-
label: 'Conversion Action ID',
|
|
11
|
-
description: 'The ID of the conversion action associated with this conversion. To find the Conversion Action ID, click on your conversion in Google Ads and get the value for ctId in the URL. For example, if the URL is https://ads.google.com/aw/conversions/detail?ocid=00000000&ctId=570000000, your Conversion Action ID is 570000000.',
|
|
12
|
-
type: 'string',
|
|
13
|
-
required: true,
|
|
14
|
-
default: ''
|
|
15
|
-
},
|
|
16
|
-
caller_id: {
|
|
17
|
-
label: 'Caller ID',
|
|
18
|
-
description: 'The caller id from which this call was placed. Caller id is expected to be in E.164 format with preceding + sign. e.g. "+16502531234".',
|
|
19
|
-
type: 'string',
|
|
20
|
-
required: true,
|
|
21
|
-
default: ''
|
|
22
|
-
},
|
|
23
|
-
call_timestamp: {
|
|
24
|
-
label: 'Call Timestamp',
|
|
25
|
-
description: 'The date time at which the call occurred. The timezone must be specified. The format is "yyyy-mm-dd hh:mm:ss+|-hh:mm", e.g. "2019-01-01 12:32:45-08:00".',
|
|
26
|
-
type: 'string'
|
|
27
|
-
},
|
|
28
|
-
conversion_timestamp: {
|
|
29
|
-
label: 'Conversion Timestamp',
|
|
30
|
-
description: 'The date time at which the conversion occurred. Must be after the click time. The timezone must be specified. The format is "yyyy-mm-dd hh:mm:ss+|-hh:mm", e.g. "2019-01-01 12:32:45-08:00".',
|
|
31
|
-
type: 'string',
|
|
32
|
-
required: true,
|
|
33
|
-
default: {
|
|
34
|
-
'@path': '$.timestamp'
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
value: {
|
|
38
|
-
label: 'Value',
|
|
39
|
-
description: 'The value of the conversion for the advertiser.',
|
|
40
|
-
type: 'number',
|
|
41
|
-
default: {
|
|
42
|
-
'@path': '$.properties.total'
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
currency: {
|
|
46
|
-
label: 'Currency',
|
|
47
|
-
description: 'Currency associated with the conversion value. This is the ISO 4217 3-character currency code.',
|
|
48
|
-
type: 'string',
|
|
49
|
-
default: {
|
|
50
|
-
'@path': '$.properties.currency'
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
custom_variables: {
|
|
54
|
-
label: 'Custom Variables',
|
|
55
|
-
description: 'The custom variables associated with this conversion. See Google’s documentation on how to create custom conversion variables.',
|
|
56
|
-
type: 'object',
|
|
57
|
-
additionalProperties: true,
|
|
58
|
-
defaultObjectUI: 'keyvalue'
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
perform: async (request, { settings, payload }) => {
|
|
62
|
-
if (!settings.customerId) {
|
|
63
|
-
throw new actions_core_1.IntegrationError('Customer id is required for this action. Please set it in destination settings.', 'Missing required fields.', 400);
|
|
64
|
-
}
|
|
65
|
-
settings.customerId = settings.customerId.replace(/[^0-9.]+/g, '');
|
|
66
|
-
if (payload.currency) {
|
|
67
|
-
functions_1.verifyCurrency(payload.currency);
|
|
68
|
-
}
|
|
69
|
-
const request_object = {
|
|
70
|
-
conversionAction: `customers/${settings.customerId}/conversionActions/${payload.conversion_action}`,
|
|
71
|
-
callerId: payload.caller_id,
|
|
72
|
-
callStartDateTime: payload.call_timestamp,
|
|
73
|
-
conversionDateTime: payload.conversion_timestamp.replace(/T/, ' ').replace(/\..+/, '+00:00'),
|
|
74
|
-
conversionValue: payload.value,
|
|
75
|
-
currencyCode: payload.currency,
|
|
76
|
-
customVariables: functions_1.formatCustomVariables(payload.custom_variables, settings.customerId)
|
|
77
|
-
};
|
|
78
|
-
const response = await request(`https://googleads.googleapis.com/v11/customers/${settings.customerId}:uploadCallConversions`, {
|
|
79
|
-
method: 'post',
|
|
80
|
-
headers: {
|
|
81
|
-
'developer-token': `${process.env.ADWORDS_DEVELOPER_TOKEN}`
|
|
82
|
-
},
|
|
83
|
-
json: {
|
|
84
|
-
conversions: [request_object],
|
|
85
|
-
partialFailure: true
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
if (typeof response.data === 'object' && response.data != null) {
|
|
89
|
-
Object.entries(response.data).forEach(([key, value]) => {
|
|
90
|
-
if (key === 'partialFailureError' && value.code !== 0) {
|
|
91
|
-
throw new actions_core_1.IntegrationError(value.message, 'INVALID_ARGUMENT', 400);
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
return response;
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
exports.default = action;
|
|
99
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-enhanced-conversions/uploadCallConversion/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAG1E,4CAAoE;AAEpE,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,wBAAwB;IAC/B,WAAW,EAAE,0DAA0D;IACvE,MAAM,EAAE;QAC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AK,CAAC,IAAI,KAAK,CAAC,EAAE;oBACrD,MAAM,IAAI,+BAAgB,CAAC,KAAK,CAAC,OAAO,EAAE,kBAAkB,EAAE,GAAG,CAAC,CAAA;iBACnE;YACH,CAAC,CAAC,CAAA;SACH;QACD,OAAO,QAAQ,CAAA;IACjB,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
package/dist/destinations/google-enhanced-conversions/uploadClickConversion/generated-types.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export interface Payload {
|
|
2
|
-
conversion_action: string;
|
|
3
|
-
gclid?: string;
|
|
4
|
-
gbraid?: string;
|
|
5
|
-
wbraid?: string;
|
|
6
|
-
conversion_timestamp: string;
|
|
7
|
-
email_address?: string;
|
|
8
|
-
phone_number?: string;
|
|
9
|
-
order_id?: string;
|
|
10
|
-
value?: number;
|
|
11
|
-
currency?: string;
|
|
12
|
-
conversion_environment?: string;
|
|
13
|
-
merchant_id?: string;
|
|
14
|
-
merchant_country_code?: string;
|
|
15
|
-
merchant_language_code?: string;
|
|
16
|
-
local_cost?: number & string;
|
|
17
|
-
items?: {
|
|
18
|
-
product_id?: string;
|
|
19
|
-
quantity?: number;
|
|
20
|
-
price?: number;
|
|
21
|
-
}[];
|
|
22
|
-
custom_variables?: {
|
|
23
|
-
[k: string]: unknown;
|
|
24
|
-
};
|
|
25
|
-
}
|
package/dist/destinations/google-enhanced-conversions/uploadClickConversion/generated-types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/google-enhanced-conversions/uploadClickConversion/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -1,238 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const actions_core_1 = require("@segment/actions-core");
|
|
4
|
-
const functions_1 = require("../functions");
|
|
5
|
-
const action = {
|
|
6
|
-
title: 'Upload Click Conversion',
|
|
7
|
-
description: 'Upload an offline click conversion to the Google Ads API.',
|
|
8
|
-
fields: {
|
|
9
|
-
conversion_action: {
|
|
10
|
-
label: 'Conversion Action ID',
|
|
11
|
-
description: 'The ID of the conversion action associated with this conversion. To find the Conversion Action ID, click on your conversion in Google Ads and get the value for ctId in the URL. For example, if the URL is https://ads.google.com/aw/conversions/detail?ocid=00000000&ctId=570000000, your Conversion Action ID is 570000000.',
|
|
12
|
-
type: 'string',
|
|
13
|
-
required: true,
|
|
14
|
-
default: ''
|
|
15
|
-
},
|
|
16
|
-
gclid: {
|
|
17
|
-
label: 'GCLID',
|
|
18
|
-
description: 'The Google click ID (gclid) associated with this conversion.',
|
|
19
|
-
type: 'string',
|
|
20
|
-
default: ''
|
|
21
|
-
},
|
|
22
|
-
gbraid: {
|
|
23
|
-
label: 'GBRAID',
|
|
24
|
-
description: 'The click identifier for clicks associated with app conversions and originating from iOS devices starting with iOS14.',
|
|
25
|
-
type: 'string',
|
|
26
|
-
default: ''
|
|
27
|
-
},
|
|
28
|
-
wbraid: {
|
|
29
|
-
label: 'WBRAID',
|
|
30
|
-
description: 'The click identifier for clicks associated with web conversions and originating from iOS devices starting with iOS14.',
|
|
31
|
-
type: 'string',
|
|
32
|
-
default: ''
|
|
33
|
-
},
|
|
34
|
-
conversion_timestamp: {
|
|
35
|
-
label: 'Conversion Timestamp',
|
|
36
|
-
description: 'The date time at which the conversion occurred. Must be after the click time. The timezone must be specified. The format is "yyyy-mm-dd hh:mm:ss+|-hh:mm", e.g. "2019-01-01 12:32:45-08:00".',
|
|
37
|
-
type: 'string',
|
|
38
|
-
required: true,
|
|
39
|
-
default: {
|
|
40
|
-
'@path': '$.timestamp'
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
email_address: {
|
|
44
|
-
label: 'Email Address',
|
|
45
|
-
description: 'Email address of the individual who triggered the conversion event. Segment will hash this value before sending to Google.',
|
|
46
|
-
type: 'string',
|
|
47
|
-
format: 'email',
|
|
48
|
-
default: {
|
|
49
|
-
'@if': {
|
|
50
|
-
exists: { '@path': '$.properties.email' },
|
|
51
|
-
then: { '@path': '$.properties.email' },
|
|
52
|
-
else: { '@path': '$context.traits.email' }
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
phone_number: {
|
|
57
|
-
label: 'Phone Number',
|
|
58
|
-
description: 'Phone number of the individual who triggered the conversion event, in E.164 standard format, e.g. +14150000000. Segment will hash this value before sending to Google.',
|
|
59
|
-
type: 'string',
|
|
60
|
-
default: {
|
|
61
|
-
'@if': {
|
|
62
|
-
exists: { '@path': '$.properties.phone' },
|
|
63
|
-
then: { '@path': '$.properties.phone' },
|
|
64
|
-
else: { '@path': '$context.traits.phone' }
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
order_id: {
|
|
69
|
-
label: 'Order ID',
|
|
70
|
-
description: 'The order ID associated with the conversion. An order id can only be used for one conversion per conversion action.',
|
|
71
|
-
type: 'string',
|
|
72
|
-
default: {
|
|
73
|
-
'@path': '$.properties.orderId'
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
value: {
|
|
77
|
-
label: 'Value',
|
|
78
|
-
description: 'The value of the conversion for the advertiser.',
|
|
79
|
-
type: 'number',
|
|
80
|
-
default: {
|
|
81
|
-
'@path': '$.properties.total'
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
currency: {
|
|
85
|
-
label: 'Currency',
|
|
86
|
-
description: 'Currency associated with the conversion value. This is the ISO 4217 3-character currency code.',
|
|
87
|
-
type: 'string',
|
|
88
|
-
default: {
|
|
89
|
-
'@path': '$.properties.currency'
|
|
90
|
-
}
|
|
91
|
-
},
|
|
92
|
-
conversion_environment: {
|
|
93
|
-
label: 'Conversion Environment',
|
|
94
|
-
description: 'The environment this conversion was recorded on. e.g. App or Web.',
|
|
95
|
-
type: 'string',
|
|
96
|
-
choices: [
|
|
97
|
-
{ label: 'APP', value: 'APP' },
|
|
98
|
-
{ label: 'WEB', value: 'WEB' },
|
|
99
|
-
{ label: `UNSPECIFIED`, value: 'UNSPECIFIED' }
|
|
100
|
-
]
|
|
101
|
-
},
|
|
102
|
-
merchant_id: {
|
|
103
|
-
label: 'Merchant Center ID',
|
|
104
|
-
description: 'The ID of the Merchant Center account where the items are uploaded.',
|
|
105
|
-
type: 'string',
|
|
106
|
-
default: ''
|
|
107
|
-
},
|
|
108
|
-
merchant_country_code: {
|
|
109
|
-
label: 'Merchant Center Feed Country Code',
|
|
110
|
-
description: 'The ISO 3166 two-character region code of the Merchant Center feed where the items are uploaded.',
|
|
111
|
-
type: 'string',
|
|
112
|
-
default: ''
|
|
113
|
-
},
|
|
114
|
-
merchant_language_code: {
|
|
115
|
-
label: 'Merchant Center Feed Language Code',
|
|
116
|
-
description: 'The ISO 639-1 language code of the Merchant Center feed where the items are uploaded.',
|
|
117
|
-
type: 'string',
|
|
118
|
-
default: ''
|
|
119
|
-
},
|
|
120
|
-
local_cost: {
|
|
121
|
-
label: 'Local Transaction Cost',
|
|
122
|
-
description: 'Sum of all transaction-level discounts, such as free shipping and coupon discounts for the whole cart.',
|
|
123
|
-
type: 'number',
|
|
124
|
-
default: ''
|
|
125
|
-
},
|
|
126
|
-
items: {
|
|
127
|
-
label: 'Items',
|
|
128
|
-
description: 'Data of the items purchased.',
|
|
129
|
-
type: 'object',
|
|
130
|
-
multiple: true,
|
|
131
|
-
properties: {
|
|
132
|
-
product_id: {
|
|
133
|
-
label: 'Product ID',
|
|
134
|
-
type: 'string',
|
|
135
|
-
description: 'The ID of the item sold.'
|
|
136
|
-
},
|
|
137
|
-
quantity: {
|
|
138
|
-
label: 'Quantity',
|
|
139
|
-
type: 'number',
|
|
140
|
-
description: 'Number of items sold.'
|
|
141
|
-
},
|
|
142
|
-
price: {
|
|
143
|
-
label: 'Price',
|
|
144
|
-
type: 'number',
|
|
145
|
-
description: 'Unit price excluding tax, shipping, and any transaction level discounts.'
|
|
146
|
-
}
|
|
147
|
-
},
|
|
148
|
-
default: {
|
|
149
|
-
'@arrayPath': [
|
|
150
|
-
'$.properties.products',
|
|
151
|
-
{
|
|
152
|
-
product_id: {
|
|
153
|
-
'@path': '$.product_id'
|
|
154
|
-
},
|
|
155
|
-
quantity: {
|
|
156
|
-
'@path': '$.quantity'
|
|
157
|
-
},
|
|
158
|
-
price: {
|
|
159
|
-
'@path': '$.price'
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
]
|
|
163
|
-
}
|
|
164
|
-
},
|
|
165
|
-
custom_variables: {
|
|
166
|
-
label: 'Custom Variables',
|
|
167
|
-
description: 'The custom variables associated with this conversion. See Google’s documentation on how to create custom conversion variables.',
|
|
168
|
-
type: 'object',
|
|
169
|
-
additionalProperties: true,
|
|
170
|
-
defaultObjectUI: 'keyvalue'
|
|
171
|
-
}
|
|
172
|
-
},
|
|
173
|
-
perform: async (request, { settings, payload }) => {
|
|
174
|
-
if (!settings.customerId) {
|
|
175
|
-
throw new actions_core_1.IntegrationError('Customer id is required for this action. Please set it in destination settings.', 'Missing required fields.', 400);
|
|
176
|
-
}
|
|
177
|
-
settings.customerId = settings.customerId.replace(/[^0-9.]+/g, '');
|
|
178
|
-
let cartItems = [];
|
|
179
|
-
if (payload.items) {
|
|
180
|
-
cartItems = payload.items.map((product) => {
|
|
181
|
-
return {
|
|
182
|
-
productId: product.product_id,
|
|
183
|
-
quantity: product.quantity,
|
|
184
|
-
unitPrice: product.price
|
|
185
|
-
};
|
|
186
|
-
});
|
|
187
|
-
}
|
|
188
|
-
if (payload.currency) {
|
|
189
|
-
functions_1.verifyCurrency(payload.currency);
|
|
190
|
-
}
|
|
191
|
-
const request_object = {
|
|
192
|
-
conversionAction: `customers/${settings.customerId}/conversionActions/${payload.conversion_action}`,
|
|
193
|
-
conversionDateTime: payload.conversion_timestamp.replace(/T/, ' ').replace(/\..+/, '+00:00'),
|
|
194
|
-
gclid: payload.gclid,
|
|
195
|
-
gbraid: payload.gbraid,
|
|
196
|
-
wbraid: payload.wbraid,
|
|
197
|
-
orderId: payload.order_id,
|
|
198
|
-
conversionValue: payload.value,
|
|
199
|
-
currencyCode: payload.currency,
|
|
200
|
-
conversionEnvironment: payload.conversion_environment,
|
|
201
|
-
cartData: {
|
|
202
|
-
merchantId: payload.merchant_id,
|
|
203
|
-
feedCountryCode: payload.merchant_country_code,
|
|
204
|
-
feedLanguageCode: payload.merchant_language_code,
|
|
205
|
-
localTransactionCost: payload.local_cost,
|
|
206
|
-
items: cartItems
|
|
207
|
-
},
|
|
208
|
-
userIdentifiers: [],
|
|
209
|
-
customVariables: functions_1.formatCustomVariables(payload.custom_variables, settings.customerId)
|
|
210
|
-
};
|
|
211
|
-
if (payload.email_address) {
|
|
212
|
-
request_object.userIdentifiers.push({ hashedEmail: functions_1.hash(payload.email_address) });
|
|
213
|
-
}
|
|
214
|
-
if (payload.phone_number) {
|
|
215
|
-
request_object.userIdentifiers.push({ hashedPhoneNumber: functions_1.hash(payload.phone_number) });
|
|
216
|
-
}
|
|
217
|
-
const response = await request(`https://googleads.googleapis.com/v11/customers/${settings.customerId}:uploadClickConversions`, {
|
|
218
|
-
method: 'post',
|
|
219
|
-
headers: {
|
|
220
|
-
'developer-token': `${process.env.ADWORDS_DEVELOPER_TOKEN}`
|
|
221
|
-
},
|
|
222
|
-
json: {
|
|
223
|
-
conversions: [request_object],
|
|
224
|
-
partialFailure: true
|
|
225
|
-
}
|
|
226
|
-
});
|
|
227
|
-
if (typeof response.data === 'object' && response.data != null) {
|
|
228
|
-
Object.entries(response.data).forEach(([key, value]) => {
|
|
229
|
-
if (key === 'partialFailureError' && value.code !== 0) {
|
|
230
|
-
throw new actions_core_1.IntegrationError(value.message, 'INVALID_ARGUMENT', 400);
|
|
231
|
-
}
|
|
232
|
-
});
|
|
233
|
-
}
|
|
234
|
-
return response;
|
|
235
|
-
}
|
|
236
|
-
};
|
|
237
|
-
exports.default = action;
|
|
238
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-enhanced-conversions/uploadClickConversion/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAI1E,4CAA0E;AAE1E,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,yBAAyB;IAChC,WAAW,EAAE,2DAA2D;IACxE,MAAM,EAAE;QACN,iBAAiB,EAAE;YACjB,KAAK,EAAE,sBAAsB;YAC7B,WAAW,EACT,gUAAgU;YAClU,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,EAAE;SACZ;QACD,KAAK,EAAE;YACL,KAAK,EAAE,OAAO;YACd,WAAW,EAAE,8DAA8D;YAC3E,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,EAAE;SACZ;QACD,MAAM,EAAE;YACN,KAAK,EAAE,QAAQ;YACf,WAAW,EACT,uHAAuH;YACzH,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,EAAE;SACZ;QACD,MAAM,EAAE;YACN,KAAK,EAAE,QAAQ;YACf,WAAW,EACT,uHAAuH;YACzH,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,EAAE;SACZ;QACD,oBAAoB,EAAE;YACpB,KAAK,EAAE,sBAAsB;YAC7B,WAAW,EACT,8LAA8L;YAChM,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,aAAa;aACvB;SACF;QACD,aAAa,EAAE;YACb,KAAK,EAAE,eAAe;YACtB,WAAW,EACT,4HAA4H;YAC9H,IAAI,EAAE,QAAQ;YACd,MAAM,EAAE,OAAO;YACf,OAAO,EAAE;gBACP,KAAK,EAAE;oBACL,MAAM,EAAE,EAAE,OAAO,EAAE,oBAAoB,EAAE;oBACzC,IAAI,EAAE,EAAE,OAAO,EAAE,oBAAoB,EAAE;oBACvC,IAAI,EAAE,EAAE,OAAO,EAAE,uBAAuB,EAAE;iBAC3C;a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AG,CAAC,CAAA;iBACnE;YACH,CAAC,CAAC,CAAA;SACH;QACD,OAAO,QAAQ,CAAA;IACjB,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/destinations/google-enhanced-conversions/uploadClickConversion/types.ts"],"names":[],"mappings":""}
|