@stacksee/analytics 0.14.0 → 0.14.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/dist/providers/client.js
CHANGED
|
@@ -413,7 +413,7 @@ class v extends f {
|
|
|
413
413
|
return;
|
|
414
414
|
}
|
|
415
415
|
const t = document.createElement("script");
|
|
416
|
-
t.src = "https://cdn.visitors.now/v.js", t.setAttribute("data-token", this.config.token), t.async = !0, t.defer = !0, t.onload = () => {
|
|
416
|
+
t.src = "https://cdn.visitors.now/v.js", t.setAttribute("data-token", this.config.token), this.config.persist && t.setAttribute("data-persist", ""), t.async = !0, t.defer = !0, t.onload = () => {
|
|
417
417
|
this.scriptLoaded = !0, e();
|
|
418
418
|
}, t.onerror = () => {
|
|
419
419
|
i(new Error("Failed to load Visitors script"));
|
|
@@ -22,6 +22,12 @@ export interface VisitorsClientConfig {
|
|
|
22
22
|
* Enable/disable the provider
|
|
23
23
|
*/
|
|
24
24
|
enabled?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Enable persist mode. Sets the `data-persist` attribute on the Visitors
|
|
27
|
+
* script tag so the visitor cookie is written, enabling cross-session
|
|
28
|
+
* tracking and Stripe revenue attribution via `getVisitorId()`.
|
|
29
|
+
*/
|
|
30
|
+
persist?: boolean;
|
|
25
31
|
}
|
|
26
32
|
declare global {
|
|
27
33
|
interface Window {
|