@walkeros/server-destination-datamanager 2.0.0 → 2.1.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/dev.d.mts +12 -218
- package/dist/dev.d.ts +12 -218
- 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 +8 -214
- package/dist/examples/index.d.ts +8 -214
- package/dist/examples/index.js +57 -278
- package/dist/examples/index.mjs +56 -275
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/walkerOS.json +176 -379
- package/package.json +4 -4
package/dist/examples/index.js
CHANGED
|
@@ -20,301 +20,80 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// src/examples/index.ts
|
|
21
21
|
var examples_exports = {};
|
|
22
22
|
__export(examples_exports, {
|
|
23
|
-
|
|
24
|
-
basic: () => basic_exports,
|
|
25
|
-
mapping: () => mapping_exports
|
|
23
|
+
step: () => step_exports
|
|
26
24
|
});
|
|
27
25
|
module.exports = __toCommonJS(examples_exports);
|
|
28
26
|
|
|
29
|
-
// src/examples/
|
|
30
|
-
var
|
|
31
|
-
__export(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
dockerKubernetes: () => dockerKubernetes,
|
|
35
|
-
gcpCloudFunctions: () => gcpCloudFunctions,
|
|
36
|
-
localDevelopment: () => localDevelopment
|
|
27
|
+
// src/examples/step.ts
|
|
28
|
+
var step_exports = {};
|
|
29
|
+
__export(step_exports, {
|
|
30
|
+
lead: () => lead,
|
|
31
|
+
purchase: () => purchase
|
|
37
32
|
});
|
|
38
|
-
var
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
},
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
settings: {
|
|
57
|
-
// No auth config needed - ADC works automatically on GCP!
|
|
58
|
-
destinations: [
|
|
59
|
-
{
|
|
60
|
-
operatingAccount: {
|
|
61
|
-
accountId: "123-456-7890",
|
|
62
|
-
accountType: "GOOGLE_ADS"
|
|
63
|
-
},
|
|
64
|
-
productDestinationId: "AW-CONVERSION-123"
|
|
65
|
-
}
|
|
66
|
-
]
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
var localDevelopment = {
|
|
70
|
-
settings: {
|
|
71
|
-
keyFilename: "./service-account.json",
|
|
72
|
-
destinations: [
|
|
73
|
-
{
|
|
74
|
-
operatingAccount: {
|
|
75
|
-
accountId: "123-456-7890",
|
|
76
|
-
accountType: "GOOGLE_ADS"
|
|
77
|
-
},
|
|
78
|
-
productDestinationId: "AW-CONVERSION-123"
|
|
79
|
-
}
|
|
80
|
-
]
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
var dockerKubernetes = {
|
|
84
|
-
settings: {
|
|
85
|
-
// No explicit config - ADC uses GOOGLE_APPLICATION_CREDENTIALS env var
|
|
86
|
-
destinations: [
|
|
87
|
-
{
|
|
88
|
-
operatingAccount: {
|
|
89
|
-
accountId: "123-456-7890",
|
|
90
|
-
accountType: "GOOGLE_ADS"
|
|
91
|
-
},
|
|
92
|
-
productDestinationId: "AW-CONVERSION-123"
|
|
93
|
-
}
|
|
94
|
-
]
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
var customScopes = {
|
|
98
|
-
settings: {
|
|
99
|
-
credentials: {
|
|
100
|
-
client_email: process.env.GOOGLE_CLIENT_EMAIL || "",
|
|
101
|
-
private_key: (process.env.GOOGLE_PRIVATE_KEY || "").replace(/\\n/g, "\n")
|
|
102
|
-
},
|
|
103
|
-
scopes: ["https://www.googleapis.com/auth/datamanager"],
|
|
104
|
-
destinations: [
|
|
105
|
-
{
|
|
106
|
-
operatingAccount: {
|
|
107
|
-
accountId: "123-456-7890",
|
|
108
|
-
accountType: "GOOGLE_ADS"
|
|
109
|
-
},
|
|
110
|
-
productDestinationId: "AW-CONVERSION-123"
|
|
111
|
-
}
|
|
112
|
-
]
|
|
113
|
-
}
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
// src/examples/basic.ts
|
|
117
|
-
var basic_exports = {};
|
|
118
|
-
__export(basic_exports, {
|
|
119
|
-
complete: () => complete,
|
|
120
|
-
debug: () => debug,
|
|
121
|
-
ga4: () => ga4,
|
|
122
|
-
minimal: () => minimal
|
|
123
|
-
});
|
|
124
|
-
var minimal = {
|
|
125
|
-
settings: {
|
|
126
|
-
credentials: {
|
|
127
|
-
client_email: "service-account@project.iam.gserviceaccount.com",
|
|
128
|
-
private_key: "-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n"
|
|
129
|
-
},
|
|
130
|
-
destinations: [
|
|
131
|
-
{
|
|
132
|
-
operatingAccount: {
|
|
133
|
-
accountId: "123-456-7890",
|
|
134
|
-
accountType: "GOOGLE_ADS"
|
|
135
|
-
},
|
|
136
|
-
productDestinationId: "AW-CONVERSION-123"
|
|
137
|
-
}
|
|
138
|
-
]
|
|
139
|
-
}
|
|
140
|
-
};
|
|
141
|
-
var complete = {
|
|
142
|
-
settings: {
|
|
143
|
-
credentials: {
|
|
144
|
-
client_email: "service-account@project.iam.gserviceaccount.com",
|
|
145
|
-
private_key: "-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n"
|
|
146
|
-
},
|
|
147
|
-
destinations: [
|
|
148
|
-
{
|
|
149
|
-
operatingAccount: {
|
|
150
|
-
accountId: "123-456-7890",
|
|
151
|
-
accountType: "GOOGLE_ADS"
|
|
152
|
-
},
|
|
153
|
-
productDestinationId: "AW-CONVERSION-123"
|
|
154
|
-
},
|
|
155
|
-
{
|
|
156
|
-
operatingAccount: {
|
|
157
|
-
accountId: "987654321",
|
|
158
|
-
accountType: "GOOGLE_ANALYTICS_PROPERTY"
|
|
159
|
-
},
|
|
160
|
-
productDestinationId: "G-XXXXXXXXXX"
|
|
161
|
-
}
|
|
162
|
-
],
|
|
163
|
-
batchSize: 100,
|
|
164
|
-
batchInterval: 5e3,
|
|
165
|
-
validateOnly: false,
|
|
166
|
-
consent: {
|
|
167
|
-
adUserData: "CONSENT_GRANTED",
|
|
168
|
-
adPersonalization: "CONSENT_GRANTED"
|
|
169
|
-
},
|
|
170
|
-
// Guided helpers (apply to all events)
|
|
171
|
-
userData: {
|
|
172
|
-
email: "user.id",
|
|
173
|
-
phone: "data.phone",
|
|
174
|
-
firstName: "data.firstName",
|
|
175
|
-
lastName: "data.lastName"
|
|
176
|
-
},
|
|
177
|
-
userId: "user.id",
|
|
178
|
-
clientId: "user.device",
|
|
179
|
-
sessionAttributes: "context.sessionAttributes"
|
|
180
|
-
}
|
|
181
|
-
};
|
|
182
|
-
var ga4 = {
|
|
183
|
-
settings: {
|
|
184
|
-
destinations: [
|
|
185
|
-
{
|
|
186
|
-
operatingAccount: {
|
|
187
|
-
accountId: "123456789",
|
|
188
|
-
accountType: "GOOGLE_ANALYTICS_PROPERTY"
|
|
189
|
-
},
|
|
190
|
-
productDestinationId: "G-XXXXXXXXXX"
|
|
33
|
+
var import_core = require("@walkeros/core");
|
|
34
|
+
var purchase = {
|
|
35
|
+
in: (0, import_core.getEvent)("order complete", {
|
|
36
|
+
timestamp: 1700001200,
|
|
37
|
+
data: { id: "ORD-600", total: 149.99, currency: "EUR" },
|
|
38
|
+
user: { id: "user-abc", email: "buyer@example.com" },
|
|
39
|
+
source: { type: "server", id: "", previous_id: "" }
|
|
40
|
+
}),
|
|
41
|
+
mapping: {
|
|
42
|
+
name: "purchase",
|
|
43
|
+
data: {
|
|
44
|
+
map: {
|
|
45
|
+
transactionId: "data.id",
|
|
46
|
+
conversionValue: "data.total",
|
|
47
|
+
currency: { key: "data.currency", value: "USD" },
|
|
48
|
+
eventName: { value: "purchase" },
|
|
49
|
+
userId: "user.id",
|
|
50
|
+
email: "user.id"
|
|
191
51
|
}
|
|
192
|
-
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
settings: {
|
|
197
|
-
keyFilename: "./service-account.json",
|
|
198
|
-
destinations: [
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
out: {
|
|
55
|
+
events: [
|
|
199
56
|
{
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
57
|
+
transactionId: "ORD-600",
|
|
58
|
+
eventName: "purchase",
|
|
59
|
+
eventSource: "WEB",
|
|
60
|
+
conversionValue: 149.99,
|
|
61
|
+
currency: "EUR",
|
|
62
|
+
userId: "user-abc",
|
|
63
|
+
email: "buyer@example.com"
|
|
205
64
|
}
|
|
206
65
|
]
|
|
207
66
|
}
|
|
208
67
|
};
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
mapping:
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
map: {
|
|
224
|
-
// Required fields
|
|
225
|
-
transactionId: "data.id",
|
|
226
|
-
conversionValue: "data.total",
|
|
227
|
-
currency: { key: "data.currency", value: "USD" },
|
|
228
|
-
eventName: { value: "purchase" },
|
|
229
|
-
// User identification
|
|
230
|
-
userId: "user.id",
|
|
231
|
-
email: "user.id",
|
|
232
|
-
// Will be hashed automatically
|
|
233
|
-
// Attribution identifiers (captured by browser source from URL)
|
|
234
|
-
gclid: "context.gclid",
|
|
235
|
-
// Google Click ID
|
|
236
|
-
gbraid: "context.gbraid",
|
|
237
|
-
// iOS attribution
|
|
238
|
-
wbraid: "context.wbraid",
|
|
239
|
-
// Web-to-app
|
|
240
|
-
// Shopping cart data
|
|
241
|
-
cartData: {
|
|
242
|
-
map: {
|
|
243
|
-
items: {
|
|
244
|
-
loop: [
|
|
245
|
-
"nested",
|
|
246
|
-
{
|
|
247
|
-
condition: (entity) => (0, import_core.isObject)(entity) && entity.entity === "product",
|
|
248
|
-
map: {
|
|
249
|
-
merchantProductId: "data.id",
|
|
250
|
-
price: "data.price",
|
|
251
|
-
quantity: { key: "data.quantity", value: 1 }
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
]
|
|
255
|
-
}
|
|
256
|
-
}
|
|
68
|
+
var lead = {
|
|
69
|
+
in: (0, import_core.getEvent)("form submit", {
|
|
70
|
+
timestamp: 1700001201,
|
|
71
|
+
data: { type: "demo-request" },
|
|
72
|
+
user: { email: "prospect@example.com" },
|
|
73
|
+
source: { type: "server", id: "", previous_id: "" }
|
|
74
|
+
}),
|
|
75
|
+
mapping: {
|
|
76
|
+
name: "generate_lead",
|
|
77
|
+
data: {
|
|
78
|
+
map: {
|
|
79
|
+
eventName: { value: "generate_lead" },
|
|
80
|
+
conversionValue: { value: 10 },
|
|
81
|
+
currency: { value: "USD" }
|
|
257
82
|
}
|
|
258
83
|
}
|
|
259
|
-
}
|
|
260
|
-
};
|
|
261
|
-
var Lead = {
|
|
262
|
-
name: "generate_lead",
|
|
263
|
-
data: {
|
|
264
|
-
map: {
|
|
265
|
-
eventName: { value: "generate_lead" },
|
|
266
|
-
conversionValue: { value: 10 },
|
|
267
|
-
currency: { value: "USD" }
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
};
|
|
271
|
-
var PageView = {
|
|
272
|
-
name: "page_view",
|
|
273
|
-
data: {
|
|
274
|
-
map: {
|
|
275
|
-
eventName: { value: "page_view" }
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
};
|
|
279
|
-
var mapping = {
|
|
280
|
-
order: {
|
|
281
|
-
complete: Purchase
|
|
282
84
|
},
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
},
|
|
286
|
-
page: {
|
|
287
|
-
view: PageView
|
|
288
|
-
}
|
|
289
|
-
};
|
|
290
|
-
var userDataMapping = {
|
|
291
|
-
settings: {
|
|
292
|
-
keyFilename: "./service-account.json",
|
|
293
|
-
destinations: [
|
|
85
|
+
out: {
|
|
86
|
+
events: [
|
|
294
87
|
{
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
productDestinationId: "AW-CONVERSION-123"
|
|
88
|
+
transactionId: "1700001201-gr0up-1",
|
|
89
|
+
eventName: "generate_lead",
|
|
90
|
+
eventSource: "WEB",
|
|
91
|
+
email: "prospect@example.com"
|
|
300
92
|
}
|
|
301
93
|
]
|
|
302
|
-
}
|
|
303
|
-
data: {
|
|
304
|
-
map: {
|
|
305
|
-
email: "user.id",
|
|
306
|
-
phone: "data.phone",
|
|
307
|
-
firstName: "data.firstName",
|
|
308
|
-
lastName: "data.lastName",
|
|
309
|
-
regionCode: "data.country",
|
|
310
|
-
postalCode: "data.zip"
|
|
311
|
-
}
|
|
312
|
-
},
|
|
313
|
-
mapping
|
|
94
|
+
}
|
|
314
95
|
};
|
|
315
96
|
// Annotate the CommonJS export names for ESM import in node:
|
|
316
97
|
0 && (module.exports = {
|
|
317
|
-
|
|
318
|
-
basic,
|
|
319
|
-
mapping
|
|
98
|
+
step
|
|
320
99
|
});
|