@walkeros/server-destination-datamanager 0.4.0 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +186 -41
- package/dist/dev.d.mts +111 -43
- package/dist/dev.d.ts +111 -43
- package/dist/dev.js +1 -1
- package/dist/dev.js.map +1 -1
- package/dist/dev.mjs +1 -1
- package/dist/dev.mjs.map +1 -1
- package/dist/examples/index.d.mts +105 -40
- package/dist/examples/index.d.ts +105 -40
- package/dist/examples/index.js +184 -99
- package/dist/examples/index.mjs +183 -99
- package/dist/index.d.mts +127 -34
- package/dist/index.d.ts +127 -34
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/schemas.d.mts +4 -3
- package/dist/schemas.d.ts +4 -3
- package/dist/schemas.js +1 -1
- package/dist/schemas.js.map +1 -1
- package/dist/schemas.mjs +1 -1
- package/dist/schemas.mjs.map +1 -1
- package/package.json +7 -6
package/dist/examples/index.mjs
CHANGED
|
@@ -4,89 +4,81 @@ var __export = (target, all) => {
|
|
|
4
4
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
5
5
|
};
|
|
6
6
|
|
|
7
|
-
// src/examples/
|
|
8
|
-
var
|
|
9
|
-
__export(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
// src/examples/auth.ts
|
|
8
|
+
var auth_exports = {};
|
|
9
|
+
__export(auth_exports, {
|
|
10
|
+
awsLambda: () => awsLambda,
|
|
11
|
+
customScopes: () => customScopes,
|
|
12
|
+
dockerKubernetes: () => dockerKubernetes,
|
|
13
|
+
gcpCloudFunctions: () => gcpCloudFunctions,
|
|
14
|
+
localDevelopment: () => localDevelopment
|
|
15
15
|
});
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
// Will be hashed automatically
|
|
30
|
-
// Attribution identifiers (captured by browser source from URL)
|
|
31
|
-
gclid: "context.gclid",
|
|
32
|
-
// Google Click ID
|
|
33
|
-
gbraid: "context.gbraid",
|
|
34
|
-
// iOS attribution
|
|
35
|
-
wbraid: "context.wbraid",
|
|
36
|
-
// Web-to-app
|
|
37
|
-
// Shopping cart data
|
|
38
|
-
cartData: {
|
|
39
|
-
map: {
|
|
40
|
-
items: {
|
|
41
|
-
loop: [
|
|
42
|
-
"nested",
|
|
43
|
-
{
|
|
44
|
-
condition: (entity) => isObject(entity) && entity.entity === "product",
|
|
45
|
-
map: {
|
|
46
|
-
merchantProductId: "data.id",
|
|
47
|
-
price: "data.price",
|
|
48
|
-
quantity: { key: "data.quantity", value: 1 }
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
]
|
|
52
|
-
}
|
|
53
|
-
}
|
|
16
|
+
var awsLambda = {
|
|
17
|
+
settings: {
|
|
18
|
+
credentials: {
|
|
19
|
+
client_email: process.env.GOOGLE_CLIENT_EMAIL || "",
|
|
20
|
+
private_key: (process.env.GOOGLE_PRIVATE_KEY || "").replace(/\\n/g, "\n")
|
|
21
|
+
},
|
|
22
|
+
destinations: [
|
|
23
|
+
{
|
|
24
|
+
operatingAccount: {
|
|
25
|
+
accountId: "123-456-7890",
|
|
26
|
+
accountType: "GOOGLE_ADS"
|
|
27
|
+
},
|
|
28
|
+
productDestinationId: "AW-CONVERSION-123"
|
|
54
29
|
}
|
|
55
|
-
|
|
30
|
+
]
|
|
56
31
|
}
|
|
57
32
|
};
|
|
58
|
-
var
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
33
|
+
var gcpCloudFunctions = {
|
|
34
|
+
settings: {
|
|
35
|
+
// No auth config needed - ADC works automatically on GCP!
|
|
36
|
+
destinations: [
|
|
37
|
+
{
|
|
38
|
+
operatingAccount: {
|
|
39
|
+
accountId: "123-456-7890",
|
|
40
|
+
accountType: "GOOGLE_ADS"
|
|
41
|
+
},
|
|
42
|
+
productDestinationId: "AW-CONVERSION-123"
|
|
43
|
+
}
|
|
44
|
+
]
|
|
66
45
|
}
|
|
67
46
|
};
|
|
68
|
-
var
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
47
|
+
var localDevelopment = {
|
|
48
|
+
settings: {
|
|
49
|
+
keyFilename: "./service-account.json",
|
|
50
|
+
destinations: [
|
|
51
|
+
{
|
|
52
|
+
operatingAccount: {
|
|
53
|
+
accountId: "123-456-7890",
|
|
54
|
+
accountType: "GOOGLE_ADS"
|
|
55
|
+
},
|
|
56
|
+
productDestinationId: "AW-CONVERSION-123"
|
|
57
|
+
}
|
|
58
|
+
]
|
|
74
59
|
}
|
|
75
60
|
};
|
|
76
|
-
var
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
61
|
+
var dockerKubernetes = {
|
|
62
|
+
settings: {
|
|
63
|
+
// No explicit config - ADC uses GOOGLE_APPLICATION_CREDENTIALS env var
|
|
64
|
+
destinations: [
|
|
65
|
+
{
|
|
66
|
+
operatingAccount: {
|
|
67
|
+
accountId: "123-456-7890",
|
|
68
|
+
accountType: "GOOGLE_ADS"
|
|
69
|
+
},
|
|
70
|
+
productDestinationId: "AW-CONVERSION-123"
|
|
71
|
+
}
|
|
72
|
+
]
|
|
85
73
|
}
|
|
86
74
|
};
|
|
87
|
-
var
|
|
75
|
+
var customScopes = {
|
|
88
76
|
settings: {
|
|
89
|
-
|
|
77
|
+
credentials: {
|
|
78
|
+
client_email: process.env.GOOGLE_CLIENT_EMAIL || "",
|
|
79
|
+
private_key: (process.env.GOOGLE_PRIVATE_KEY || "").replace(/\\n/g, "\n")
|
|
80
|
+
},
|
|
81
|
+
scopes: ["https://www.googleapis.com/auth/datamanager"],
|
|
90
82
|
destinations: [
|
|
91
83
|
{
|
|
92
84
|
operatingAccount: {
|
|
@@ -96,18 +88,7 @@ var userDataMapping = {
|
|
|
96
88
|
productDestinationId: "AW-CONVERSION-123"
|
|
97
89
|
}
|
|
98
90
|
]
|
|
99
|
-
}
|
|
100
|
-
data: {
|
|
101
|
-
map: {
|
|
102
|
-
email: "user.id",
|
|
103
|
-
phone: "data.phone",
|
|
104
|
-
firstName: "data.firstName",
|
|
105
|
-
lastName: "data.lastName",
|
|
106
|
-
regionCode: "data.country",
|
|
107
|
-
postalCode: "data.zip"
|
|
108
|
-
}
|
|
109
|
-
},
|
|
110
|
-
mapping
|
|
91
|
+
}
|
|
111
92
|
};
|
|
112
93
|
|
|
113
94
|
// src/examples/basic.ts
|
|
@@ -120,7 +101,10 @@ __export(basic_exports, {
|
|
|
120
101
|
});
|
|
121
102
|
var minimal = {
|
|
122
103
|
settings: {
|
|
123
|
-
|
|
104
|
+
credentials: {
|
|
105
|
+
client_email: "service-account@project.iam.gserviceaccount.com",
|
|
106
|
+
private_key: "-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n"
|
|
107
|
+
},
|
|
124
108
|
destinations: [
|
|
125
109
|
{
|
|
126
110
|
operatingAccount: {
|
|
@@ -134,7 +118,10 @@ var minimal = {
|
|
|
134
118
|
};
|
|
135
119
|
var complete = {
|
|
136
120
|
settings: {
|
|
137
|
-
|
|
121
|
+
credentials: {
|
|
122
|
+
client_email: "service-account@project.iam.gserviceaccount.com",
|
|
123
|
+
private_key: "-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n"
|
|
124
|
+
},
|
|
138
125
|
destinations: [
|
|
139
126
|
{
|
|
140
127
|
operatingAccount: {
|
|
@@ -151,7 +138,6 @@ var complete = {
|
|
|
151
138
|
productDestinationId: "G-XXXXXXXXXX"
|
|
152
139
|
}
|
|
153
140
|
],
|
|
154
|
-
eventSource: "WEB",
|
|
155
141
|
batchSize: 100,
|
|
156
142
|
batchInterval: 5e3,
|
|
157
143
|
validateOnly: false,
|
|
@@ -169,16 +155,10 @@ var complete = {
|
|
|
169
155
|
userId: "user.id",
|
|
170
156
|
clientId: "user.device",
|
|
171
157
|
sessionAttributes: "context.sessionAttributes"
|
|
172
|
-
},
|
|
173
|
-
data: {
|
|
174
|
-
map: {
|
|
175
|
-
eventSource: { value: "WEB" }
|
|
176
|
-
}
|
|
177
158
|
}
|
|
178
159
|
};
|
|
179
160
|
var ga4 = {
|
|
180
161
|
settings: {
|
|
181
|
-
accessToken: "ya29.c.xxx",
|
|
182
162
|
destinations: [
|
|
183
163
|
{
|
|
184
164
|
operatingAccount: {
|
|
@@ -187,13 +167,12 @@ var ga4 = {
|
|
|
187
167
|
},
|
|
188
168
|
productDestinationId: "G-XXXXXXXXXX"
|
|
189
169
|
}
|
|
190
|
-
]
|
|
191
|
-
eventSource: "WEB"
|
|
170
|
+
]
|
|
192
171
|
}
|
|
193
172
|
};
|
|
194
173
|
var debug = {
|
|
195
174
|
settings: {
|
|
196
|
-
|
|
175
|
+
keyFilename: "./service-account.json",
|
|
197
176
|
destinations: [
|
|
198
177
|
{
|
|
199
178
|
operatingAccount: {
|
|
@@ -202,12 +181,117 @@ var debug = {
|
|
|
202
181
|
},
|
|
203
182
|
productDestinationId: "AW-CONVERSION-123"
|
|
204
183
|
}
|
|
205
|
-
]
|
|
206
|
-
|
|
207
|
-
|
|
184
|
+
]
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
// src/examples/mapping.ts
|
|
189
|
+
var mapping_exports = {};
|
|
190
|
+
__export(mapping_exports, {
|
|
191
|
+
Lead: () => Lead,
|
|
192
|
+
PageView: () => PageView,
|
|
193
|
+
Purchase: () => Purchase,
|
|
194
|
+
mapping: () => mapping,
|
|
195
|
+
userDataMapping: () => userDataMapping
|
|
196
|
+
});
|
|
197
|
+
import { isObject } from "@walkeros/core";
|
|
198
|
+
var Purchase = {
|
|
199
|
+
name: "purchase",
|
|
200
|
+
data: {
|
|
201
|
+
map: {
|
|
202
|
+
// Required fields
|
|
203
|
+
transactionId: "data.id",
|
|
204
|
+
conversionValue: "data.total",
|
|
205
|
+
currency: { key: "data.currency", value: "USD" },
|
|
206
|
+
eventName: { value: "purchase" },
|
|
207
|
+
// User identification
|
|
208
|
+
userId: "user.id",
|
|
209
|
+
email: "user.id",
|
|
210
|
+
// Will be hashed automatically
|
|
211
|
+
// Attribution identifiers (captured by browser source from URL)
|
|
212
|
+
gclid: "context.gclid",
|
|
213
|
+
// Google Click ID
|
|
214
|
+
gbraid: "context.gbraid",
|
|
215
|
+
// iOS attribution
|
|
216
|
+
wbraid: "context.wbraid",
|
|
217
|
+
// Web-to-app
|
|
218
|
+
// Shopping cart data
|
|
219
|
+
cartData: {
|
|
220
|
+
map: {
|
|
221
|
+
items: {
|
|
222
|
+
loop: [
|
|
223
|
+
"nested",
|
|
224
|
+
{
|
|
225
|
+
condition: (entity) => isObject(entity) && entity.entity === "product",
|
|
226
|
+
map: {
|
|
227
|
+
merchantProductId: "data.id",
|
|
228
|
+
price: "data.price",
|
|
229
|
+
quantity: { key: "data.quantity", value: 1 }
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
]
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
};
|
|
239
|
+
var Lead = {
|
|
240
|
+
name: "generate_lead",
|
|
241
|
+
data: {
|
|
242
|
+
map: {
|
|
243
|
+
eventName: { value: "generate_lead" },
|
|
244
|
+
conversionValue: { value: 10 },
|
|
245
|
+
currency: { value: "USD" }
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
};
|
|
249
|
+
var PageView = {
|
|
250
|
+
name: "page_view",
|
|
251
|
+
data: {
|
|
252
|
+
map: {
|
|
253
|
+
eventName: { value: "page_view" }
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
};
|
|
257
|
+
var mapping = {
|
|
258
|
+
order: {
|
|
259
|
+
complete: Purchase
|
|
260
|
+
},
|
|
261
|
+
lead: {
|
|
262
|
+
submit: Lead
|
|
263
|
+
},
|
|
264
|
+
page: {
|
|
265
|
+
view: PageView
|
|
208
266
|
}
|
|
209
267
|
};
|
|
268
|
+
var userDataMapping = {
|
|
269
|
+
settings: {
|
|
270
|
+
keyFilename: "./service-account.json",
|
|
271
|
+
destinations: [
|
|
272
|
+
{
|
|
273
|
+
operatingAccount: {
|
|
274
|
+
accountId: "123-456-7890",
|
|
275
|
+
accountType: "GOOGLE_ADS"
|
|
276
|
+
},
|
|
277
|
+
productDestinationId: "AW-CONVERSION-123"
|
|
278
|
+
}
|
|
279
|
+
]
|
|
280
|
+
},
|
|
281
|
+
data: {
|
|
282
|
+
map: {
|
|
283
|
+
email: "user.id",
|
|
284
|
+
phone: "data.phone",
|
|
285
|
+
firstName: "data.firstName",
|
|
286
|
+
lastName: "data.lastName",
|
|
287
|
+
regionCode: "data.country",
|
|
288
|
+
postalCode: "data.zip"
|
|
289
|
+
}
|
|
290
|
+
},
|
|
291
|
+
mapping
|
|
292
|
+
};
|
|
210
293
|
export {
|
|
294
|
+
auth_exports as auth,
|
|
211
295
|
basic_exports as basic,
|
|
212
296
|
mapping_exports as mapping
|
|
213
297
|
};
|
package/dist/index.d.mts
CHANGED
|
@@ -1,14 +1,29 @@
|
|
|
1
1
|
import { Destination as Destination$1, Mapping as Mapping$1 } from '@walkeros/core';
|
|
2
2
|
import { DestinationServer } from '@walkeros/server-core';
|
|
3
|
-
|
|
4
|
-
type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'none';
|
|
3
|
+
import { OAuth2Client } from 'google-auth-library';
|
|
5
4
|
|
|
6
5
|
interface Settings {
|
|
7
|
-
/**
|
|
8
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Service account credentials (client_email + private_key)
|
|
8
|
+
* Recommended for serverless environments (AWS Lambda, Docker, etc.)
|
|
9
|
+
*/
|
|
10
|
+
credentials?: {
|
|
11
|
+
client_email: string;
|
|
12
|
+
private_key: string;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Path to service account JSON file
|
|
16
|
+
* For local development or environments with filesystem access
|
|
17
|
+
*/
|
|
18
|
+
keyFilename?: string;
|
|
19
|
+
/**
|
|
20
|
+
* OAuth scopes for Data Manager API
|
|
21
|
+
* @default ['https://www.googleapis.com/auth/datamanager']
|
|
22
|
+
*/
|
|
23
|
+
scopes?: string[];
|
|
9
24
|
/** Array of destination accounts and conversion actions/user lists */
|
|
10
25
|
destinations: Destination[];
|
|
11
|
-
/**
|
|
26
|
+
/** Event source for all events. Defaults to WEB if not specified */
|
|
12
27
|
eventSource?: EventSource;
|
|
13
28
|
/** Maximum number of events to batch before sending (max 2000) */
|
|
14
29
|
batchSize?: number;
|
|
@@ -22,8 +37,6 @@ interface Settings {
|
|
|
22
37
|
consent?: Consent;
|
|
23
38
|
/** Test event code for debugging (optional) */
|
|
24
39
|
testEventCode?: string;
|
|
25
|
-
/** Log level for debugging (optional) */
|
|
26
|
-
logLevel?: LogLevel;
|
|
27
40
|
/** Guided helpers: User data mapping (applies to all events) */
|
|
28
41
|
userData?: Mapping$1.Map;
|
|
29
42
|
/** Guided helper: First-party user ID */
|
|
@@ -45,14 +58,26 @@ interface Mapping {
|
|
|
45
58
|
}
|
|
46
59
|
interface Env extends DestinationServer.Env {
|
|
47
60
|
fetch?: typeof fetch;
|
|
61
|
+
authClient?: OAuth2Client | null;
|
|
48
62
|
}
|
|
49
|
-
type
|
|
63
|
+
type InitSettings = Partial<Settings>;
|
|
64
|
+
type Types = Destination$1.Types<Settings, Mapping, Env, InitSettings>;
|
|
50
65
|
interface DestinationInterface extends DestinationServer.Destination<Types> {
|
|
51
66
|
init: DestinationServer.InitFn<Types>;
|
|
52
67
|
}
|
|
53
68
|
type Config = {
|
|
54
69
|
settings: Settings;
|
|
55
70
|
} & DestinationServer.Config<Types>;
|
|
71
|
+
/**
|
|
72
|
+
* Config after validation - settings is guaranteed to exist with required fields
|
|
73
|
+
* Use this type after calling getConfig() to get proper type narrowing
|
|
74
|
+
* After validation, eventSource is always set (defaults to 'WEB')
|
|
75
|
+
*/
|
|
76
|
+
type ValidatedConfig = Omit<Config, 'settings'> & {
|
|
77
|
+
settings: Settings & {
|
|
78
|
+
eventSource: EventSource;
|
|
79
|
+
};
|
|
80
|
+
};
|
|
56
81
|
type InitFn = DestinationServer.InitFn<Types>;
|
|
57
82
|
type PushFn = DestinationServer.PushFn<Types>;
|
|
58
83
|
type PartialConfig = DestinationServer.PartialConfig<Types>;
|
|
@@ -64,21 +89,27 @@ type Rules = Mapping$1.Rules<Rule>;
|
|
|
64
89
|
* https://developers.google.com/data-manager/api/reference/rest/v1/Destination
|
|
65
90
|
*/
|
|
66
91
|
interface Destination {
|
|
67
|
-
/**
|
|
68
|
-
|
|
92
|
+
/** Reference identifier for this destination */
|
|
93
|
+
reference?: string;
|
|
94
|
+
/** Login account (account initiating the request) */
|
|
95
|
+
loginAccount?: ProductAccount;
|
|
96
|
+
/** Linked account (child account linked to login account) */
|
|
97
|
+
linkedAccount?: ProductAccount;
|
|
98
|
+
/** Operating account (account where data is sent) */
|
|
99
|
+
operatingAccount?: ProductAccount;
|
|
69
100
|
/** Product-specific destination ID (conversion action or user list) */
|
|
70
|
-
productDestinationId
|
|
101
|
+
productDestinationId?: string;
|
|
71
102
|
}
|
|
72
103
|
/**
|
|
73
|
-
*
|
|
104
|
+
* Product account information
|
|
74
105
|
*/
|
|
75
|
-
interface
|
|
106
|
+
interface ProductAccount {
|
|
76
107
|
/** Account ID (e.g., "123-456-7890" for Google Ads) */
|
|
77
108
|
accountId: string;
|
|
78
109
|
/** Type of account */
|
|
79
110
|
accountType: AccountType;
|
|
80
111
|
}
|
|
81
|
-
type AccountType = 'GOOGLE_ADS' | 'DISPLAY_VIDEO_ADVERTISER' | 'DISPLAY_VIDEO_PARTNER' | 'GOOGLE_ANALYTICS_PROPERTY';
|
|
112
|
+
type AccountType = 'ACCOUNT_TYPE_UNSPECIFIED' | 'GOOGLE_ADS' | 'DISPLAY_VIDEO_ADVERTISER' | 'DISPLAY_VIDEO_PARTNER' | 'GOOGLE_ANALYTICS_PROPERTY' | 'DATA_PARTNER';
|
|
82
113
|
type EventSource = 'WEB' | 'APP' | 'IN_STORE' | 'PHONE' | 'OTHER';
|
|
83
114
|
/**
|
|
84
115
|
* Consent for Digital Markets Act (DMA) compliance
|
|
@@ -96,12 +127,10 @@ type ConsentStatus = 'CONSENT_GRANTED' | 'CONSENT_DENIED';
|
|
|
96
127
|
* https://developers.google.com/data-manager/api/reference/rest/v1/events/ingest
|
|
97
128
|
*/
|
|
98
129
|
interface IngestEventsRequest {
|
|
99
|
-
/** OAuth 2.0 access token */
|
|
100
|
-
access_token?: string;
|
|
101
|
-
/** Array of events to ingest (max 2000) */
|
|
102
|
-
events: Event[];
|
|
103
130
|
/** Array of destinations for these events (max 10) */
|
|
104
131
|
destinations: Destination[];
|
|
132
|
+
/** Array of events to ingest (max 2000) */
|
|
133
|
+
events: Event[];
|
|
105
134
|
/** Request-level consent (overridden by event-level) */
|
|
106
135
|
consent?: Consent;
|
|
107
136
|
/** If true, validate without ingestion */
|
|
@@ -114,30 +143,85 @@ interface IngestEventsRequest {
|
|
|
114
143
|
* https://developers.google.com/data-manager/api/reference/rest/v1/Event
|
|
115
144
|
*/
|
|
116
145
|
interface Event {
|
|
117
|
-
/**
|
|
118
|
-
|
|
146
|
+
/** Destination references for routing */
|
|
147
|
+
destinationReferences?: string[];
|
|
119
148
|
/** Transaction ID for deduplication (max 512 chars) */
|
|
120
149
|
transactionId?: string;
|
|
121
|
-
/**
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
|
|
150
|
+
/** Event timestamp in RFC 3339 format */
|
|
151
|
+
eventTimestamp?: string;
|
|
152
|
+
/** Last updated timestamp in RFC 3339 format */
|
|
153
|
+
lastUpdatedTimestamp?: string;
|
|
125
154
|
/** User data with identifiers (max 10 identifiers) */
|
|
126
155
|
userData?: UserData;
|
|
156
|
+
/** Event-level consent (overrides request-level) */
|
|
157
|
+
consent?: Consent;
|
|
127
158
|
/** Attribution identifiers */
|
|
128
159
|
adIdentifiers?: AdIdentifiers;
|
|
129
|
-
/** Conversion value */
|
|
130
|
-
conversionValue?: number;
|
|
131
160
|
/** Currency code (ISO 4217, 3 chars) */
|
|
132
161
|
currency?: string;
|
|
162
|
+
/** Conversion value */
|
|
163
|
+
conversionValue?: number;
|
|
164
|
+
/** Source of the event */
|
|
165
|
+
eventSource?: EventSource;
|
|
166
|
+
/** Device information for the event */
|
|
167
|
+
eventDeviceInfo?: DeviceInfo;
|
|
133
168
|
/** Shopping cart data */
|
|
134
169
|
cartData?: CartData;
|
|
170
|
+
/** Custom variables for the event */
|
|
171
|
+
customVariables?: CustomVariable[];
|
|
172
|
+
/** Experimental fields (subject to change) */
|
|
173
|
+
experimentalFields?: ExperimentalField[];
|
|
174
|
+
/** User properties */
|
|
175
|
+
userProperties?: UserProperties;
|
|
135
176
|
/** Event name for GA4 (max 40 chars, required for GA4) */
|
|
136
177
|
eventName?: string;
|
|
137
|
-
/**
|
|
138
|
-
|
|
139
|
-
/**
|
|
140
|
-
|
|
178
|
+
/** Google Analytics client ID (max 255 chars) */
|
|
179
|
+
clientId?: string;
|
|
180
|
+
/** First-party user ID (max 256 chars) */
|
|
181
|
+
userId?: string;
|
|
182
|
+
/** Additional event parameters */
|
|
183
|
+
additionalEventParameters?: EventParameter[];
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Device information
|
|
187
|
+
*/
|
|
188
|
+
interface DeviceInfo {
|
|
189
|
+
/** User agent string */
|
|
190
|
+
userAgent?: string;
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Custom variable
|
|
194
|
+
*/
|
|
195
|
+
interface CustomVariable {
|
|
196
|
+
/** Variable name */
|
|
197
|
+
name?: string;
|
|
198
|
+
/** Variable value */
|
|
199
|
+
value?: string;
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Experimental field
|
|
203
|
+
*/
|
|
204
|
+
interface ExperimentalField {
|
|
205
|
+
/** Field name */
|
|
206
|
+
name?: string;
|
|
207
|
+
/** Field value */
|
|
208
|
+
value?: string;
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* User properties
|
|
212
|
+
*/
|
|
213
|
+
interface UserProperties {
|
|
214
|
+
/** Property values */
|
|
215
|
+
[key: string]: string | number | boolean | undefined;
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Event parameter
|
|
219
|
+
*/
|
|
220
|
+
interface EventParameter {
|
|
221
|
+
/** Parameter name */
|
|
222
|
+
name?: string;
|
|
223
|
+
/** Parameter value */
|
|
224
|
+
value?: string | number;
|
|
141
225
|
}
|
|
142
226
|
/**
|
|
143
227
|
* User data with identifiers
|
|
@@ -176,14 +260,16 @@ interface Address {
|
|
|
176
260
|
* https://developers.google.com/data-manager/api/reference/rest/v1/AdIdentifiers
|
|
177
261
|
*/
|
|
178
262
|
interface AdIdentifiers {
|
|
263
|
+
/** Session attributes (privacy-safe attribution) */
|
|
264
|
+
sessionAttributes?: string;
|
|
179
265
|
/** Google Click ID (primary attribution) */
|
|
180
266
|
gclid?: string;
|
|
181
267
|
/** iOS attribution identifier (post-ATT) */
|
|
182
268
|
gbraid?: string;
|
|
183
269
|
/** Web-to-app attribution identifier */
|
|
184
270
|
wbraid?: string;
|
|
185
|
-
/**
|
|
186
|
-
|
|
271
|
+
/** Device information for landing page */
|
|
272
|
+
landingPageDeviceInfo?: DeviceInfo;
|
|
187
273
|
}
|
|
188
274
|
/**
|
|
189
275
|
* Shopping cart data
|
|
@@ -263,17 +349,22 @@ type index_CartItem = CartItem;
|
|
|
263
349
|
type index_Config = Config;
|
|
264
350
|
type index_Consent = Consent;
|
|
265
351
|
type index_ConsentStatus = ConsentStatus;
|
|
352
|
+
type index_CustomVariable = CustomVariable;
|
|
266
353
|
type index_Destination = Destination;
|
|
267
354
|
type index_DestinationInterface = DestinationInterface;
|
|
355
|
+
type index_DeviceInfo = DeviceInfo;
|
|
268
356
|
type index_Env = Env;
|
|
269
357
|
type index_Event = Event;
|
|
358
|
+
type index_EventParameter = EventParameter;
|
|
270
359
|
type index_EventSource = EventSource;
|
|
360
|
+
type index_ExperimentalField = ExperimentalField;
|
|
271
361
|
type index_IngestEventsRequest = IngestEventsRequest;
|
|
272
362
|
type index_IngestEventsResponse = IngestEventsResponse;
|
|
273
363
|
type index_InitFn = InitFn;
|
|
364
|
+
type index_InitSettings = InitSettings;
|
|
274
365
|
type index_Mapping = Mapping;
|
|
275
|
-
type index_OperatingAccount = OperatingAccount;
|
|
276
366
|
type index_PartialConfig = PartialConfig;
|
|
367
|
+
type index_ProductAccount = ProductAccount;
|
|
277
368
|
type index_PushEvents = PushEvents;
|
|
278
369
|
type index_PushFn = PushFn;
|
|
279
370
|
type index_RequestError = RequestError;
|
|
@@ -285,9 +376,11 @@ type index_Settings = Settings;
|
|
|
285
376
|
type index_Types = Types;
|
|
286
377
|
type index_UserData = UserData;
|
|
287
378
|
type index_UserIdentifier = UserIdentifier;
|
|
379
|
+
type index_UserProperties = UserProperties;
|
|
380
|
+
type index_ValidatedConfig = ValidatedConfig;
|
|
288
381
|
type index_ValidationError = ValidationError;
|
|
289
382
|
declare namespace index {
|
|
290
|
-
export type { index_AccountType as AccountType, index_AdIdentifiers as AdIdentifiers, index_Address as Address, index_CartData as CartData, index_CartItem as CartItem, index_Config as Config, index_Consent as Consent, index_ConsentStatus as ConsentStatus, index_Destination as Destination, index_DestinationInterface as DestinationInterface, index_Env as Env, index_Event as Event, index_EventSource as EventSource, index_IngestEventsRequest as IngestEventsRequest, index_IngestEventsResponse as IngestEventsResponse, index_InitFn as InitFn,
|
|
383
|
+
export type { index_AccountType as AccountType, index_AdIdentifiers as AdIdentifiers, index_Address as Address, index_CartData as CartData, index_CartItem as CartItem, index_Config as Config, index_Consent as Consent, index_ConsentStatus as ConsentStatus, index_CustomVariable as CustomVariable, index_Destination as Destination, index_DestinationInterface as DestinationInterface, index_DeviceInfo as DeviceInfo, index_Env as Env, index_Event as Event, index_EventParameter as EventParameter, index_EventSource as EventSource, index_ExperimentalField as ExperimentalField, index_IngestEventsRequest as IngestEventsRequest, index_IngestEventsResponse as IngestEventsResponse, index_InitFn as InitFn, index_InitSettings as InitSettings, index_Mapping as Mapping, index_PartialConfig as PartialConfig, index_ProductAccount as ProductAccount, index_PushEvents as PushEvents, index_PushFn as PushFn, index_RequestError as RequestError, index_RequestState as RequestState, index_RequestStatusResponse as RequestStatusResponse, index_Rule as Rule, index_Rules as Rules, index_Settings as Settings, index_Types as Types, index_UserData as UserData, index_UserIdentifier as UserIdentifier, index_UserProperties as UserProperties, index_ValidatedConfig as ValidatedConfig, index_ValidationError as ValidationError };
|
|
291
384
|
}
|
|
292
385
|
|
|
293
386
|
declare const destinationDataManager: DestinationInterface;
|