@moonbase.sh/storefront 3.14.0 → 3.15.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/README.md +15 -0
- package/dist/moonbase.d.ts +12 -0
- package/dist/moonbase.js +5748 -5670
- package/dist/moonbase.umd.cjs +16 -16
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -762,6 +762,21 @@ onConsentGranted(() => Moonbase.configure({ integrations: { metaPixel: { pixelId
|
|
|
762
762
|
Moonbase.configure({ integrations: { metaPixel: undefined } })
|
|
763
763
|
```
|
|
764
764
|
|
|
765
|
+
### Attribution
|
|
766
|
+
|
|
767
|
+
The widget reads how a visitor arrived: the UTM tags and the referring site, and the ad click IDs Google Ads, Meta, Microsoft Advertising and TikTok add to their links (`gclid`, `gbraid`, `wbraid`, `fbclid`, `msclkid`, `ttclid`). It sends them with the cart, checkout and sign-up, so campaign revenue, UTM-targeted prices and traffic types work.
|
|
768
|
+
|
|
769
|
+
A click ID identifies the visitor's click, so the widget keeps one, and records the arrival on a cart as the page loads (so a visitor who comes back later to buy is still put down to it), only with the visitor's consent to marketing cookies. Without it, it keeps only which platform the click came from, and the arrival for the tab only.
|
|
770
|
+
|
|
771
|
+
Until your page says anything, the widget follows the store's setting in Moonbase, Account settings > Storefront > "Features" > "Ad and campaign tracking": "Ask where the law requires it" tracks visitors outside the EEA, the United Kingdom and Switzerland (by where Moonbase locates the visit) and waits for consent elsewhere, "Only with cookie consent" always waits, and "Always" never asks. Whatever your cookie banner reports wins over the setting:
|
|
772
|
+
|
|
773
|
+
```ts
|
|
774
|
+
onConsentGranted(() => Moonbase.configure({ attribution: { consent: true } }))
|
|
775
|
+
onConsentWithdrawn(() => Moonbase.configure({ attribution: { consent: false } }))
|
|
776
|
+
```
|
|
777
|
+
|
|
778
|
+
Whether a setting fits your business is for your own legal advice; a business based in the EU may owe consent to every visitor.
|
|
779
|
+
|
|
765
780
|
### Identity
|
|
766
781
|
|
|
767
782
|
`signed-in` / `signed-up` forward an identify call when an email/id is available (Meta advanced match, GA4 `user_id`, Klaviyo identify, TikTok identify). On `signed-out`, Moonbase clears what each SDK supports (GA4 `user_id` is reset, GTM gets a `logout` push); Meta, TikTok, and Klaviyo expose no per-user logout, so their profiles persist for the session.
|
package/dist/moonbase.d.ts
CHANGED
|
@@ -655,6 +655,18 @@ export declare interface MoonbaseOptions {
|
|
|
655
655
|
* `dataLayer`, `klaviyo`, `ttq`). Pass a provider's config to turn it on.
|
|
656
656
|
*/
|
|
657
657
|
integrations: IntegrationsConfig;
|
|
658
|
+
attribution: {
|
|
659
|
+
/**
|
|
660
|
+
* Whether the visitor has agreed to marketing cookies, the category your cookie banner files
|
|
661
|
+
* ad tracking under. `true` keeps the ad click IDs (`gclid`, `fbclid` and the rest) and
|
|
662
|
+
* remembers the arrival beyond the visit; `false` records only the UTM tags, referring site
|
|
663
|
+
* and the ad platform a click came from, for the visit. Left out (the default), the widget
|
|
664
|
+
* follows the store's setting in Moonbase (Account settings > Storefront > "Features"):
|
|
665
|
+
* always, per country, or only with cookie consent. Set it with `Moonbase.configure()` when
|
|
666
|
+
* the banner reports the visitor's choice.
|
|
667
|
+
*/
|
|
668
|
+
consent: boolean | undefined;
|
|
669
|
+
};
|
|
658
670
|
}
|
|
659
671
|
|
|
660
672
|
/** Which surface a promotion was rendered on. */
|