@callforge/tracking-client 0.9.0 → 0.9.1
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 +2 -1
- package/dist/index.js +6 -0
- package/dist/index.mjs +6 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -122,6 +122,7 @@ Notes:
|
|
|
122
122
|
- `linkPhoneCall` is optimized for mobile tap-to-call timing.
|
|
123
123
|
- `setWebZip` accepts `manual` (typed) and `suggested` (picked from options).
|
|
124
124
|
- `setWebZip` validates ZIP format (`12345`) client-side before sending.
|
|
125
|
+
- `setWebZip` also sends `webZip` as a custom session param in a best-effort sync backup path.
|
|
125
126
|
|
|
126
127
|
### 5. GA4 Integration
|
|
127
128
|
|
|
@@ -286,7 +287,7 @@ if (result.status === 'ready') {
|
|
|
286
287
|
Behavior:
|
|
287
288
|
- Rejects invalid ZIP values unless they are 5 digits.
|
|
288
289
|
- Writes profile data keyed by `sessionId`.
|
|
289
|
-
- Also mirrors `webZip` and `webZipSource` into
|
|
290
|
+
- Also mirrors `webZip` and `webZipSource` into custom params and triggers a best-effort session sync backup.
|
|
290
291
|
|
|
291
292
|
### `client.onReady(callback)`
|
|
292
293
|
|
package/dist/index.js
CHANGED
|
@@ -329,11 +329,17 @@ var CallForge = class _CallForge {
|
|
|
329
329
|
* Write visitor-selected web ZIP to the realtime data layer.
|
|
330
330
|
*/
|
|
331
331
|
async setWebZip(zipCode, options) {
|
|
332
|
+
var _a;
|
|
332
333
|
const normalizedZip = zipCode.trim();
|
|
333
334
|
if (!ZIP_CODE_PATTERN.test(normalizedZip)) {
|
|
334
335
|
throw new Error("Invalid ZIP code. Expected a 5-digit ZIP.");
|
|
335
336
|
}
|
|
336
337
|
const session = await this.getSession();
|
|
338
|
+
const fallbackSource = (_a = options == null ? void 0 : options.source) != null ? _a : "manual";
|
|
339
|
+
void this.setParams({
|
|
340
|
+
webZip: normalizedZip,
|
|
341
|
+
webZipSource: fallbackSource
|
|
342
|
+
});
|
|
337
343
|
const controller = new AbortController();
|
|
338
344
|
const timeoutId = setTimeout(() => controller.abort(), REALTIME_PROFILE_TIMEOUT_MS);
|
|
339
345
|
try {
|
package/dist/index.mjs
CHANGED
|
@@ -305,11 +305,17 @@ var CallForge = class _CallForge {
|
|
|
305
305
|
* Write visitor-selected web ZIP to the realtime data layer.
|
|
306
306
|
*/
|
|
307
307
|
async setWebZip(zipCode, options) {
|
|
308
|
+
var _a;
|
|
308
309
|
const normalizedZip = zipCode.trim();
|
|
309
310
|
if (!ZIP_CODE_PATTERN.test(normalizedZip)) {
|
|
310
311
|
throw new Error("Invalid ZIP code. Expected a 5-digit ZIP.");
|
|
311
312
|
}
|
|
312
313
|
const session = await this.getSession();
|
|
314
|
+
const fallbackSource = (_a = options == null ? void 0 : options.source) != null ? _a : "manual";
|
|
315
|
+
void this.setParams({
|
|
316
|
+
webZip: normalizedZip,
|
|
317
|
+
webZipSource: fallbackSource
|
|
318
|
+
});
|
|
313
319
|
const controller = new AbortController();
|
|
314
320
|
const timeoutId = setTimeout(() => controller.abort(), REALTIME_PROFILE_TIMEOUT_MS);
|
|
315
321
|
try {
|