saasco-sdk 0.2.5 → 0.2.6
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 +31 -0
- package/dist/index.cjs +454 -305
- package/dist/index.d.cts +12 -8
- package/dist/index.d.ts +12 -8
- package/dist/index.js +454 -305
- package/dist/support.cjs +199 -192
- package/dist/support.js +127 -120
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -287,6 +287,36 @@ saasco.disableDebug();
|
|
|
287
287
|
|
|
288
288
|
The SDK can load Facebook Pixel, TikTok Pixel, and Pinterest Tag and forward `track` / `identify` calls to them. Map your Saasco event names to each network's standard events.
|
|
289
289
|
|
|
290
|
+
When the same conversion is also sent by your server, include a stable `event_id`
|
|
291
|
+
in the browser event properties and use that ID in the server API event:
|
|
292
|
+
|
|
293
|
+
```ts
|
|
294
|
+
saasco.track("Activated subscription", {
|
|
295
|
+
event_id: `${checkoutSessionId}:trial`,
|
|
296
|
+
currency: "USD",
|
|
297
|
+
value: 29,
|
|
298
|
+
});
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
The SDK forwards this as Meta's `eventID` option, TikTok's `event_id` option,
|
|
302
|
+
and Pinterest's `event_id` property. The mapped browser event name must also
|
|
303
|
+
match the server event name. Use a different ID for each distinct conversion;
|
|
304
|
+
the SDK does not generate conversion IDs or send server-side CAPI events.
|
|
305
|
+
|
|
306
|
+
In the browser, events with a nonempty `event_id` are guarded per project,
|
|
307
|
+
event name and destination for the current browser tab session. Concurrent calls
|
|
308
|
+
share an in-flight dispatch. Only successful Saasco ingestion or a call to a
|
|
309
|
+
loaded pixel runtime consumes that destination's guard; failed destinations can
|
|
310
|
+
be retried by calling `track` again or revisiting the return page. With storage
|
|
311
|
+
blocked, the guard lasts only until reload. Events without IDs are unchanged.
|
|
312
|
+
|
|
313
|
+
Integrations initialize concurrently and each ready destination drains its own
|
|
314
|
+
queue. Scripts and queued events have a bounded 10-second wait. Script stubs do
|
|
315
|
+
not count as readiness. A script that fails to initialize can be retried by
|
|
316
|
+
reloading after it is unblocked. Pixel dispatch is not proof of network receipt;
|
|
317
|
+
verify receipt and browser/server deduplication in each advertising dashboard.
|
|
318
|
+
`track()` still reports Saasco ingestion status, not advertising receipt.
|
|
319
|
+
|
|
290
320
|
```ts
|
|
291
321
|
export const saasco = new Saasco({
|
|
292
322
|
projectId: "YOUR-PROJECT-ID",
|
|
@@ -496,6 +526,7 @@ window.SaascoSupport.open();
|
|
|
496
526
|
- `registerTool({ name, execute })` — register a **client tool** the agent can
|
|
497
527
|
call; it runs in your page (see [Tools](#tools)).
|
|
498
528
|
- `open()` / `close()`.
|
|
529
|
+
- `setBottomPadding(px)` — lift the launcher and the open panel by `px` (Intercom `setBottomPadding`). Bottom-docked chrome can instead set `data-saasco-bottom-inset` on itself; the loader measures that element when it overlaps the launcher's corner and uses the larger of the two.
|
|
499
530
|
|
|
500
531
|
The analytics script injects the loader asynchronously, so `window.SaascoSupport`
|
|
501
532
|
appears a tick after your inline script runs. Wait for it before calling the API:
|