@shware/analytics 8.13.0 → 8.13.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/attribution/classify.d.cts +6 -7
- package/dist/attribution/classify.d.cts.map +1 -1
- package/dist/attribution/classify.d.mts +6 -7
- package/dist/attribution/classify.d.mts.map +1 -1
- package/dist/attribution/vocabulary.d.cts +24 -25
- package/dist/attribution/vocabulary.d.cts.map +1 -1
- package/dist/attribution/vocabulary.d.mts +24 -25
- package/dist/attribution/vocabulary.d.mts.map +1 -1
- package/dist/click-id/index.d.cts +18 -19
- package/dist/click-id/index.d.cts.map +1 -1
- package/dist/click-id/index.d.mts +18 -19
- package/dist/click-id/index.d.mts.map +1 -1
- package/dist/constants/storage.d.cts +1 -2
- package/dist/constants/storage.d.cts.map +1 -1
- package/dist/constants/storage.d.mts +1 -2
- package/dist/constants/storage.d.mts.map +1 -1
- package/dist/feedback/index.d.cts +1 -2
- package/dist/feedback/index.d.cts.map +1 -1
- package/dist/feedback/index.d.mts +1 -2
- package/dist/feedback/index.d.mts.map +1 -1
- package/dist/hooks/use-app-analytics.d.cts +1 -2
- package/dist/hooks/use-app-analytics.d.cts.map +1 -1
- package/dist/hooks/use-app-analytics.d.mts +1 -2
- package/dist/hooks/use-app-analytics.d.mts.map +1 -1
- package/dist/hooks/use-outbound-click-analytics.d.cts +1 -2
- package/dist/hooks/use-outbound-click-analytics.d.cts.map +1 -1
- package/dist/hooks/use-outbound-click-analytics.d.mts +1 -2
- package/dist/hooks/use-outbound-click-analytics.d.mts.map +1 -1
- package/dist/hooks/use-previous.d.cts +1 -2
- package/dist/hooks/use-previous.d.cts.map +1 -1
- package/dist/hooks/use-previous.d.mts +1 -2
- package/dist/hooks/use-previous.d.mts.map +1 -1
- package/dist/hooks/use-report-web-vitals.d.cts +1 -2
- package/dist/hooks/use-report-web-vitals.d.cts.map +1 -1
- package/dist/hooks/use-report-web-vitals.d.mts +1 -2
- package/dist/hooks/use-report-web-vitals.d.mts.map +1 -1
- package/dist/hooks/use-track-impression.d.cts +1 -2
- package/dist/hooks/use-track-impression.d.cts.map +1 -1
- package/dist/hooks/use-track-impression.d.mts +1 -2
- package/dist/hooks/use-track-impression.d.mts.map +1 -1
- package/dist/hooks/use-uet-id-sync.d.cts +1 -2
- package/dist/hooks/use-uet-id-sync.d.cts.map +1 -1
- package/dist/hooks/use-uet-id-sync.d.mts +1 -2
- package/dist/hooks/use-uet-id-sync.d.mts.map +1 -1
- package/dist/hooks/use-web-analytics.d.cts +1 -2
- package/dist/hooks/use-web-analytics.d.cts.map +1 -1
- package/dist/hooks/use-web-analytics.d.mts +1 -2
- package/dist/hooks/use-web-analytics.d.mts.map +1 -1
- package/dist/link/index.d.cts +3 -4
- package/dist/link/index.d.cts.map +1 -1
- package/dist/link/index.d.mts +3 -4
- package/dist/link/index.d.mts.map +1 -1
- package/dist/native/fbsdk.d.cts +1 -2
- package/dist/native/fbsdk.d.cts.map +1 -1
- package/dist/native/fbsdk.d.mts +1 -2
- package/dist/native/fbsdk.d.mts.map +1 -1
- package/dist/native/fingerprint.d.cts +4 -5
- package/dist/native/fingerprint.d.cts.map +1 -1
- package/dist/native/fingerprint.d.mts +4 -5
- package/dist/native/fingerprint.d.mts.map +1 -1
- package/dist/native/firebase.d.cts +1 -2
- package/dist/native/firebase.d.cts.map +1 -1
- package/dist/native/firebase.d.mts +1 -2
- package/dist/native/firebase.d.mts.map +1 -1
- package/dist/native/posthog.d.cts +1 -2
- package/dist/native/posthog.d.cts.map +1 -1
- package/dist/native/posthog.d.mts +1 -2
- package/dist/native/posthog.d.mts.map +1 -1
- package/dist/native/setup.d.cts +4 -5
- package/dist/native/setup.d.cts.map +1 -1
- package/dist/native/setup.d.mts +4 -5
- package/dist/native/setup.d.mts.map +1 -1
- package/dist/next/index.cjs +14 -14
- package/dist/next/index.cjs.map +1 -1
- package/dist/next/index.d.cts +1 -2
- package/dist/next/index.d.cts.map +1 -1
- package/dist/next/index.d.mts +1 -2
- package/dist/next/index.d.mts.map +1 -1
- package/dist/next/index.mjs +3 -3
- package/dist/react-router/index.d.cts +1 -2
- package/dist/react-router/index.d.cts.map +1 -1
- package/dist/react-router/index.d.mts +1 -2
- package/dist/react-router/index.d.mts.map +1 -1
- package/dist/schema/index.d.cts +16 -17
- package/dist/schema/index.d.cts.map +1 -1
- package/dist/schema/index.d.mts +16 -17
- package/dist/schema/index.d.mts.map +1 -1
- package/dist/server/action-source.d.cts +3 -4
- package/dist/server/action-source.d.cts.map +1 -1
- package/dist/server/action-source.d.mts +3 -4
- package/dist/server/action-source.d.mts.map +1 -1
- package/dist/server/google-data-manager.d.cts +9 -10
- package/dist/server/google-data-manager.d.cts.map +1 -1
- package/dist/server/google-data-manager.d.mts +9 -10
- package/dist/server/google-data-manager.d.mts.map +1 -1
- package/dist/server/linkedin-conversions-api.d.cts +4 -5
- package/dist/server/linkedin-conversions-api.d.cts.map +1 -1
- package/dist/server/linkedin-conversions-api.d.mts +4 -5
- package/dist/server/linkedin-conversions-api.d.mts.map +1 -1
- package/dist/server/meta-capi.d.cts +5 -6
- package/dist/server/meta-capi.d.cts.map +1 -1
- package/dist/server/meta-capi.d.mts +5 -6
- package/dist/server/meta-capi.d.mts.map +1 -1
- package/dist/server/meta-conversions-api.d.cts +4 -5
- package/dist/server/meta-conversions-api.d.cts.map +1 -1
- package/dist/server/meta-conversions-api.d.mts +4 -5
- package/dist/server/meta-conversions-api.d.mts.map +1 -1
- package/dist/server/microsoft-conversions-api.d.cts +11 -12
- package/dist/server/microsoft-conversions-api.d.cts.map +1 -1
- package/dist/server/microsoft-conversions-api.d.mts +11 -12
- package/dist/server/microsoft-conversions-api.d.mts.map +1 -1
- package/dist/server/openai-conversions-api.d.cts +5 -6
- package/dist/server/openai-conversions-api.d.cts.map +1 -1
- package/dist/server/openai-conversions-api.d.mts +5 -6
- package/dist/server/openai-conversions-api.d.mts.map +1 -1
- package/dist/server/page-location.d.cts +1 -2
- package/dist/server/page-location.d.cts.map +1 -1
- package/dist/server/page-location.d.mts +1 -2
- package/dist/server/page-location.d.mts.map +1 -1
- package/dist/server/reddit-conversions-api.d.cts +4 -5
- package/dist/server/reddit-conversions-api.d.cts.map +1 -1
- package/dist/server/reddit-conversions-api.d.mts +4 -5
- package/dist/server/reddit-conversions-api.d.mts.map +1 -1
- package/dist/setup/index.d.cts +5 -6
- package/dist/setup/index.d.cts.map +1 -1
- package/dist/setup/index.d.mts +5 -6
- package/dist/setup/index.d.mts.map +1 -1
- package/dist/setup/session.d.cts +2 -3
- package/dist/setup/session.d.cts.map +1 -1
- package/dist/setup/session.d.mts +2 -3
- package/dist/setup/session.d.mts.map +1 -1
- package/dist/tanstack/analytics.d.cts +1 -2
- package/dist/tanstack/analytics.d.cts.map +1 -1
- package/dist/tanstack/analytics.d.mts +1 -2
- package/dist/tanstack/analytics.d.mts.map +1 -1
- package/dist/tanstack/middleware.d.cts +3 -4
- package/dist/tanstack/middleware.d.cts.map +1 -1
- package/dist/tanstack/middleware.d.mts +3 -4
- package/dist/tanstack/middleware.d.mts.map +1 -1
- package/dist/test/setup.d.cts +3 -4
- package/dist/test/setup.d.cts.map +1 -1
- package/dist/test/setup.d.mts +3 -4
- package/dist/test/setup.d.mts.map +1 -1
- package/dist/third-parties/google-analytics.d.cts +2 -3
- package/dist/third-parties/google-analytics.d.cts.map +1 -1
- package/dist/third-parties/google-analytics.d.mts +2 -3
- package/dist/third-parties/google-analytics.d.mts.map +1 -1
- package/dist/third-parties/ignored-events.d.cts +1 -2
- package/dist/third-parties/ignored-events.d.cts.map +1 -1
- package/dist/third-parties/ignored-events.d.mts +1 -2
- package/dist/third-parties/ignored-events.d.mts.map +1 -1
- package/dist/third-parties/linkedin-insight-tag.d.cts +3 -4
- package/dist/third-parties/linkedin-insight-tag.d.cts.map +1 -1
- package/dist/third-parties/linkedin-insight-tag.d.mts +3 -4
- package/dist/third-parties/linkedin-insight-tag.d.mts.map +1 -1
- package/dist/third-parties/meta-pixel.d.cts +2 -3
- package/dist/third-parties/meta-pixel.d.cts.map +1 -1
- package/dist/third-parties/meta-pixel.d.mts +2 -3
- package/dist/third-parties/meta-pixel.d.mts.map +1 -1
- package/dist/third-parties/microsoft-uet.d.cts +6 -7
- package/dist/third-parties/microsoft-uet.d.cts.map +1 -1
- package/dist/third-parties/microsoft-uet.d.mts +6 -7
- package/dist/third-parties/microsoft-uet.d.mts.map +1 -1
- package/dist/third-parties/openai-pixel.d.cts +2 -3
- package/dist/third-parties/openai-pixel.d.cts.map +1 -1
- package/dist/third-parties/openai-pixel.d.mts +2 -3
- package/dist/third-parties/openai-pixel.d.mts.map +1 -1
- package/dist/third-parties/posthog.d.cts +2 -3
- package/dist/third-parties/posthog.d.cts.map +1 -1
- package/dist/third-parties/posthog.d.mts +2 -3
- package/dist/third-parties/posthog.d.mts.map +1 -1
- package/dist/third-parties/reddit-pixel.d.cts +2 -3
- package/dist/third-parties/reddit-pixel.d.cts.map +1 -1
- package/dist/third-parties/reddit-pixel.d.mts +2 -3
- package/dist/third-parties/reddit-pixel.d.mts.map +1 -1
- package/dist/track/fbq.d.cts +10 -11
- package/dist/track/fbq.d.cts.map +1 -1
- package/dist/track/fbq.d.mts +10 -11
- package/dist/track/fbq.d.mts.map +1 -1
- package/dist/track/gtag.d.cts +26 -27
- package/dist/track/gtag.d.cts.map +1 -1
- package/dist/track/gtag.d.mts +26 -27
- package/dist/track/gtag.d.mts.map +1 -1
- package/dist/track/index.d.cts +4 -5
- package/dist/track/index.d.cts.map +1 -1
- package/dist/track/index.d.mts +4 -5
- package/dist/track/index.d.mts.map +1 -1
- package/dist/track/lintrk.d.cts +1 -2
- package/dist/track/lintrk.d.cts.map +1 -1
- package/dist/track/lintrk.d.mts +1 -2
- package/dist/track/lintrk.d.mts.map +1 -1
- package/dist/track/oaiq.d.cts +17 -18
- package/dist/track/oaiq.d.cts.map +1 -1
- package/dist/track/oaiq.d.mts +17 -18
- package/dist/track/oaiq.d.mts.map +1 -1
- package/dist/track/rdt.d.cts +10 -11
- package/dist/track/rdt.d.cts.map +1 -1
- package/dist/track/rdt.d.mts +10 -11
- package/dist/track/rdt.d.mts.map +1 -1
- package/dist/track/types.d.cts +20 -21
- package/dist/track/types.d.cts.map +1 -1
- package/dist/track/types.d.mts +20 -21
- package/dist/track/types.d.mts.map +1 -1
- package/dist/track/uetq.d.cts +8 -9
- package/dist/track/uetq.d.cts.map +1 -1
- package/dist/track/uetq.d.mts +8 -9
- package/dist/track/uetq.d.mts.map +1 -1
- package/dist/utils/field.d.cts +1 -2
- package/dist/utils/field.d.cts.map +1 -1
- package/dist/utils/field.d.mts +1 -2
- package/dist/utils/field.d.mts.map +1 -1
- package/dist/utils/sha256.d.cts +1 -2
- package/dist/utils/sha256.d.cts.map +1 -1
- package/dist/utils/sha256.d.mts +1 -2
- package/dist/utils/sha256.d.mts.map +1 -1
- package/dist/utils/stripe.d.cts +2 -3
- package/dist/utils/stripe.d.cts.map +1 -1
- package/dist/utils/stripe.d.mts +2 -3
- package/dist/utils/stripe.d.mts.map +1 -1
- package/dist/visitor/index.d.cts +2 -3
- package/dist/visitor/index.d.cts.map +1 -1
- package/dist/visitor/index.d.mts +2 -3
- package/dist/visitor/index.d.mts.map +1 -1
- package/dist/visitor/types.d.cts +4 -5
- package/dist/visitor/types.d.cts.map +1 -1
- package/dist/visitor/types.d.mts +4 -5
- package/dist/visitor/types.d.mts.map +1 -1
- package/dist/web/index.d.cts +3 -4
- package/dist/web/index.d.cts.map +1 -1
- package/dist/web/index.d.mts +3 -4
- package/dist/web/index.d.mts.map +1 -1
- package/dist/web/page-key.d.cts +1 -2
- package/dist/web/page-key.d.cts.map +1 -1
- package/dist/web/page-key.d.mts +1 -2
- package/dist/web/page-key.d.mts.map +1 -1
- package/package.json +27 -27
|
@@ -2,7 +2,7 @@ import { TrackTags } from "../track/types.cjs";
|
|
|
2
2
|
import { ChannelGroup } from "./vocabulary.cjs";
|
|
3
3
|
//#region src/attribution/classify.d.ts
|
|
4
4
|
/** What a session's tags say about how it arrived: the touch, as the session row stores it. */
|
|
5
|
-
interface Touch {
|
|
5
|
+
export interface Touch {
|
|
6
6
|
/** The source, as GA calls it: a `Channel`, a `utm_source` outside the list, a referring host, or `(direct)`. */
|
|
7
7
|
channel: string;
|
|
8
8
|
/** How, as GA calls it: `utm_medium` as declared, else what the rule that named the channel implies; `(none)` for direct. */
|
|
@@ -15,15 +15,15 @@ interface Touch {
|
|
|
15
15
|
priority: number | null;
|
|
16
16
|
}
|
|
17
17
|
/** What a product rule names, when it recognises the session; the channel group is derived. */
|
|
18
|
-
type ProductTouch = Omit<Touch, 'channel_group'>;
|
|
18
|
+
export type ProductTouch = Omit<Touch, 'channel_group'>;
|
|
19
19
|
/**
|
|
20
20
|
* A product's own rule: a landing page convention, a code in the URL. Tried after the campaign
|
|
21
21
|
* rules (utm, click id, ad landing page) and before the referrer, so a link shared on Facebook
|
|
22
22
|
* or WhatsApp is credited to what the product recognises, not to the site it was shared on.
|
|
23
23
|
* Returns null when the session is not one of its.
|
|
24
24
|
*/
|
|
25
|
-
type TouchRule = (tags: TrackTags) => ProductTouch | null;
|
|
26
|
-
interface ClassifyOptions {
|
|
25
|
+
export type TouchRule = (tags: TrackTags) => ProductTouch | null;
|
|
26
|
+
export interface ClassifyOptions {
|
|
27
27
|
/**
|
|
28
28
|
* The product's own hosts, as patterns over the lower-cased referrer host: a session that
|
|
29
29
|
* starts from an internal link after the session timeout refers to them, which is navigation,
|
|
@@ -41,7 +41,7 @@ interface ClassifyOptions {
|
|
|
41
41
|
* assistants have `organic_ai`. Checked in GA4's order — paid before organic, the organic groups before
|
|
42
42
|
* email, referral last — so a pair that fits two rules lands where GA4 would put it.
|
|
43
43
|
*/
|
|
44
|
-
declare function channelGroupOf(channel: string, medium: string): ChannelGroup;
|
|
44
|
+
export declare function channelGroupOf(channel: string, medium: string): ChannelGroup;
|
|
45
45
|
/**
|
|
46
46
|
* Reads the tags a session arrived with (its `session_start` tags) as one touch. Run once, when
|
|
47
47
|
* the session is written; the result is stored, and the views only read it.
|
|
@@ -56,7 +56,6 @@ declare function channelGroupOf(channel: string, medium: string): ChannelGroup;
|
|
|
56
56
|
* the rule that named the channel (`TOUCH_PRIORITY`): campaign touches, then the product's own
|
|
57
57
|
* as they declare, then the referrer.
|
|
58
58
|
*/
|
|
59
|
-
declare function classifyTouch(tags: TrackTags, options?: ClassifyOptions): Touch;
|
|
59
|
+
export declare function classifyTouch(tags: TrackTags, options?: ClassifyOptions): Touch;
|
|
60
60
|
//#endregion
|
|
61
|
-
export { ClassifyOptions, ProductTouch, Touch, TouchRule, channelGroupOf, classifyTouch };
|
|
62
61
|
//# sourceMappingURL=classify.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"classify.d.cts","names":[],"sources":["../../src/attribution/classify.ts"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"classify.d.cts","names":[],"sources":["../../src/attribution/classify.ts"],"mappings":";;;;iBAoBiB;;EAEf;;EAEA;;EAEA,eAAe;;EAEf;;EAEA;;;YAIU,eAAe,KAAK;;;;;;;YAQpB,aAAa,MAAM,cAAc;iBAE5B;;;;;;EAMf,oBAAoB;;EAEpB,iBAAiB;;;;;;;;;;wBAgFH,eAAe,iBAAiB,iBAAiB;;;;;;;;;;;;;;;wBAmCjD,cAAc,MAAM,WAAW,UAAS,kBAAuB"}
|
|
@@ -2,7 +2,7 @@ import { TrackTags } from "../track/types.mjs";
|
|
|
2
2
|
import { ChannelGroup } from "./vocabulary.mjs";
|
|
3
3
|
//#region src/attribution/classify.d.ts
|
|
4
4
|
/** What a session's tags say about how it arrived: the touch, as the session row stores it. */
|
|
5
|
-
interface Touch {
|
|
5
|
+
export interface Touch {
|
|
6
6
|
/** The source, as GA calls it: a `Channel`, a `utm_source` outside the list, a referring host, or `(direct)`. */
|
|
7
7
|
channel: string;
|
|
8
8
|
/** How, as GA calls it: `utm_medium` as declared, else what the rule that named the channel implies; `(none)` for direct. */
|
|
@@ -15,15 +15,15 @@ interface Touch {
|
|
|
15
15
|
priority: number | null;
|
|
16
16
|
}
|
|
17
17
|
/** What a product rule names, when it recognises the session; the channel group is derived. */
|
|
18
|
-
type ProductTouch = Omit<Touch, 'channel_group'>;
|
|
18
|
+
export type ProductTouch = Omit<Touch, 'channel_group'>;
|
|
19
19
|
/**
|
|
20
20
|
* A product's own rule: a landing page convention, a code in the URL. Tried after the campaign
|
|
21
21
|
* rules (utm, click id, ad landing page) and before the referrer, so a link shared on Facebook
|
|
22
22
|
* or WhatsApp is credited to what the product recognises, not to the site it was shared on.
|
|
23
23
|
* Returns null when the session is not one of its.
|
|
24
24
|
*/
|
|
25
|
-
type TouchRule = (tags: TrackTags) => ProductTouch | null;
|
|
26
|
-
interface ClassifyOptions {
|
|
25
|
+
export type TouchRule = (tags: TrackTags) => ProductTouch | null;
|
|
26
|
+
export interface ClassifyOptions {
|
|
27
27
|
/**
|
|
28
28
|
* The product's own hosts, as patterns over the lower-cased referrer host: a session that
|
|
29
29
|
* starts from an internal link after the session timeout refers to them, which is navigation,
|
|
@@ -41,7 +41,7 @@ interface ClassifyOptions {
|
|
|
41
41
|
* assistants have `organic_ai`. Checked in GA4's order — paid before organic, the organic groups before
|
|
42
42
|
* email, referral last — so a pair that fits two rules lands where GA4 would put it.
|
|
43
43
|
*/
|
|
44
|
-
declare function channelGroupOf(channel: string, medium: string): ChannelGroup;
|
|
44
|
+
export declare function channelGroupOf(channel: string, medium: string): ChannelGroup;
|
|
45
45
|
/**
|
|
46
46
|
* Reads the tags a session arrived with (its `session_start` tags) as one touch. Run once, when
|
|
47
47
|
* the session is written; the result is stored, and the views only read it.
|
|
@@ -56,7 +56,6 @@ declare function channelGroupOf(channel: string, medium: string): ChannelGroup;
|
|
|
56
56
|
* the rule that named the channel (`TOUCH_PRIORITY`): campaign touches, then the product's own
|
|
57
57
|
* as they declare, then the referrer.
|
|
58
58
|
*/
|
|
59
|
-
declare function classifyTouch(tags: TrackTags, options?: ClassifyOptions): Touch;
|
|
59
|
+
export declare function classifyTouch(tags: TrackTags, options?: ClassifyOptions): Touch;
|
|
60
60
|
//#endregion
|
|
61
|
-
export { ClassifyOptions, ProductTouch, Touch, TouchRule, channelGroupOf, classifyTouch };
|
|
62
61
|
//# sourceMappingURL=classify.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"classify.d.mts","names":[],"sources":["../../src/attribution/classify.ts"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"classify.d.mts","names":[],"sources":["../../src/attribution/classify.ts"],"mappings":";;;;iBAoBiB;;EAEf;;EAEA;;EAEA,eAAe;;EAEf;;EAEA;;;YAIU,eAAe,KAAK;;;;;;;YAQpB,aAAa,MAAM,cAAc;iBAE5B;;;;;;EAMf,oBAAoB;;EAEpB,iBAAiB;;;;;;;;;;wBAgFH,eAAe,iBAAiB,iBAAiB;;;;;;;;;;;;;;;wBAmCjD,cAAc,MAAM,WAAW,UAAS,kBAAuB"}
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
* (referrer exclusions) and its landing-page conventions.
|
|
7
7
|
*/
|
|
8
8
|
/** A session that arrived through nothing we can name. GA's spelling, so dashboards read as GA. */
|
|
9
|
-
declare const DIRECT_CHANNEL = "(direct)";
|
|
9
|
+
export declare const DIRECT_CHANNEL = "(direct)";
|
|
10
10
|
/** The medium of a direct session. */
|
|
11
|
-
declare const NO_MEDIUM = "(none)";
|
|
11
|
+
export declare const NO_MEDIUM = "(none)";
|
|
12
12
|
/** The medium of a tagged link that named a source but no medium. */
|
|
13
|
-
declare const MEDIUM_NOT_SET = "(not set)";
|
|
13
|
+
export declare const MEDIUM_NOT_SET = "(not set)";
|
|
14
14
|
/** The channels the rules below can name. A `utm_source` outside this list is its own channel. */
|
|
15
|
-
declare const CHANNELS: readonly ['meta', 'google', 'dv360', 'microsoft', 'tiktok', 'reddit', 'linkedin', 'snapchat', 'x', 'kakao', 'yandex', 'yahoo', 'duckduckgo', 'baidu', 'ecosia', 'naver', 'brave', 'pinterest', 'youtube',
|
|
15
|
+
export declare const CHANNELS: readonly ['meta', 'google', 'dv360', 'microsoft', 'tiktok', 'reddit', 'linkedin', 'snapchat', 'x', 'kakao', 'yandex', 'yahoo', 'duckduckgo', 'baidu', 'ecosia', 'naver', 'brave', 'pinterest', 'youtube',
|
|
16
16
|
/** AI assistants that send people to sites: ChatGPT tags its links `utm_source=chatgpt.com`, the
|
|
17
17
|
* others show as a referrer. Their own channel group, `organic_ai`, since GA4's default groups
|
|
18
18
|
* would file them under Referral / Unassigned and the question "how much does AI bring" comes up. */
|
|
@@ -24,14 +24,14 @@ declare const CHANNELS: readonly ['meta', 'google', 'dv360', 'microsoft', 'tikto
|
|
|
24
24
|
* `referral`: that word is the channel group of any outside site, and a channel of the same name
|
|
25
25
|
* would be impossible to tell apart in queries. */
|
|
26
26
|
'referral_program'];
|
|
27
|
-
type Channel = (typeof CHANNELS)[number];
|
|
27
|
+
export type Channel = (typeof CHANNELS)[number];
|
|
28
28
|
/** GA4's default channel groups, as identifiers; a dashboard maps them to display names. */
|
|
29
|
-
declare const CHANNEL_GROUPS: readonly ['direct', 'paid_search', 'paid_social', 'paid_other', 'display', 'organic_search', 'organic_social', 'organic_video',
|
|
29
|
+
export declare const CHANNEL_GROUPS: readonly ['direct', 'paid_search', 'paid_social', 'paid_other', 'display', 'organic_search', 'organic_social', 'organic_video',
|
|
30
30
|
/** not in GA4's default grouping: sessions an AI assistant sent, by referrer or by ChatGPT's utm */
|
|
31
31
|
'organic_ai', 'referral', 'email', 'affiliate', 'unassigned'];
|
|
32
|
-
type ChannelGroup = (typeof CHANNEL_GROUPS)[number];
|
|
32
|
+
export type ChannelGroup = (typeof CHANNEL_GROUPS)[number];
|
|
33
33
|
/** `utm_source` spellings that mean the same channel: Meta's `{{site_source_name}}` values and the usual synonyms. */
|
|
34
|
-
declare const SOURCE_ALIASES: {
|
|
34
|
+
export declare const SOURCE_ALIASES: {
|
|
35
35
|
readonly fb: 'meta';
|
|
36
36
|
readonly ig: 'meta';
|
|
37
37
|
readonly an: 'meta';
|
|
@@ -58,14 +58,14 @@ declare const SOURCE_ALIASES: {
|
|
|
58
58
|
* collects (`AdvertisingInfo`); `fbp` and `rdt_uuid` are deliberately absent — they are pixel
|
|
59
59
|
* browser ids, present with or without a click.
|
|
60
60
|
*/
|
|
61
|
-
declare const CLICK_ID_CHANNELS: readonly [readonly ["fbclid", "meta"], readonly ["fbc", "meta"], readonly ["gclid", "google"], readonly ["gbraid", "google"], readonly ["wbraid", "google"], readonly ["gad_source", "google"], readonly ["gad_campaignid", "google"], readonly ["dclid", "dv360"], readonly ["msclkid", "microsoft"], readonly ["ttclid", "tiktok"], readonly ["rdt_cid", "reddit"], readonly ["li_fat_id", "linkedin"], readonly ["sccid", "snapchat"], readonly ["twclid", "x"], readonly ["ko_click_id", "kakao"], readonly ["yclid", "yandex"]];
|
|
61
|
+
export declare const CLICK_ID_CHANNELS: readonly [readonly ["fbclid", "meta"], readonly ["fbc", "meta"], readonly ["gclid", "google"], readonly ["gbraid", "google"], readonly ["wbraid", "google"], readonly ["gad_source", "google"], readonly ["gad_campaignid", "google"], readonly ["dclid", "dv360"], readonly ["msclkid", "microsoft"], readonly ["ttclid", "tiktok"], readonly ["rdt_cid", "reddit"], readonly ["li_fat_id", "linkedin"], readonly ["sccid", "snapchat"], readonly ["twclid", "x"], readonly ["ko_click_id", "kakao"], readonly ["yclid", "yandex"]];
|
|
62
62
|
/**
|
|
63
63
|
* A landing page reserved for one channel's ads, for ads that lost their parameters:
|
|
64
64
|
* `/lp/<channel>`, with or without host, query and hash; the capture is the channel. A product
|
|
65
65
|
* that names its landing pages differently replaces this.
|
|
66
66
|
*/
|
|
67
|
-
declare const AD_LANDING_PAGE: RegExp;
|
|
68
|
-
type ReferrerMedium = 'organic' | 'social' | 'video' | 'ai';
|
|
67
|
+
export declare const AD_LANDING_PAGE: RegExp;
|
|
68
|
+
export type ReferrerMedium = 'organic' | 'social' | 'video' | 'ai';
|
|
69
69
|
/**
|
|
70
70
|
* Referrer hosts that name a channel, as regular expressions over the lower-cased host,
|
|
71
71
|
* with the medium GA4 gives that kind of site. Anything else that refers is `referral`, kept as
|
|
@@ -74,7 +74,7 @@ type ReferrerMedium = 'organic' | 'social' | 'video' | 'ai';
|
|
|
74
74
|
* first, because `gemini.google.com`, `copilot.microsoft.com` and `yiyan.baidu.com` would
|
|
75
75
|
* otherwise be Google, Microsoft and Baidu search.
|
|
76
76
|
*/
|
|
77
|
-
declare const REFERRER_SITES: readonly [readonly ["chatgpt", "ai", RegExp], readonly ["perplexity", "ai", RegExp], readonly ["gemini", "ai", RegExp], readonly ["claude", "ai", RegExp], readonly ["copilot", "ai", RegExp], readonly ["grok", "ai", RegExp], readonly ["deepseek", "ai", RegExp], readonly ["doubao", "ai", RegExp], readonly ["kimi", "ai", RegExp], readonly ["qwen", "ai", RegExp], readonly ["yuanbao", "ai", RegExp], readonly ["ernie", "ai", RegExp], readonly ["zhipu", "ai", RegExp], readonly ["google", "organic", RegExp], readonly ["microsoft", "organic", RegExp], readonly ["yahoo", "organic", RegExp], readonly ["duckduckgo", "organic", RegExp], readonly ["baidu", "organic", RegExp], readonly ["yandex", "organic", RegExp], readonly ["ecosia", "organic", RegExp], readonly ["naver", "organic", RegExp], readonly ["brave", "organic", RegExp], readonly ["meta", "social", RegExp], readonly ["x", "social", RegExp], readonly ["linkedin", "social", RegExp], readonly ["reddit", "social", RegExp], readonly ["tiktok", "social", RegExp], readonly ["pinterest", "social", RegExp], readonly ["snapchat", "social", RegExp], readonly ["youtube", "video", RegExp]];
|
|
77
|
+
export declare const REFERRER_SITES: readonly [readonly ["chatgpt", "ai", RegExp], readonly ["perplexity", "ai", RegExp], readonly ["gemini", "ai", RegExp], readonly ["claude", "ai", RegExp], readonly ["copilot", "ai", RegExp], readonly ["grok", "ai", RegExp], readonly ["deepseek", "ai", RegExp], readonly ["doubao", "ai", RegExp], readonly ["kimi", "ai", RegExp], readonly ["qwen", "ai", RegExp], readonly ["yuanbao", "ai", RegExp], readonly ["ernie", "ai", RegExp], readonly ["zhipu", "ai", RegExp], readonly ["google", "organic", RegExp], readonly ["microsoft", "organic", RegExp], readonly ["yahoo", "organic", RegExp], readonly ["duckduckgo", "organic", RegExp], readonly ["baidu", "organic", RegExp], readonly ["yandex", "organic", RegExp], readonly ["ecosia", "organic", RegExp], readonly ["naver", "organic", RegExp], readonly ["brave", "organic", RegExp], readonly ["meta", "social", RegExp], readonly ["x", "social", RegExp], readonly ["linkedin", "social", RegExp], readonly ["reddit", "social", RegExp], readonly ["tiktok", "social", RegExp], readonly ["pinterest", "social", RegExp], readonly ["snapchat", "social", RegExp], readonly ["youtube", "video", RegExp]];
|
|
78
78
|
/**
|
|
79
79
|
* Referrer hosts that are navigation, not acquisition, when a session happens to start on the way
|
|
80
80
|
* back from them: the local dev host; the payment providers a visitor is bounced through; the
|
|
@@ -87,9 +87,9 @@ declare const REFERRER_SITES: readonly [readonly ["chatgpt", "ai", RegExp], read
|
|
|
87
87
|
* LinkedIn, GitHub, Discord — cannot be told apart by host (referrer policies strip the path) and
|
|
88
88
|
* are left as the referrers they usually are. Regular expressions over the lower-cased host.
|
|
89
89
|
*/
|
|
90
|
-
declare const REFERRERS_NOT_A_TOUCH: readonly [RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp];
|
|
90
|
+
export declare const REFERRERS_NOT_A_TOUCH: readonly [RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp];
|
|
91
91
|
/** GA4's paid mediums — cpc, cpm, ppc, retargeting, paid_social, … — plus Performance Max. */
|
|
92
|
-
declare const PAID_MEDIUM: RegExp;
|
|
92
|
+
export declare const PAID_MEDIUM: RegExp;
|
|
93
93
|
/**
|
|
94
94
|
* Meta's `{{placement}}` values, lower-cased, which an ad URL template of `utm_medium={{placement}}`
|
|
95
95
|
* puts in the medium. Only an ad carries one — an organic post arrives as a referrer, with no utm
|
|
@@ -100,18 +100,18 @@ declare const PAID_MEDIUM: RegExp;
|
|
|
100
100
|
* here. Meta's documented values plus the ones seen in the wild (`facebook_mobile_reels`,
|
|
101
101
|
* `facebook_notification`, `an`), and the literal macro for a template that did not expand it.
|
|
102
102
|
*/
|
|
103
|
-
declare const META_PLACEMENTS: readonly ['facebook_desktop_feed', 'facebook_mobile_feed', 'facebook_mobile_reels', 'facebook_reels', 'facebook_reels_overlay', 'facebook_right_column', 'facebook_marketplace', 'facebook_video_feeds', 'facebook_stories', 'facebook_search', 'facebook_instream_video', 'facebook_instant_article', 'facebook_groups_feed', 'facebook_profile_feed', 'facebook_notification', 'facebook_notifications', 'facebook_business_explore', 'instagram_feed', 'instagram_stories', 'instagram_reels', 'instagram_reels_overlay', 'instagram_explore', 'instagram_explore_home', 'instagram_search', 'instagram_shop', 'instagram_profile_feed', 'instagram_profile_reels', 'instagram_igtv', 'messenger_inbox', 'messenger_stories', 'messenger_sponsored_messages', 'threads_feed', 'whatsapp_status', 'audience_network_classic', 'audience_network_rewarded_video', 'audience_network_native_banner_and_interstitial', 'an', 'others',
|
|
103
|
+
export declare const META_PLACEMENTS: readonly ['facebook_desktop_feed', 'facebook_mobile_feed', 'facebook_mobile_reels', 'facebook_reels', 'facebook_reels_overlay', 'facebook_right_column', 'facebook_marketplace', 'facebook_video_feeds', 'facebook_stories', 'facebook_search', 'facebook_instream_video', 'facebook_instant_article', 'facebook_groups_feed', 'facebook_profile_feed', 'facebook_notification', 'facebook_notifications', 'facebook_business_explore', 'instagram_feed', 'instagram_stories', 'instagram_reels', 'instagram_reels_overlay', 'instagram_explore', 'instagram_explore_home', 'instagram_search', 'instagram_shop', 'instagram_profile_feed', 'instagram_profile_reels', 'instagram_igtv', 'messenger_inbox', 'messenger_stories', 'messenger_sponsored_messages', 'threads_feed', 'whatsapp_status', 'audience_network_classic', 'audience_network_rewarded_video', 'audience_network_native_banner_and_interstitial', 'an', 'others',
|
|
104
104
|
/** the macro itself, when Meta did not expand it (written in a field it does not substitute, or a
|
|
105
105
|
* preview click): still only ever produced by a Meta ad URL, so still a paid Meta click */
|
|
106
106
|
'{{placement}}'];
|
|
107
|
-
declare const DISPLAY_MEDIUMS: readonly ['display', 'banner', 'expandable', 'interstitial'];
|
|
107
|
+
export declare const DISPLAY_MEDIUMS: readonly ['display', 'banner', 'expandable', 'interstitial'];
|
|
108
108
|
/** GA4's email spellings, as a source or a medium. */
|
|
109
|
-
declare const EMAIL_MEDIUMS: readonly ['email', 'e-mail', 'e_mail', 'e mail'];
|
|
109
|
+
export declare const EMAIL_MEDIUMS: readonly ['email', 'e-mail', 'e_mail', 'e mail'];
|
|
110
110
|
/** A medium that says email or newsletter anywhere in it: `outbound email`, `cold_email`, `newsletter`, and GA4's four. */
|
|
111
|
-
declare const EMAIL_MEDIUM: RegExp;
|
|
111
|
+
export declare const EMAIL_MEDIUM: RegExp;
|
|
112
112
|
/** Where a touch came from: a tracked session, or a report by the user or staff. */
|
|
113
|
-
declare const TOUCH_SOURCES: readonly ['tracked', 'reported'];
|
|
114
|
-
type TouchSource = (typeof TOUCH_SOURCES)[number];
|
|
113
|
+
export declare const TOUCH_SOURCES: readonly ['tracked', 'reported'];
|
|
114
|
+
export type TouchSource = (typeof TOUCH_SOURCES)[number];
|
|
115
115
|
/**
|
|
116
116
|
* How a reported touch was learned:
|
|
117
117
|
* - survey: the user answered "how did you hear about us" (onboarding, checkout)
|
|
@@ -119,8 +119,8 @@ type TouchSource = (typeof TOUCH_SOURCES)[number];
|
|
|
119
119
|
* - phone: a call came in on a channel's dedicated number, marked by staff or the phone system
|
|
120
120
|
* - manual: staff recorded what a customer told them
|
|
121
121
|
*/
|
|
122
|
-
declare const REPORTED_TOUCH_KINDS: readonly ['survey', 'promo_code', 'phone', 'manual'];
|
|
123
|
-
type ReportedTouchKind = (typeof REPORTED_TOUCH_KINDS)[number];
|
|
122
|
+
export declare const REPORTED_TOUCH_KINDS: readonly ['survey', 'promo_code', 'phone', 'manual'];
|
|
123
|
+
export type ReportedTouchKind = (typeof REPORTED_TOUCH_KINDS)[number];
|
|
124
124
|
/**
|
|
125
125
|
* How much a touch is worth against another when attribution has to choose between sessions;
|
|
126
126
|
* lower wins, and the latest wins among equals. Stored on the session when it is classified, so
|
|
@@ -132,7 +132,7 @@ type ReportedTouchKind = (typeof REPORTED_TOUCH_KINDS)[number];
|
|
|
132
132
|
* So two sessions tagged with utm and gclid respectively are equal here (both `campaign`) and the
|
|
133
133
|
* later one is credited, while one session carrying both is named by its utm.
|
|
134
134
|
*/
|
|
135
|
-
declare const TOUCH_PRIORITY: {
|
|
135
|
+
export declare const TOUCH_PRIORITY: {
|
|
136
136
|
/** utm, click id, ad landing page: someone tagged that link (in that order within a session) */
|
|
137
137
|
readonly campaign: 1;
|
|
138
138
|
/** a reported touch staff stand behind: a call on a channel's number, a recorded conversation */
|
|
@@ -143,12 +143,11 @@ declare const TOUCH_PRIORITY: {
|
|
|
143
143
|
readonly claimed: 3;
|
|
144
144
|
};
|
|
145
145
|
/** Which reported kinds are staff facts and which are the user's claims. */
|
|
146
|
-
declare const REPORTED_TOUCH_PRIORITY: {
|
|
146
|
+
export declare const REPORTED_TOUCH_PRIORITY: {
|
|
147
147
|
readonly phone: 1;
|
|
148
148
|
readonly manual: 1;
|
|
149
149
|
readonly survey: 3;
|
|
150
150
|
readonly promo_code: 3;
|
|
151
151
|
};
|
|
152
152
|
//#endregion
|
|
153
|
-
export { AD_LANDING_PAGE, CHANNELS, CHANNEL_GROUPS, CLICK_ID_CHANNELS, Channel, ChannelGroup, DIRECT_CHANNEL, DISPLAY_MEDIUMS, EMAIL_MEDIUM, EMAIL_MEDIUMS, MEDIUM_NOT_SET, META_PLACEMENTS, NO_MEDIUM, PAID_MEDIUM, REFERRERS_NOT_A_TOUCH, REFERRER_SITES, REPORTED_TOUCH_KINDS, REPORTED_TOUCH_PRIORITY, ReferrerMedium, ReportedTouchKind, SOURCE_ALIASES, TOUCH_PRIORITY, TOUCH_SOURCES, TouchSource };
|
|
154
153
|
//# sourceMappingURL=vocabulary.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vocabulary.d.cts","names":[],"sources":["../../src/attribution/vocabulary.ts"],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"vocabulary.d.cts","names":[],"sources":["../../src/attribution/vocabulary.ts"],"mappings":";;;;;;;;qBAUa;;qBAEA;;qBAEA;;qBAGA;;;;;;;;;;;;YA4CD,kBAAkB;;qBAGjB;;;YAiBD,uBAAuB;;qBAGtB;WACP;WACA;WACA;WACC;WACK;WACC;WACL;WACG;WACK;WACH;WACF;WACM;WACI;WACX;WACS;WACJ;WACE;WACC;WACF;WACF;;;;;;;qBAQD;;;;;;qBAwBA,iBAAe;YAEhB;;;;;;;;;qBAUC,qDAAc,uCAAA,mCAAA,mCAAA,oCAAA,iCAAA,qCAAA,mCAAA,iCAAA,iCAAA,oCAAA,kCAAA,kCAAA,wCAAA,2CAAA,uCAAA,4CAAA,uCAAA,wCAAA,wCAAA,uCAAA,uCAAA,qCAAA,kCAAA,yCAAA,uCAAA,uCAAA,0CAAA,yCAAA,uCAAA;;;;;;;;;;;;;qBA6Cd,iCAAqB,QAAA,QAAA,QAAA,QAAA,QAAA,QAAA,QAAA,QAAA,QAAA,QAAA,QAAA,QAAA,QAAA,QAAA,QAAA,QAAA,QAAA,QAAA,QAAA,QAAA,QAAA,QAAA,QAAA;;qBAgCrB,aAAW;;;;;;;;;;;qBAWX;;;;qBA2CA;;qBAEA;;qBAEA,cAAY;;qBAGZ;YACD,sBAAsB;;;;;;;;qBASrB;YACD,4BAA4B;;;;;;;;;;;;qBAa3B;;WAED;;WAEA;;WAEA;;WAED;;;qBAIE"}
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
* (referrer exclusions) and its landing-page conventions.
|
|
7
7
|
*/
|
|
8
8
|
/** A session that arrived through nothing we can name. GA's spelling, so dashboards read as GA. */
|
|
9
|
-
declare const DIRECT_CHANNEL = "(direct)";
|
|
9
|
+
export declare const DIRECT_CHANNEL = "(direct)";
|
|
10
10
|
/** The medium of a direct session. */
|
|
11
|
-
declare const NO_MEDIUM = "(none)";
|
|
11
|
+
export declare const NO_MEDIUM = "(none)";
|
|
12
12
|
/** The medium of a tagged link that named a source but no medium. */
|
|
13
|
-
declare const MEDIUM_NOT_SET = "(not set)";
|
|
13
|
+
export declare const MEDIUM_NOT_SET = "(not set)";
|
|
14
14
|
/** The channels the rules below can name. A `utm_source` outside this list is its own channel. */
|
|
15
|
-
declare const CHANNELS: readonly ['meta', 'google', 'dv360', 'microsoft', 'tiktok', 'reddit', 'linkedin', 'snapchat', 'x', 'kakao', 'yandex', 'yahoo', 'duckduckgo', 'baidu', 'ecosia', 'naver', 'brave', 'pinterest', 'youtube',
|
|
15
|
+
export declare const CHANNELS: readonly ['meta', 'google', 'dv360', 'microsoft', 'tiktok', 'reddit', 'linkedin', 'snapchat', 'x', 'kakao', 'yandex', 'yahoo', 'duckduckgo', 'baidu', 'ecosia', 'naver', 'brave', 'pinterest', 'youtube',
|
|
16
16
|
/** AI assistants that send people to sites: ChatGPT tags its links `utm_source=chatgpt.com`, the
|
|
17
17
|
* others show as a referrer. Their own channel group, `organic_ai`, since GA4's default groups
|
|
18
18
|
* would file them under Referral / Unassigned and the question "how much does AI bring" comes up. */
|
|
@@ -24,14 +24,14 @@ declare const CHANNELS: readonly ['meta', 'google', 'dv360', 'microsoft', 'tikto
|
|
|
24
24
|
* `referral`: that word is the channel group of any outside site, and a channel of the same name
|
|
25
25
|
* would be impossible to tell apart in queries. */
|
|
26
26
|
'referral_program'];
|
|
27
|
-
type Channel = (typeof CHANNELS)[number];
|
|
27
|
+
export type Channel = (typeof CHANNELS)[number];
|
|
28
28
|
/** GA4's default channel groups, as identifiers; a dashboard maps them to display names. */
|
|
29
|
-
declare const CHANNEL_GROUPS: readonly ['direct', 'paid_search', 'paid_social', 'paid_other', 'display', 'organic_search', 'organic_social', 'organic_video',
|
|
29
|
+
export declare const CHANNEL_GROUPS: readonly ['direct', 'paid_search', 'paid_social', 'paid_other', 'display', 'organic_search', 'organic_social', 'organic_video',
|
|
30
30
|
/** not in GA4's default grouping: sessions an AI assistant sent, by referrer or by ChatGPT's utm */
|
|
31
31
|
'organic_ai', 'referral', 'email', 'affiliate', 'unassigned'];
|
|
32
|
-
type ChannelGroup = (typeof CHANNEL_GROUPS)[number];
|
|
32
|
+
export type ChannelGroup = (typeof CHANNEL_GROUPS)[number];
|
|
33
33
|
/** `utm_source` spellings that mean the same channel: Meta's `{{site_source_name}}` values and the usual synonyms. */
|
|
34
|
-
declare const SOURCE_ALIASES: {
|
|
34
|
+
export declare const SOURCE_ALIASES: {
|
|
35
35
|
readonly fb: 'meta';
|
|
36
36
|
readonly ig: 'meta';
|
|
37
37
|
readonly an: 'meta';
|
|
@@ -58,14 +58,14 @@ declare const SOURCE_ALIASES: {
|
|
|
58
58
|
* collects (`AdvertisingInfo`); `fbp` and `rdt_uuid` are deliberately absent — they are pixel
|
|
59
59
|
* browser ids, present with or without a click.
|
|
60
60
|
*/
|
|
61
|
-
declare const CLICK_ID_CHANNELS: readonly [readonly ["fbclid", "meta"], readonly ["fbc", "meta"], readonly ["gclid", "google"], readonly ["gbraid", "google"], readonly ["wbraid", "google"], readonly ["gad_source", "google"], readonly ["gad_campaignid", "google"], readonly ["dclid", "dv360"], readonly ["msclkid", "microsoft"], readonly ["ttclid", "tiktok"], readonly ["rdt_cid", "reddit"], readonly ["li_fat_id", "linkedin"], readonly ["sccid", "snapchat"], readonly ["twclid", "x"], readonly ["ko_click_id", "kakao"], readonly ["yclid", "yandex"]];
|
|
61
|
+
export declare const CLICK_ID_CHANNELS: readonly [readonly ["fbclid", "meta"], readonly ["fbc", "meta"], readonly ["gclid", "google"], readonly ["gbraid", "google"], readonly ["wbraid", "google"], readonly ["gad_source", "google"], readonly ["gad_campaignid", "google"], readonly ["dclid", "dv360"], readonly ["msclkid", "microsoft"], readonly ["ttclid", "tiktok"], readonly ["rdt_cid", "reddit"], readonly ["li_fat_id", "linkedin"], readonly ["sccid", "snapchat"], readonly ["twclid", "x"], readonly ["ko_click_id", "kakao"], readonly ["yclid", "yandex"]];
|
|
62
62
|
/**
|
|
63
63
|
* A landing page reserved for one channel's ads, for ads that lost their parameters:
|
|
64
64
|
* `/lp/<channel>`, with or without host, query and hash; the capture is the channel. A product
|
|
65
65
|
* that names its landing pages differently replaces this.
|
|
66
66
|
*/
|
|
67
|
-
declare const AD_LANDING_PAGE: RegExp;
|
|
68
|
-
type ReferrerMedium = 'organic' | 'social' | 'video' | 'ai';
|
|
67
|
+
export declare const AD_LANDING_PAGE: RegExp;
|
|
68
|
+
export type ReferrerMedium = 'organic' | 'social' | 'video' | 'ai';
|
|
69
69
|
/**
|
|
70
70
|
* Referrer hosts that name a channel, as regular expressions over the lower-cased host,
|
|
71
71
|
* with the medium GA4 gives that kind of site. Anything else that refers is `referral`, kept as
|
|
@@ -74,7 +74,7 @@ type ReferrerMedium = 'organic' | 'social' | 'video' | 'ai';
|
|
|
74
74
|
* first, because `gemini.google.com`, `copilot.microsoft.com` and `yiyan.baidu.com` would
|
|
75
75
|
* otherwise be Google, Microsoft and Baidu search.
|
|
76
76
|
*/
|
|
77
|
-
declare const REFERRER_SITES: readonly [readonly ["chatgpt", "ai", RegExp], readonly ["perplexity", "ai", RegExp], readonly ["gemini", "ai", RegExp], readonly ["claude", "ai", RegExp], readonly ["copilot", "ai", RegExp], readonly ["grok", "ai", RegExp], readonly ["deepseek", "ai", RegExp], readonly ["doubao", "ai", RegExp], readonly ["kimi", "ai", RegExp], readonly ["qwen", "ai", RegExp], readonly ["yuanbao", "ai", RegExp], readonly ["ernie", "ai", RegExp], readonly ["zhipu", "ai", RegExp], readonly ["google", "organic", RegExp], readonly ["microsoft", "organic", RegExp], readonly ["yahoo", "organic", RegExp], readonly ["duckduckgo", "organic", RegExp], readonly ["baidu", "organic", RegExp], readonly ["yandex", "organic", RegExp], readonly ["ecosia", "organic", RegExp], readonly ["naver", "organic", RegExp], readonly ["brave", "organic", RegExp], readonly ["meta", "social", RegExp], readonly ["x", "social", RegExp], readonly ["linkedin", "social", RegExp], readonly ["reddit", "social", RegExp], readonly ["tiktok", "social", RegExp], readonly ["pinterest", "social", RegExp], readonly ["snapchat", "social", RegExp], readonly ["youtube", "video", RegExp]];
|
|
77
|
+
export declare const REFERRER_SITES: readonly [readonly ["chatgpt", "ai", RegExp], readonly ["perplexity", "ai", RegExp], readonly ["gemini", "ai", RegExp], readonly ["claude", "ai", RegExp], readonly ["copilot", "ai", RegExp], readonly ["grok", "ai", RegExp], readonly ["deepseek", "ai", RegExp], readonly ["doubao", "ai", RegExp], readonly ["kimi", "ai", RegExp], readonly ["qwen", "ai", RegExp], readonly ["yuanbao", "ai", RegExp], readonly ["ernie", "ai", RegExp], readonly ["zhipu", "ai", RegExp], readonly ["google", "organic", RegExp], readonly ["microsoft", "organic", RegExp], readonly ["yahoo", "organic", RegExp], readonly ["duckduckgo", "organic", RegExp], readonly ["baidu", "organic", RegExp], readonly ["yandex", "organic", RegExp], readonly ["ecosia", "organic", RegExp], readonly ["naver", "organic", RegExp], readonly ["brave", "organic", RegExp], readonly ["meta", "social", RegExp], readonly ["x", "social", RegExp], readonly ["linkedin", "social", RegExp], readonly ["reddit", "social", RegExp], readonly ["tiktok", "social", RegExp], readonly ["pinterest", "social", RegExp], readonly ["snapchat", "social", RegExp], readonly ["youtube", "video", RegExp]];
|
|
78
78
|
/**
|
|
79
79
|
* Referrer hosts that are navigation, not acquisition, when a session happens to start on the way
|
|
80
80
|
* back from them: the local dev host; the payment providers a visitor is bounced through; the
|
|
@@ -87,9 +87,9 @@ declare const REFERRER_SITES: readonly [readonly ["chatgpt", "ai", RegExp], read
|
|
|
87
87
|
* LinkedIn, GitHub, Discord — cannot be told apart by host (referrer policies strip the path) and
|
|
88
88
|
* are left as the referrers they usually are. Regular expressions over the lower-cased host.
|
|
89
89
|
*/
|
|
90
|
-
declare const REFERRERS_NOT_A_TOUCH: readonly [RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp];
|
|
90
|
+
export declare const REFERRERS_NOT_A_TOUCH: readonly [RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp];
|
|
91
91
|
/** GA4's paid mediums — cpc, cpm, ppc, retargeting, paid_social, … — plus Performance Max. */
|
|
92
|
-
declare const PAID_MEDIUM: RegExp;
|
|
92
|
+
export declare const PAID_MEDIUM: RegExp;
|
|
93
93
|
/**
|
|
94
94
|
* Meta's `{{placement}}` values, lower-cased, which an ad URL template of `utm_medium={{placement}}`
|
|
95
95
|
* puts in the medium. Only an ad carries one — an organic post arrives as a referrer, with no utm
|
|
@@ -100,18 +100,18 @@ declare const PAID_MEDIUM: RegExp;
|
|
|
100
100
|
* here. Meta's documented values plus the ones seen in the wild (`facebook_mobile_reels`,
|
|
101
101
|
* `facebook_notification`, `an`), and the literal macro for a template that did not expand it.
|
|
102
102
|
*/
|
|
103
|
-
declare const META_PLACEMENTS: readonly ['facebook_desktop_feed', 'facebook_mobile_feed', 'facebook_mobile_reels', 'facebook_reels', 'facebook_reels_overlay', 'facebook_right_column', 'facebook_marketplace', 'facebook_video_feeds', 'facebook_stories', 'facebook_search', 'facebook_instream_video', 'facebook_instant_article', 'facebook_groups_feed', 'facebook_profile_feed', 'facebook_notification', 'facebook_notifications', 'facebook_business_explore', 'instagram_feed', 'instagram_stories', 'instagram_reels', 'instagram_reels_overlay', 'instagram_explore', 'instagram_explore_home', 'instagram_search', 'instagram_shop', 'instagram_profile_feed', 'instagram_profile_reels', 'instagram_igtv', 'messenger_inbox', 'messenger_stories', 'messenger_sponsored_messages', 'threads_feed', 'whatsapp_status', 'audience_network_classic', 'audience_network_rewarded_video', 'audience_network_native_banner_and_interstitial', 'an', 'others',
|
|
103
|
+
export declare const META_PLACEMENTS: readonly ['facebook_desktop_feed', 'facebook_mobile_feed', 'facebook_mobile_reels', 'facebook_reels', 'facebook_reels_overlay', 'facebook_right_column', 'facebook_marketplace', 'facebook_video_feeds', 'facebook_stories', 'facebook_search', 'facebook_instream_video', 'facebook_instant_article', 'facebook_groups_feed', 'facebook_profile_feed', 'facebook_notification', 'facebook_notifications', 'facebook_business_explore', 'instagram_feed', 'instagram_stories', 'instagram_reels', 'instagram_reels_overlay', 'instagram_explore', 'instagram_explore_home', 'instagram_search', 'instagram_shop', 'instagram_profile_feed', 'instagram_profile_reels', 'instagram_igtv', 'messenger_inbox', 'messenger_stories', 'messenger_sponsored_messages', 'threads_feed', 'whatsapp_status', 'audience_network_classic', 'audience_network_rewarded_video', 'audience_network_native_banner_and_interstitial', 'an', 'others',
|
|
104
104
|
/** the macro itself, when Meta did not expand it (written in a field it does not substitute, or a
|
|
105
105
|
* preview click): still only ever produced by a Meta ad URL, so still a paid Meta click */
|
|
106
106
|
'{{placement}}'];
|
|
107
|
-
declare const DISPLAY_MEDIUMS: readonly ['display', 'banner', 'expandable', 'interstitial'];
|
|
107
|
+
export declare const DISPLAY_MEDIUMS: readonly ['display', 'banner', 'expandable', 'interstitial'];
|
|
108
108
|
/** GA4's email spellings, as a source or a medium. */
|
|
109
|
-
declare const EMAIL_MEDIUMS: readonly ['email', 'e-mail', 'e_mail', 'e mail'];
|
|
109
|
+
export declare const EMAIL_MEDIUMS: readonly ['email', 'e-mail', 'e_mail', 'e mail'];
|
|
110
110
|
/** A medium that says email or newsletter anywhere in it: `outbound email`, `cold_email`, `newsletter`, and GA4's four. */
|
|
111
|
-
declare const EMAIL_MEDIUM: RegExp;
|
|
111
|
+
export declare const EMAIL_MEDIUM: RegExp;
|
|
112
112
|
/** Where a touch came from: a tracked session, or a report by the user or staff. */
|
|
113
|
-
declare const TOUCH_SOURCES: readonly ['tracked', 'reported'];
|
|
114
|
-
type TouchSource = (typeof TOUCH_SOURCES)[number];
|
|
113
|
+
export declare const TOUCH_SOURCES: readonly ['tracked', 'reported'];
|
|
114
|
+
export type TouchSource = (typeof TOUCH_SOURCES)[number];
|
|
115
115
|
/**
|
|
116
116
|
* How a reported touch was learned:
|
|
117
117
|
* - survey: the user answered "how did you hear about us" (onboarding, checkout)
|
|
@@ -119,8 +119,8 @@ type TouchSource = (typeof TOUCH_SOURCES)[number];
|
|
|
119
119
|
* - phone: a call came in on a channel's dedicated number, marked by staff or the phone system
|
|
120
120
|
* - manual: staff recorded what a customer told them
|
|
121
121
|
*/
|
|
122
|
-
declare const REPORTED_TOUCH_KINDS: readonly ['survey', 'promo_code', 'phone', 'manual'];
|
|
123
|
-
type ReportedTouchKind = (typeof REPORTED_TOUCH_KINDS)[number];
|
|
122
|
+
export declare const REPORTED_TOUCH_KINDS: readonly ['survey', 'promo_code', 'phone', 'manual'];
|
|
123
|
+
export type ReportedTouchKind = (typeof REPORTED_TOUCH_KINDS)[number];
|
|
124
124
|
/**
|
|
125
125
|
* How much a touch is worth against another when attribution has to choose between sessions;
|
|
126
126
|
* lower wins, and the latest wins among equals. Stored on the session when it is classified, so
|
|
@@ -132,7 +132,7 @@ type ReportedTouchKind = (typeof REPORTED_TOUCH_KINDS)[number];
|
|
|
132
132
|
* So two sessions tagged with utm and gclid respectively are equal here (both `campaign`) and the
|
|
133
133
|
* later one is credited, while one session carrying both is named by its utm.
|
|
134
134
|
*/
|
|
135
|
-
declare const TOUCH_PRIORITY: {
|
|
135
|
+
export declare const TOUCH_PRIORITY: {
|
|
136
136
|
/** utm, click id, ad landing page: someone tagged that link (in that order within a session) */
|
|
137
137
|
readonly campaign: 1;
|
|
138
138
|
/** a reported touch staff stand behind: a call on a channel's number, a recorded conversation */
|
|
@@ -143,12 +143,11 @@ declare const TOUCH_PRIORITY: {
|
|
|
143
143
|
readonly claimed: 3;
|
|
144
144
|
};
|
|
145
145
|
/** Which reported kinds are staff facts and which are the user's claims. */
|
|
146
|
-
declare const REPORTED_TOUCH_PRIORITY: {
|
|
146
|
+
export declare const REPORTED_TOUCH_PRIORITY: {
|
|
147
147
|
readonly phone: 1;
|
|
148
148
|
readonly manual: 1;
|
|
149
149
|
readonly survey: 3;
|
|
150
150
|
readonly promo_code: 3;
|
|
151
151
|
};
|
|
152
152
|
//#endregion
|
|
153
|
-
export { AD_LANDING_PAGE, CHANNELS, CHANNEL_GROUPS, CLICK_ID_CHANNELS, Channel, ChannelGroup, DIRECT_CHANNEL, DISPLAY_MEDIUMS, EMAIL_MEDIUM, EMAIL_MEDIUMS, MEDIUM_NOT_SET, META_PLACEMENTS, NO_MEDIUM, PAID_MEDIUM, REFERRERS_NOT_A_TOUCH, REFERRER_SITES, REPORTED_TOUCH_KINDS, REPORTED_TOUCH_PRIORITY, ReferrerMedium, ReportedTouchKind, SOURCE_ALIASES, TOUCH_PRIORITY, TOUCH_SOURCES, TouchSource };
|
|
154
153
|
//# sourceMappingURL=vocabulary.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vocabulary.d.mts","names":[],"sources":["../../src/attribution/vocabulary.ts"],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"vocabulary.d.mts","names":[],"sources":["../../src/attribution/vocabulary.ts"],"mappings":";;;;;;;;qBAUa;;qBAEA;;qBAEA;;qBAGA;;;;;;;;;;;;YA4CD,kBAAkB;;qBAGjB;;;YAiBD,uBAAuB;;qBAGtB;WACP;WACA;WACA;WACC;WACK;WACC;WACL;WACG;WACK;WACH;WACF;WACM;WACI;WACX;WACS;WACJ;WACE;WACC;WACF;WACF;;;;;;;qBAQD;;;;;;qBAwBA,iBAAe;YAEhB;;;;;;;;;qBAUC,qDAAc,uCAAA,mCAAA,mCAAA,oCAAA,iCAAA,qCAAA,mCAAA,iCAAA,iCAAA,oCAAA,kCAAA,kCAAA,wCAAA,2CAAA,uCAAA,4CAAA,uCAAA,wCAAA,wCAAA,uCAAA,uCAAA,qCAAA,kCAAA,yCAAA,uCAAA,uCAAA,0CAAA,yCAAA,uCAAA;;;;;;;;;;;;;qBA6Cd,iCAAqB,QAAA,QAAA,QAAA,QAAA,QAAA,QAAA,QAAA,QAAA,QAAA,QAAA,QAAA,QAAA,QAAA,QAAA,QAAA,QAAA,QAAA,QAAA,QAAA,QAAA,QAAA,QAAA,QAAA;;qBAgCrB,aAAW;;;;;;;;;;;qBAWX;;;;qBA2CA;;qBAEA;;qBAEA,cAAY;;qBAGZ;YACD,sBAAsB;;;;;;;;qBASrB;YACD,4BAA4B;;;;;;;;;;;;qBAa3B;;WAED;;WAEA;;WAEA;;WAED;;;qBAIE"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { SetCookie } from "cookie";
|
|
2
2
|
//#region src/click-id/index.d.ts
|
|
3
|
-
declare const FBC_COOKIE = "_fbc";
|
|
4
|
-
declare const RDT_CID_COOKIE = "_rdt_cid";
|
|
5
|
-
declare const GCL_AW_COOKIE = "_gcl_aw";
|
|
6
|
-
declare const GCL_GB_COOKIE = "_gcl_gb";
|
|
7
|
-
declare const UET_MSCLKID_COOKIE = "_uetmsclkid";
|
|
8
|
-
type ParsedFbc = {
|
|
3
|
+
export declare const FBC_COOKIE = "_fbc";
|
|
4
|
+
export declare const RDT_CID_COOKIE = "_rdt_cid";
|
|
5
|
+
export declare const GCL_AW_COOKIE = "_gcl_aw";
|
|
6
|
+
export declare const GCL_GB_COOKIE = "_gcl_gb";
|
|
7
|
+
export declare const UET_MSCLKID_COOKIE = "_uetmsclkid";
|
|
8
|
+
export type ParsedFbc = {
|
|
9
9
|
raw: string;
|
|
10
10
|
creationTime: number;
|
|
11
11
|
fbclid: string;
|
|
@@ -15,13 +15,13 @@ type ParsedFbc = {
|
|
|
15
15
|
* Returns undefined for anything malformed — a fbclid never contains a dot, but joining the tail
|
|
16
16
|
* back together keeps us forward-compatible if that ever changes.
|
|
17
17
|
*/
|
|
18
|
-
declare function parseFbc(raw: string | undefined | null, now?: number): ParsedFbc | undefined;
|
|
18
|
+
export declare function parseFbc(raw: string | undefined | null, now?: number): ParsedFbc | undefined;
|
|
19
19
|
/**
|
|
20
20
|
* Build a fresh `_fbc` value. subdomainIndex is the cookie's domain level (com=0, example.com=1,
|
|
21
21
|
* www.example.com=2); 1 is correct for an apex-hosted cookie.
|
|
22
22
|
*/
|
|
23
|
-
declare function formatFbc(fbclid: string, now: number, subdomainIndex?: number): string;
|
|
24
|
-
type ParsedGcl = {
|
|
23
|
+
export declare function formatFbc(fbclid: string, now: number, subdomainIndex?: number): string;
|
|
24
|
+
export type ParsedGcl = {
|
|
25
25
|
raw: string;
|
|
26
26
|
creationTime: number;
|
|
27
27
|
clickId: string;
|
|
@@ -32,22 +32,22 @@ type ParsedGcl = {
|
|
|
32
32
|
* validates the segments exactly this way (`/^\d+$/` timestamp, `/^[\w-]+$/` click id); any
|
|
33
33
|
* labels tail is preserved through `raw` so a re-issue stays byte-identical.
|
|
34
34
|
*/
|
|
35
|
-
declare function parseGcl(raw: string | undefined | null, now?: number): ParsedGcl | undefined;
|
|
35
|
+
export declare function parseGcl(raw: string | undefined | null, now?: number): ParsedGcl | undefined;
|
|
36
36
|
/** Build a fresh `_gcl_aw`/`_gcl_gb` value in gtag's own format. */
|
|
37
|
-
declare function formatGcl(clickId: string, now: number): string;
|
|
37
|
+
export declare function formatGcl(clickId: string, now: number): string;
|
|
38
38
|
/**
|
|
39
39
|
* Parse a `_uetmsclkid` value: `_uet<32 hex>`. Returns the click id, lowercased, or undefined
|
|
40
40
|
* for anything bat.js itself would not read back.
|
|
41
41
|
*/
|
|
42
|
-
declare function parseUetMsclkid(raw: string | undefined | null): string | undefined;
|
|
42
|
+
export declare function parseUetMsclkid(raw: string | undefined | null): string | undefined;
|
|
43
43
|
/** Build a `_uetmsclkid` value in bat.js's own format. */
|
|
44
|
-
declare function formatUetMsclkid(clickId: string): string;
|
|
44
|
+
export declare function formatUetMsclkid(clickId: string): string;
|
|
45
45
|
/**
|
|
46
46
|
* The click id as the Conversions API wants it: a dashed, lowercase UUID. The URL and the cookie
|
|
47
47
|
* carry the 32-hex form; a value in any other shape is returned untouched for the API to judge.
|
|
48
48
|
*/
|
|
49
|
-
declare function formatMsclkid(clickId: string): string;
|
|
50
|
-
type ResolveClickIdCookiesInput = {
|
|
49
|
+
export declare function formatMsclkid(clickId: string): string;
|
|
50
|
+
export type ResolveClickIdCookiesInput = {
|
|
51
51
|
/** The absolute request URL (must include the query string). */
|
|
52
52
|
url: string;
|
|
53
53
|
/** The raw `Cookie` request header, if any. */
|
|
@@ -76,7 +76,7 @@ type ResolveClickIdCookiesInput = {
|
|
|
76
76
|
*/
|
|
77
77
|
refresh?: boolean;
|
|
78
78
|
};
|
|
79
|
-
type ResolveClickIdCookiesResult = {
|
|
79
|
+
export type ResolveClickIdCookiesResult = {
|
|
80
80
|
/**
|
|
81
81
|
* Cookies to emit on the response, ready for `Set-Cookie`. Empty when nothing needs to change.
|
|
82
82
|
* A `value: ''`, `maxAge: 0` entry is a deletion (an expired or malformed leftover).
|
|
@@ -103,9 +103,8 @@ type ResolveClickIdCookiesResult = {
|
|
|
103
103
|
* *remaining* lifetime — never `now + 90d` — so a returning visitor's window cannot slide forward
|
|
104
104
|
* (which is what makes Meta flag an expired fbclid).
|
|
105
105
|
*/
|
|
106
|
-
declare function resolveClickIdCookies(input: ResolveClickIdCookiesInput): ResolveClickIdCookiesResult;
|
|
106
|
+
export declare function resolveClickIdCookies(input: ResolveClickIdCookiesInput): ResolveClickIdCookiesResult;
|
|
107
107
|
/** Serialize the resolved cookies into `Set-Cookie` header values. */
|
|
108
|
-
declare function toSetCookieHeaders(cookies: SetCookie[]): string[];
|
|
108
|
+
export declare function toSetCookieHeaders(cookies: SetCookie[]): string[];
|
|
109
109
|
//#endregion
|
|
110
|
-
export { FBC_COOKIE, GCL_AW_COOKIE, GCL_GB_COOKIE, ParsedFbc, ParsedGcl, RDT_CID_COOKIE, ResolveClickIdCookiesInput, ResolveClickIdCookiesResult, UET_MSCLKID_COOKIE, formatFbc, formatGcl, formatMsclkid, formatUetMsclkid, parseFbc, parseGcl, parseUetMsclkid, resolveClickIdCookies, toSetCookieHeaders };
|
|
111
110
|
//# sourceMappingURL=index.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/click-id/index.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/click-id/index.ts"],"mappings":";;qBA2Ca;qBACA;qBACA;qBACA;qBACA;YAED;EAAc;EAAa;EAAsB;;;;;;;wBAO7C,SACd,gCACA,eACC;;;;;wBAmBa,UAAU,gBAAgB,aAAa;YAI3C;EAAc;EAAa;EAAsB;;;;;;;;wBAa7C,SACd,gCACA,eACC;;wBAgBa,UAAU,iBAAiB;;;;;wBAe3B,gBAAgB;;wBAOhB,iBAAiB;;;;;wBAQjB,cAAc;YAMlB;;EAEV;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;;;;;;;;;;;;;;EAeA;;YAGU;;;;;EAKV,SAAS;;EAET;;EAEA;;EAEA;;EAEA;;EAEA;;;;;;;;;;;;wBAuBc,sBACd,OAAO,6BACN;;wBAoHa,mBAAmB,SAAS"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { SetCookie } from "cookie";
|
|
2
2
|
//#region src/click-id/index.d.ts
|
|
3
|
-
declare const FBC_COOKIE = "_fbc";
|
|
4
|
-
declare const RDT_CID_COOKIE = "_rdt_cid";
|
|
5
|
-
declare const GCL_AW_COOKIE = "_gcl_aw";
|
|
6
|
-
declare const GCL_GB_COOKIE = "_gcl_gb";
|
|
7
|
-
declare const UET_MSCLKID_COOKIE = "_uetmsclkid";
|
|
8
|
-
type ParsedFbc = {
|
|
3
|
+
export declare const FBC_COOKIE = "_fbc";
|
|
4
|
+
export declare const RDT_CID_COOKIE = "_rdt_cid";
|
|
5
|
+
export declare const GCL_AW_COOKIE = "_gcl_aw";
|
|
6
|
+
export declare const GCL_GB_COOKIE = "_gcl_gb";
|
|
7
|
+
export declare const UET_MSCLKID_COOKIE = "_uetmsclkid";
|
|
8
|
+
export type ParsedFbc = {
|
|
9
9
|
raw: string;
|
|
10
10
|
creationTime: number;
|
|
11
11
|
fbclid: string;
|
|
@@ -15,13 +15,13 @@ type ParsedFbc = {
|
|
|
15
15
|
* Returns undefined for anything malformed — a fbclid never contains a dot, but joining the tail
|
|
16
16
|
* back together keeps us forward-compatible if that ever changes.
|
|
17
17
|
*/
|
|
18
|
-
declare function parseFbc(raw: string | undefined | null, now?: number): ParsedFbc | undefined;
|
|
18
|
+
export declare function parseFbc(raw: string | undefined | null, now?: number): ParsedFbc | undefined;
|
|
19
19
|
/**
|
|
20
20
|
* Build a fresh `_fbc` value. subdomainIndex is the cookie's domain level (com=0, example.com=1,
|
|
21
21
|
* www.example.com=2); 1 is correct for an apex-hosted cookie.
|
|
22
22
|
*/
|
|
23
|
-
declare function formatFbc(fbclid: string, now: number, subdomainIndex?: number): string;
|
|
24
|
-
type ParsedGcl = {
|
|
23
|
+
export declare function formatFbc(fbclid: string, now: number, subdomainIndex?: number): string;
|
|
24
|
+
export type ParsedGcl = {
|
|
25
25
|
raw: string;
|
|
26
26
|
creationTime: number;
|
|
27
27
|
clickId: string;
|
|
@@ -32,22 +32,22 @@ type ParsedGcl = {
|
|
|
32
32
|
* validates the segments exactly this way (`/^\d+$/` timestamp, `/^[\w-]+$/` click id); any
|
|
33
33
|
* labels tail is preserved through `raw` so a re-issue stays byte-identical.
|
|
34
34
|
*/
|
|
35
|
-
declare function parseGcl(raw: string | undefined | null, now?: number): ParsedGcl | undefined;
|
|
35
|
+
export declare function parseGcl(raw: string | undefined | null, now?: number): ParsedGcl | undefined;
|
|
36
36
|
/** Build a fresh `_gcl_aw`/`_gcl_gb` value in gtag's own format. */
|
|
37
|
-
declare function formatGcl(clickId: string, now: number): string;
|
|
37
|
+
export declare function formatGcl(clickId: string, now: number): string;
|
|
38
38
|
/**
|
|
39
39
|
* Parse a `_uetmsclkid` value: `_uet<32 hex>`. Returns the click id, lowercased, or undefined
|
|
40
40
|
* for anything bat.js itself would not read back.
|
|
41
41
|
*/
|
|
42
|
-
declare function parseUetMsclkid(raw: string | undefined | null): string | undefined;
|
|
42
|
+
export declare function parseUetMsclkid(raw: string | undefined | null): string | undefined;
|
|
43
43
|
/** Build a `_uetmsclkid` value in bat.js's own format. */
|
|
44
|
-
declare function formatUetMsclkid(clickId: string): string;
|
|
44
|
+
export declare function formatUetMsclkid(clickId: string): string;
|
|
45
45
|
/**
|
|
46
46
|
* The click id as the Conversions API wants it: a dashed, lowercase UUID. The URL and the cookie
|
|
47
47
|
* carry the 32-hex form; a value in any other shape is returned untouched for the API to judge.
|
|
48
48
|
*/
|
|
49
|
-
declare function formatMsclkid(clickId: string): string;
|
|
50
|
-
type ResolveClickIdCookiesInput = {
|
|
49
|
+
export declare function formatMsclkid(clickId: string): string;
|
|
50
|
+
export type ResolveClickIdCookiesInput = {
|
|
51
51
|
/** The absolute request URL (must include the query string). */
|
|
52
52
|
url: string;
|
|
53
53
|
/** The raw `Cookie` request header, if any. */
|
|
@@ -76,7 +76,7 @@ type ResolveClickIdCookiesInput = {
|
|
|
76
76
|
*/
|
|
77
77
|
refresh?: boolean;
|
|
78
78
|
};
|
|
79
|
-
type ResolveClickIdCookiesResult = {
|
|
79
|
+
export type ResolveClickIdCookiesResult = {
|
|
80
80
|
/**
|
|
81
81
|
* Cookies to emit on the response, ready for `Set-Cookie`. Empty when nothing needs to change.
|
|
82
82
|
* A `value: ''`, `maxAge: 0` entry is a deletion (an expired or malformed leftover).
|
|
@@ -103,9 +103,8 @@ type ResolveClickIdCookiesResult = {
|
|
|
103
103
|
* *remaining* lifetime — never `now + 90d` — so a returning visitor's window cannot slide forward
|
|
104
104
|
* (which is what makes Meta flag an expired fbclid).
|
|
105
105
|
*/
|
|
106
|
-
declare function resolveClickIdCookies(input: ResolveClickIdCookiesInput): ResolveClickIdCookiesResult;
|
|
106
|
+
export declare function resolveClickIdCookies(input: ResolveClickIdCookiesInput): ResolveClickIdCookiesResult;
|
|
107
107
|
/** Serialize the resolved cookies into `Set-Cookie` header values. */
|
|
108
|
-
declare function toSetCookieHeaders(cookies: SetCookie[]): string[];
|
|
108
|
+
export declare function toSetCookieHeaders(cookies: SetCookie[]): string[];
|
|
109
109
|
//#endregion
|
|
110
|
-
export { FBC_COOKIE, GCL_AW_COOKIE, GCL_GB_COOKIE, ParsedFbc, ParsedGcl, RDT_CID_COOKIE, ResolveClickIdCookiesInput, ResolveClickIdCookiesResult, UET_MSCLKID_COOKIE, formatFbc, formatGcl, formatMsclkid, formatUetMsclkid, parseFbc, parseGcl, parseUetMsclkid, resolveClickIdCookies, toSetCookieHeaders };
|
|
111
110
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/click-id/index.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/click-id/index.ts"],"mappings":";;qBA2Ca;qBACA;qBACA;qBACA;qBACA;YAED;EAAc;EAAa;EAAsB;;;;;;;wBAO7C,SACd,gCACA,eACC;;;;;wBAmBa,UAAU,gBAAgB,aAAa;YAI3C;EAAc;EAAa;EAAsB;;;;;;;;wBAa7C,SACd,gCACA,eACC;;wBAgBa,UAAU,iBAAiB;;;;;wBAe3B,gBAAgB;;wBAOhB,iBAAiB;;;;;wBAQjB,cAAc;YAMlB;;EAEV;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;;;;;;;;;;;;;;EAeA;;YAGU;;;;;EAKV,SAAS;;EAET;;EAEA;;EAEA;;EAEA;;EAEA;;;;;;;;;;;;wBAuBc,sBACd,OAAO,6BACN;;wBAoHa,mBAAmB,SAAS"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/constants/storage.d.ts
|
|
2
|
-
declare const keys: {
|
|
2
|
+
export declare const keys: {
|
|
3
3
|
readonly device_id: 'device_id';
|
|
4
4
|
readonly visitor_id: 'visitor_id';
|
|
5
5
|
readonly first_open_time: 'first_open_time';
|
|
@@ -9,5 +9,4 @@ declare const keys: {
|
|
|
9
9
|
readonly session: 'session';
|
|
10
10
|
};
|
|
11
11
|
//#endregion
|
|
12
|
-
export { keys };
|
|
13
12
|
//# sourceMappingURL=storage.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage.d.cts","names":[],"sources":["../../src/constants/storage.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"storage.d.cts","names":[],"sources":["../../src/constants/storage.ts"],"mappings":";qBAAa;WACX;WACA;WACA;WACA;;WAEA;WACA"}
|