@shware/analytics 3.6.3 → 3.7.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 +50 -3
- package/dist/_virtual/_rolldown/runtime.cjs +23 -0
- package/dist/constants/storage.cjs +12 -37
- package/dist/constants/storage.cjs.map +1 -1
- package/dist/constants/storage.d.cts +10 -8
- package/dist/constants/storage.d.cts.map +1 -0
- package/dist/constants/storage.d.mts +13 -0
- package/dist/constants/storage.d.mts.map +1 -0
- package/dist/constants/storage.mjs +12 -13
- package/dist/constants/storage.mjs.map +1 -1
- package/dist/feedback/index.cjs +14 -40
- package/dist/feedback/index.cjs.map +1 -1
- package/dist/feedback/index.d.cts +4 -4
- package/dist/feedback/index.d.cts.map +1 -0
- package/dist/feedback/index.d.mts +6 -0
- package/dist/feedback/index.d.mts.map +1 -0
- package/dist/feedback/index.mjs +12 -14
- package/dist/feedback/index.mjs.map +1 -1
- package/dist/hooks/use-app-analytics.cjs +46 -65
- package/dist/hooks/use-app-analytics.cjs.map +1 -1
- package/dist/hooks/use-app-analytics.d.cts +3 -1
- package/dist/hooks/use-app-analytics.d.cts.map +1 -0
- package/dist/hooks/use-app-analytics.d.mts +5 -0
- package/dist/hooks/use-app-analytics.d.mts.map +1 -0
- package/dist/hooks/use-app-analytics.mjs +41 -36
- package/dist/hooks/use-app-analytics.mjs.map +1 -1
- package/dist/hooks/use-click-id-persistence.cjs +43 -65
- package/dist/hooks/use-click-id-persistence.cjs.map +1 -1
- package/dist/hooks/use-click-id-persistence.d.cts +3 -1
- package/dist/hooks/use-click-id-persistence.d.cts.map +1 -0
- package/dist/hooks/use-click-id-persistence.d.mts +5 -0
- package/dist/hooks/use-click-id-persistence.d.mts.map +1 -0
- package/dist/hooks/use-click-id-persistence.mjs +40 -38
- package/dist/hooks/use-click-id-persistence.mjs.map +1 -1
- package/dist/hooks/use-outbound-click-analytics.cjs +33 -55
- package/dist/hooks/use-outbound-click-analytics.cjs.map +1 -1
- package/dist/hooks/use-outbound-click-analytics.d.cts +3 -1
- package/dist/hooks/use-outbound-click-analytics.d.cts.map +1 -0
- package/dist/hooks/{use-outbound-click-analytics.d.ts → use-outbound-click-analytics.d.mts} +3 -1
- package/dist/hooks/use-outbound-click-analytics.d.mts.map +1 -0
- package/dist/hooks/use-outbound-click-analytics.mjs +31 -29
- package/dist/hooks/use-outbound-click-analytics.mjs.map +1 -1
- package/dist/hooks/use-previous.cjs +11 -35
- package/dist/hooks/use-previous.cjs.map +1 -1
- package/dist/hooks/use-previous.d.cts +3 -1
- package/dist/hooks/use-previous.d.cts.map +1 -0
- package/dist/hooks/use-previous.d.mts +5 -0
- package/dist/hooks/use-previous.d.mts.map +1 -0
- package/dist/hooks/use-previous.mjs +9 -9
- package/dist/hooks/use-previous.mjs.map +1 -1
- package/dist/hooks/use-track-impression.cjs +24 -51
- package/dist/hooks/use-track-impression.cjs.map +1 -1
- package/dist/hooks/use-track-impression.d.cts +5 -6
- package/dist/hooks/use-track-impression.d.cts.map +1 -0
- package/dist/hooks/use-track-impression.d.mts +6 -0
- package/dist/hooks/use-track-impression.d.mts.map +1 -0
- package/dist/hooks/use-track-impression.mjs +22 -25
- package/dist/hooks/use-track-impression.mjs.map +1 -1
- package/dist/hooks/use-web-analytics.cjs +98 -109
- package/dist/hooks/use-web-analytics.cjs.map +1 -1
- package/dist/hooks/use-web-analytics.d.cts +3 -1
- package/dist/hooks/use-web-analytics.d.cts.map +1 -0
- package/dist/hooks/{use-web-analytics.d.ts → use-web-analytics.d.mts} +3 -1
- package/dist/hooks/use-web-analytics.d.mts.map +1 -0
- package/dist/hooks/use-web-analytics.mjs +93 -80
- package/dist/hooks/use-web-analytics.mjs.map +1 -1
- package/dist/index.cjs +28 -74
- package/dist/index.d.cts +11 -13
- package/dist/index.d.mts +11 -0
- package/dist/index.mjs +3 -34
- package/dist/link/index.cjs +31 -58
- package/dist/link/index.cjs.map +1 -1
- package/dist/link/index.d.cts +7 -7
- package/dist/link/index.d.cts.map +1 -0
- package/dist/link/index.d.mts +11 -0
- package/dist/link/index.d.mts.map +1 -0
- package/dist/link/index.mjs +28 -31
- package/dist/link/index.mjs.map +1 -1
- package/dist/native/fbsdk.cjs +12 -34
- package/dist/native/fbsdk.cjs.map +1 -1
- package/dist/native/fbsdk.d.cts +4 -4
- package/dist/native/fbsdk.d.cts.map +1 -0
- package/dist/native/{fbsdk.d.ts → fbsdk.d.mts} +4 -4
- package/dist/native/fbsdk.d.mts.map +1 -0
- package/dist/native/fbsdk.mjs +10 -8
- package/dist/native/fbsdk.mjs.map +1 -1
- package/dist/native/fingerprint.cjs +41 -64
- package/dist/native/fingerprint.cjs.map +1 -1
- package/dist/native/fingerprint.d.cts +22 -20
- package/dist/native/fingerprint.d.cts.map +1 -0
- package/dist/native/fingerprint.d.mts +28 -0
- package/dist/native/fingerprint.d.mts.map +1 -0
- package/dist/native/fingerprint.mjs +36 -42
- package/dist/native/fingerprint.mjs.map +1 -1
- package/dist/native/firebase.cjs +12 -39
- package/dist/native/firebase.cjs.map +1 -1
- package/dist/native/firebase.d.cts +4 -4
- package/dist/native/firebase.d.cts.map +1 -0
- package/dist/native/firebase.d.mts +6 -0
- package/dist/native/firebase.d.mts.map +1 -0
- package/dist/native/firebase.mjs +10 -13
- package/dist/native/firebase.mjs.map +1 -1
- package/dist/native/index.cjs +11 -45
- package/dist/native/index.d.cts +4 -7
- package/dist/native/index.d.mts +4 -0
- package/dist/native/index.mjs +2 -12
- package/dist/native/posthog.cjs +5 -30
- package/dist/native/posthog.cjs.map +1 -1
- package/dist/native/posthog.d.cts +3 -1
- package/dist/native/posthog.d.cts.map +1 -0
- package/dist/native/posthog.d.mts +5 -0
- package/dist/native/posthog.d.mts.map +1 -0
- package/dist/native/posthog.mjs +5 -6
- package/dist/native/posthog.mjs.map +1 -1
- package/dist/native/setup.cjs +91 -129
- package/dist/native/setup.cjs.map +1 -1
- package/dist/native/setup.d.cts +6 -6
- package/dist/native/setup.d.cts.map +1 -0
- package/dist/native/{setup.d.ts → setup.d.mts} +6 -6
- package/dist/native/setup.d.mts.map +1 -0
- package/dist/native/setup.mjs +83 -105
- package/dist/native/setup.mjs.map +1 -1
- package/dist/next/index.cjs +72 -145
- package/dist/next/index.cjs.map +1 -1
- package/dist/next/index.d.cts +18 -19
- package/dist/next/index.d.cts.map +1 -0
- package/dist/next/index.d.mts +21 -0
- package/dist/next/index.d.mts.map +1 -0
- package/dist/next/index.mjs +65 -107
- package/dist/next/index.mjs.map +1 -1
- package/dist/react-router/index.cjs +80 -144
- package/dist/react-router/index.cjs.map +1 -1
- package/dist/react-router/index.d.cts +18 -19
- package/dist/react-router/index.d.cts.map +1 -0
- package/dist/react-router/index.d.mts +21 -0
- package/dist/react-router/index.d.mts.map +1 -0
- package/dist/react-router/index.mjs +75 -115
- package/dist/react-router/index.mjs.map +1 -1
- package/dist/schema/index.cjs +188 -233
- package/dist/schema/index.cjs.map +1 -1
- package/dist/schema/index.d.cts +236 -235
- package/dist/schema/index.d.cts.map +1 -0
- package/dist/schema/index.d.mts +325 -0
- package/dist/schema/index.d.mts.map +1 -0
- package/dist/schema/index.mjs +178 -222
- package/dist/schema/index.mjs.map +1 -1
- package/dist/server/index.cjs +9 -40
- package/dist/server/index.d.cts +5 -9
- package/dist/server/index.d.mts +5 -0
- package/dist/server/index.mjs +5 -12
- package/dist/server/linkedin-conversions-api.cjs +66 -95
- package/dist/server/linkedin-conversions-api.cjs.map +1 -1
- package/dist/server/linkedin-conversions-api.d.cts +45 -45
- package/dist/server/linkedin-conversions-api.d.cts.map +1 -0
- package/dist/server/linkedin-conversions-api.d.mts +56 -0
- package/dist/server/linkedin-conversions-api.d.mts.map +1 -0
- package/dist/server/linkedin-conversions-api.mjs +63 -68
- package/dist/server/linkedin-conversions-api.mjs.map +1 -1
- package/dist/server/meta-conversions-api.cjs +157 -265
- package/dist/server/meta-conversions-api.cjs.map +1 -1
- package/dist/server/meta-conversions-api.d.cts +8 -9
- package/dist/server/meta-conversions-api.d.cts.map +1 -0
- package/dist/server/meta-conversions-api.d.mts +10 -0
- package/dist/server/meta-conversions-api.d.mts.map +1 -0
- package/dist/server/meta-conversions-api.mjs +151 -243
- package/dist/server/meta-conversions-api.mjs.map +1 -1
- package/dist/server/openai-conversions-api.cjs +69 -96
- package/dist/server/openai-conversions-api.cjs.map +1 -1
- package/dist/server/openai-conversions-api.d.cts +34 -34
- package/dist/server/openai-conversions-api.d.cts.map +1 -0
- package/dist/server/openai-conversions-api.d.mts +47 -0
- package/dist/server/openai-conversions-api.d.mts.map +1 -0
- package/dist/server/openai-conversions-api.mjs +65 -68
- package/dist/server/openai-conversions-api.mjs.map +1 -1
- package/dist/server/reddit-conversions-api.cjs +64 -91
- package/dist/server/reddit-conversions-api.cjs.map +1 -1
- package/dist/server/reddit-conversions-api.d.cts +61 -61
- package/dist/server/reddit-conversions-api.d.cts.map +1 -0
- package/dist/server/reddit-conversions-api.d.mts +75 -0
- package/dist/server/reddit-conversions-api.d.mts.map +1 -0
- package/dist/server/reddit-conversions-api.mjs +59 -62
- package/dist/server/reddit-conversions-api.mjs.map +1 -1
- package/dist/setup/index.cjs +34 -63
- package/dist/setup/index.cjs.map +1 -1
- package/dist/setup/index.d.cts +30 -30
- package/dist/setup/index.d.cts.map +1 -0
- package/dist/setup/index.d.mts +41 -0
- package/dist/setup/index.d.mts.map +1 -0
- package/dist/setup/index.mjs +31 -36
- package/dist/setup/index.mjs.map +1 -1
- package/dist/setup/session.cjs +70 -106
- package/dist/setup/session.cjs.map +1 -1
- package/dist/setup/session.d.cts +26 -24
- package/dist/setup/session.d.cts.map +1 -0
- package/dist/setup/session.d.mts +31 -0
- package/dist/setup/session.d.mts.map +1 -0
- package/dist/setup/session.mjs +68 -80
- package/dist/setup/session.mjs.map +1 -1
- package/dist/tanstack/index.cjs +86 -156
- package/dist/tanstack/index.cjs.map +1 -1
- package/dist/tanstack/index.d.cts +19 -20
- package/dist/tanstack/index.d.cts.map +1 -0
- package/dist/tanstack/index.d.mts +22 -0
- package/dist/tanstack/index.d.mts.map +1 -0
- package/dist/tanstack/index.mjs +81 -127
- package/dist/tanstack/index.mjs.map +1 -1
- package/dist/third-parties/google-analytics.cjs +18 -43
- package/dist/third-parties/google-analytics.cjs.map +1 -1
- package/dist/third-parties/google-analytics.d.cts +7 -7
- package/dist/third-parties/google-analytics.d.cts.map +1 -0
- package/dist/third-parties/google-analytics.d.mts +12 -0
- package/dist/third-parties/google-analytics.d.mts.map +1 -0
- package/dist/third-parties/google-analytics.mjs +16 -17
- package/dist/third-parties/google-analytics.mjs.map +1 -1
- package/dist/third-parties/ignored-events.cjs +35 -68
- package/dist/third-parties/ignored-events.cjs.map +1 -1
- package/dist/third-parties/ignored-events.d.cts +3 -1
- package/dist/third-parties/ignored-events.d.cts.map +1 -0
- package/dist/third-parties/ignored-events.d.mts +5 -0
- package/dist/third-parties/ignored-events.d.mts.map +1 -0
- package/dist/third-parties/ignored-events.mjs +34 -43
- package/dist/third-parties/ignored-events.mjs.map +1 -1
- package/dist/third-parties/index.cjs +16 -53
- package/dist/third-parties/index.d.cts +6 -12
- package/dist/third-parties/index.d.mts +6 -0
- package/dist/third-parties/index.mjs +1 -14
- package/dist/third-parties/linkedin-insight-tag.cjs +28 -50
- package/dist/third-parties/linkedin-insight-tag.cjs.map +1 -1
- package/dist/third-parties/linkedin-insight-tag.d.cts +8 -9
- package/dist/third-parties/linkedin-insight-tag.d.cts.map +1 -0
- package/dist/third-parties/{linkedin-insight-tag.d.ts → linkedin-insight-tag.d.mts} +8 -9
- package/dist/third-parties/linkedin-insight-tag.d.mts.map +1 -0
- package/dist/third-parties/linkedin-insight-tag.mjs +25 -23
- package/dist/third-parties/linkedin-insight-tag.mjs.map +1 -1
- package/dist/third-parties/meta-pixel.cjs +45 -66
- package/dist/third-parties/meta-pixel.cjs.map +1 -1
- package/dist/third-parties/meta-pixel.d.cts +7 -8
- package/dist/third-parties/meta-pixel.d.cts.map +1 -0
- package/dist/third-parties/meta-pixel.d.mts +12 -0
- package/dist/third-parties/meta-pixel.d.mts.map +1 -0
- package/dist/third-parties/meta-pixel.mjs +41 -38
- package/dist/third-parties/meta-pixel.mjs.map +1 -1
- package/dist/third-parties/openai-pixel.cjs +63 -68
- package/dist/third-parties/openai-pixel.cjs.map +1 -1
- package/dist/third-parties/openai-pixel.d.cts +7 -8
- package/dist/third-parties/openai-pixel.d.cts.map +1 -0
- package/dist/third-parties/{openai-pixel.d.ts → openai-pixel.d.mts} +7 -8
- package/dist/third-parties/openai-pixel.d.mts.map +1 -0
- package/dist/third-parties/openai-pixel.mjs +60 -41
- package/dist/third-parties/openai-pixel.mjs.map +1 -1
- package/dist/third-parties/posthog.cjs +23 -43
- package/dist/third-parties/posthog.cjs.map +1 -1
- package/dist/third-parties/posthog.d.cts +5 -5
- package/dist/third-parties/posthog.d.cts.map +1 -0
- package/dist/third-parties/{posthog.d.ts → posthog.d.mts} +5 -5
- package/dist/third-parties/posthog.d.mts.map +1 -0
- package/dist/third-parties/posthog.mjs +20 -16
- package/dist/third-parties/posthog.mjs.map +1 -1
- package/dist/third-parties/reddit-pixel.cjs +37 -58
- package/dist/third-parties/reddit-pixel.cjs.map +1 -1
- package/dist/third-parties/reddit-pixel.d.cts +7 -8
- package/dist/third-parties/reddit-pixel.d.cts.map +1 -0
- package/dist/third-parties/reddit-pixel.d.mts +12 -0
- package/dist/third-parties/reddit-pixel.d.mts.map +1 -0
- package/dist/third-parties/reddit-pixel.mjs +33 -30
- package/dist/third-parties/reddit-pixel.mjs.map +1 -1
- package/dist/track/fbq.cjs +179 -135
- package/dist/track/fbq.cjs.map +1 -1
- package/dist/track/fbq.d.cts +234 -233
- package/dist/track/fbq.d.cts.map +1 -0
- package/dist/track/fbq.d.mts +280 -0
- package/dist/track/fbq.d.mts.map +1 -0
- package/dist/track/fbq.mjs +176 -108
- package/dist/track/fbq.mjs.map +1 -1
- package/dist/track/gtag.cjs +63 -86
- package/dist/track/gtag.cjs.map +1 -1
- package/dist/track/gtag.d.cts +685 -685
- package/dist/track/gtag.d.cts.map +1 -0
- package/dist/track/gtag.d.mts +762 -0
- package/dist/track/gtag.d.mts.map +1 -0
- package/dist/track/gtag.mjs +62 -61
- package/dist/track/gtag.mjs.map +1 -1
- package/dist/track/index.cjs +111 -136
- package/dist/track/index.cjs.map +1 -1
- package/dist/track/index.d.cts +8 -8
- package/dist/track/index.d.cts.map +1 -0
- package/dist/track/{index.d.ts → index.d.mts} +8 -8
- package/dist/track/index.d.mts.map +1 -0
- package/dist/track/index.mjs +105 -106
- package/dist/track/index.mjs.map +1 -1
- package/dist/track/lintrk.cjs +0 -19
- package/dist/track/lintrk.d.cts +12 -10
- package/dist/track/lintrk.d.cts.map +1 -0
- package/dist/track/lintrk.d.mts +14 -0
- package/dist/track/lintrk.d.mts.map +1 -0
- package/dist/track/lintrk.mjs +1 -1
- package/dist/track/oaiq.cjs +153 -146
- package/dist/track/oaiq.cjs.map +1 -1
- package/dist/track/oaiq.d.cts +65 -64
- package/dist/track/oaiq.d.cts.map +1 -0
- package/dist/track/oaiq.d.mts +112 -0
- package/dist/track/oaiq.d.mts.map +1 -0
- package/dist/track/oaiq.mjs +149 -118
- package/dist/track/oaiq.mjs.map +1 -1
- package/dist/track/rdt.cjs +66 -110
- package/dist/track/rdt.cjs.map +1 -1
- package/dist/track/rdt.d.cts +74 -73
- package/dist/track/rdt.d.cts.map +1 -0
- package/dist/track/rdt.d.mts +97 -0
- package/dist/track/rdt.d.mts.map +1 -0
- package/dist/track/rdt.mjs +63 -83
- package/dist/track/rdt.mjs.map +1 -1
- package/dist/track/types.cjs +0 -19
- package/dist/track/types.d.cts +140 -111
- package/dist/track/types.d.cts.map +1 -0
- package/dist/track/types.d.mts +171 -0
- package/dist/track/types.d.mts.map +1 -0
- package/dist/track/types.mjs +1 -1
- package/dist/utils/field.cjs +8 -32
- package/dist/utils/field.cjs.map +1 -1
- package/dist/utils/field.d.cts +3 -1
- package/dist/utils/field.d.cts.map +1 -0
- package/dist/utils/{field.d.ts → field.d.mts} +3 -1
- package/dist/utils/field.d.mts.map +1 -0
- package/dist/utils/field.mjs +7 -7
- package/dist/utils/field.mjs.map +1 -1
- package/dist/utils/stripe.cjs +25 -49
- package/dist/utils/stripe.cjs.map +1 -1
- package/dist/utils/stripe.d.cts +3 -1
- package/dist/utils/stripe.d.cts.map +1 -0
- package/dist/utils/{stripe.d.ts → stripe.d.mts} +3 -1
- package/dist/utils/stripe.d.mts.map +1 -0
- package/dist/utils/stripe.mjs +23 -23
- package/dist/utils/stripe.mjs.map +1 -1
- package/dist/visitor/index.cjs +54 -86
- package/dist/visitor/index.cjs.map +1 -1
- package/dist/visitor/index.d.cts +4 -5
- package/dist/visitor/index.d.cts.map +1 -0
- package/dist/visitor/{index.d.ts → index.d.mts} +4 -5
- package/dist/visitor/index.d.mts.map +1 -0
- package/dist/visitor/index.mjs +51 -59
- package/dist/visitor/index.mjs.map +1 -1
- package/dist/visitor/types.cjs +0 -19
- package/dist/visitor/types.d.cts +15 -14
- package/dist/visitor/types.d.cts.map +1 -0
- package/dist/visitor/types.d.mts +21 -0
- package/dist/visitor/types.d.mts.map +1 -0
- package/dist/visitor/types.mjs +1 -1
- package/dist/web/index.cjs +108 -148
- package/dist/web/index.cjs.map +1 -1
- package/dist/web/index.d.cts +5 -6
- package/dist/web/index.d.cts.map +1 -0
- package/dist/web/index.d.mts +9 -0
- package/dist/web/index.d.mts.map +1 -0
- package/dist/web/index.mjs +101 -109
- package/dist/web/index.mjs.map +1 -1
- package/package.json +103 -50
- package/dist/constants/storage.d.ts +0 -11
- package/dist/feedback/index.d.ts +0 -6
- package/dist/hooks/use-app-analytics.d.ts +0 -3
- package/dist/hooks/use-click-id-persistence.d.ts +0 -3
- package/dist/hooks/use-previous.d.ts +0 -3
- package/dist/hooks/use-track-impression.d.ts +0 -7
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.ts +0 -13
- package/dist/index.mjs.map +0 -1
- package/dist/link/index.d.ts +0 -11
- package/dist/native/fingerprint.d.ts +0 -26
- package/dist/native/firebase.d.ts +0 -6
- package/dist/native/index.cjs.map +0 -1
- package/dist/native/index.d.ts +0 -7
- package/dist/native/index.mjs.map +0 -1
- package/dist/native/posthog.d.ts +0 -3
- package/dist/next/index.d.ts +0 -22
- package/dist/react-router/index.d.ts +0 -22
- package/dist/schema/index.d.ts +0 -324
- package/dist/server/index.cjs.map +0 -1
- package/dist/server/index.d.ts +0 -9
- package/dist/server/index.mjs.map +0 -1
- package/dist/server/linkedin-conversions-api.d.ts +0 -56
- package/dist/server/meta-conversions-api.d.ts +0 -11
- package/dist/server/openai-conversions-api.d.ts +0 -47
- package/dist/server/reddit-conversions-api.d.ts +0 -75
- package/dist/setup/index.d.ts +0 -41
- package/dist/setup/session.d.ts +0 -29
- package/dist/tanstack/index.d.ts +0 -23
- package/dist/third-parties/google-analytics.d.ts +0 -12
- package/dist/third-parties/ignored-events.d.ts +0 -3
- package/dist/third-parties/index.cjs.map +0 -1
- package/dist/third-parties/index.d.ts +0 -12
- package/dist/third-parties/index.mjs.map +0 -1
- package/dist/third-parties/meta-pixel.d.ts +0 -13
- package/dist/third-parties/reddit-pixel.d.ts +0 -13
- package/dist/track/fbq.d.ts +0 -279
- package/dist/track/gtag.d.ts +0 -762
- package/dist/track/lintrk.cjs.map +0 -1
- package/dist/track/lintrk.d.ts +0 -12
- package/dist/track/lintrk.mjs.map +0 -1
- package/dist/track/oaiq.d.ts +0 -111
- package/dist/track/rdt.d.ts +0 -96
- package/dist/track/types.cjs.map +0 -1
- package/dist/track/types.d.ts +0 -142
- package/dist/track/types.mjs.map +0 -1
- package/dist/visitor/types.cjs.map +0 -1
- package/dist/visitor/types.d.ts +0 -20
- package/dist/visitor/types.mjs.map +0 -1
- package/dist/web/index.d.ts +0 -10
package/dist/track/types.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { StandardEvents, UserProvidedData as UserProvidedData$1 } from
|
|
2
|
-
|
|
1
|
+
import { StandardEvents, UserProvidedData as UserProvidedData$1 } from "./gtag.cjs";
|
|
2
|
+
//#region src/track/types.d.ts
|
|
3
3
|
type AllowedPropertyValues = string | number | boolean | null;
|
|
4
4
|
type EventName = Lowercase<string> | 'CLS' | 'FCP' | 'INP' | 'LCP' | 'TTFB';
|
|
5
5
|
type TrackName<T extends EventName = EventName> = T extends keyof StandardEvents ? T : EventName;
|
|
@@ -7,136 +7,165 @@ type TrackProperties<T extends EventName = EventName> = T extends keyof Standard
|
|
|
7
7
|
type Platform = 'ios' | 'android' | 'web' | 'macos' | 'windows' | 'linux' | 'unknown';
|
|
8
8
|
type Environment = 'development' | 'production';
|
|
9
9
|
interface UserData {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
10
|
+
userId: string;
|
|
11
|
+
email?: string;
|
|
12
|
+
firstName?: string;
|
|
13
|
+
lastName?: string;
|
|
14
|
+
phone?: string;
|
|
15
|
+
dateOfBirth?: string;
|
|
16
|
+
gender?: string;
|
|
17
|
+
city?: string;
|
|
18
|
+
state?: string;
|
|
19
|
+
postal?: string;
|
|
20
|
+
country?: string;
|
|
21
21
|
}
|
|
22
22
|
interface UserProvidedData extends UserProvidedData$1 {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
23
|
+
user_id?: string;
|
|
24
|
+
ip_address?: string;
|
|
25
|
+
user_agent?: string;
|
|
26
|
+
gender?: 'female' | 'male';
|
|
27
|
+
birthday?: {
|
|
28
|
+
year: number;
|
|
29
|
+
month: number;
|
|
30
|
+
day: number;
|
|
31
|
+
};
|
|
32
|
+
fb_login_id?: string;
|
|
33
|
+
fb_page_id?: string;
|
|
34
34
|
}
|
|
35
35
|
type ThirdPartyTracker = <T extends EventName>(name: TrackName<T>, properties?: TrackProperties<T>, event_id?: string) => void;
|
|
36
36
|
interface PlatformInfo {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
37
|
+
os?: string;
|
|
38
|
+
os_name?: string;
|
|
39
|
+
os_version?: string;
|
|
40
|
+
browser?: string;
|
|
41
|
+
browser_name?: string;
|
|
42
|
+
browser_version?: string;
|
|
43
|
+
/** @deprecated */
|
|
44
|
+
platform: Platform;
|
|
45
45
|
}
|
|
46
46
|
interface DeviceInfo {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
47
|
+
device?: string;
|
|
48
|
+
device_id?: string;
|
|
49
|
+
device_type?: string;
|
|
50
|
+
device_vendor?: string;
|
|
51
|
+
device_model_id?: string;
|
|
52
|
+
device_pixel_ratio?: number;
|
|
53
|
+
screen_width?: number;
|
|
54
|
+
screen_height?: number;
|
|
55
|
+
screen_resolution?: `${number}x${number}`;
|
|
56
56
|
}
|
|
57
57
|
interface AppInfo {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
/** iOS: IDFA, Android: Android Advertising ID */
|
|
59
|
+
advertising_id?: string;
|
|
60
|
+
install_referrer?: string;
|
|
61
61
|
}
|
|
62
62
|
interface EnvironmentInfo {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
63
|
+
release?: string;
|
|
64
|
+
language?: string;
|
|
65
|
+
time_zone?: string;
|
|
66
|
+
/** @deprecated */
|
|
67
|
+
environment: Environment;
|
|
68
68
|
}
|
|
69
69
|
interface SourceInfo {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
source_url?: string;
|
|
71
|
+
source?: 'app' | 'web' | 'offline';
|
|
72
|
+
page_referrer?: string;
|
|
73
73
|
}
|
|
74
74
|
interface AdvertisingInfo {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
75
|
+
/**
|
|
76
|
+
* Meta pixel fields
|
|
77
|
+
* ref: https://developers.facebook.com/docs/marketing-api/conversions-api/parameters/customer-information-parameters#fbc
|
|
78
|
+
* Stored in the _fbc/_fbp browser cookie under your domain
|
|
79
|
+
* ref: https://www.facebook.com/business/help/2360940870872492?checkpoint_src=any
|
|
80
|
+
*/
|
|
81
|
+
fbc?: string;
|
|
82
|
+
fbp?: string;
|
|
83
|
+
fbclid?: string;
|
|
84
|
+
ad_id?: string;
|
|
85
|
+
ad_name?: string;
|
|
86
|
+
adset_id?: string;
|
|
87
|
+
adset_name?: string;
|
|
88
|
+
campaign_id?: string;
|
|
89
|
+
campaign_name?: string;
|
|
90
|
+
placement?: string;
|
|
91
|
+
site_source_name?: string;
|
|
92
|
+
/** Google Analytics fields */
|
|
93
|
+
gclid?: string;
|
|
94
|
+
gclsrc?: string;
|
|
95
|
+
gad_source?: string;
|
|
96
|
+
gad_campaignid?: string;
|
|
97
|
+
/** Reddit Ads fields */
|
|
98
|
+
rdt_cid?: string;
|
|
99
|
+
rdt_uuid?: string;
|
|
100
|
+
/** LinkedIn Ads fields: get click id from url params or first-party cookie */
|
|
101
|
+
li_fat_id?: string;
|
|
102
|
+
dclid?: string;
|
|
103
|
+
ko_click_id?: string;
|
|
104
|
+
msclkid?: string;
|
|
105
|
+
sccid?: string;
|
|
106
|
+
ttclid?: string;
|
|
107
|
+
twclid?: string;
|
|
108
|
+
wbraid?: string;
|
|
109
|
+
yclid?: string;
|
|
110
110
|
}
|
|
111
|
+
/**
|
|
112
|
+
* UTM campaign parameters.
|
|
113
|
+
* Value unions follow GA4 default channel group definitions:
|
|
114
|
+
* https://support.google.com/analytics/answer/9756891
|
|
115
|
+
*/
|
|
111
116
|
interface UTMParams {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
117
|
+
/** Referrer of the traffic, matched against GA4 source lists (search/social/video/shopping sites) */
|
|
118
|
+
utm_source?: 'google' | 'bing' | 'baidu' | 'duckduckgo' | 'yahoo' | 'yandex' | 'meta' | 'facebook' | 'instagram' | 'twitter' | 'x' | 'linkedin' | 'tiktok' | 'pinterest' | 'reddit' | 'snapchat' | 'youtube' | 'vimeo' | 'twitch' | 'newsletter' | 'email' | 'sms' | 'firebase' | '(direct)' | (string & {});
|
|
119
|
+
/**
|
|
120
|
+
* Marketing medium, the primary input for GA4 channel classification:
|
|
121
|
+
* - Paid *: `^(.*cp.*|ppc|retargeting|paid.*)$`
|
|
122
|
+
* - Display: `^(display|banner|expandable|interstitial|cpm)$`
|
|
123
|
+
* - Organic Social: `^(social|social-network|social-media|sm|social network|social media)$`
|
|
124
|
+
* - Organic Video: `^(.*video.*)$`
|
|
125
|
+
* - Organic Search: `organic`
|
|
126
|
+
* - Referral: `^(referral|app|link)$`
|
|
127
|
+
* - Email: `email|e-mail|e_mail|e mail`
|
|
128
|
+
* - Mobile Push: `^(.*(mobile|notification).*|push$)`
|
|
129
|
+
*/
|
|
130
|
+
utm_medium?: 'cpc' | 'cpm' | 'cpv' | 'cpa' | 'ppc' | 'retargeting' | `${string}cp${string}` | `paid${string}` | 'display' | 'banner' | 'expandable' | 'interstitial' | 'social' | 'social-network' | 'social-media' | 'sm' | 'social network' | 'social media' | 'video' | `${string}video${string}` | 'organic' | 'referral' | 'app' | 'link' | 'email' | 'e-mail' | 'e_mail' | 'e mail' | 'affiliate' | 'audio' | 'sms' | `${string}push` | `${string}mobile${string}` | `${string}notification${string}` | '(none)' | '(not set)' | (string & {});
|
|
131
|
+
/**
|
|
132
|
+
* Campaign name. GA4 special cases:
|
|
133
|
+
* - Cross-network: contains "cross-network"
|
|
134
|
+
* - Shopping: `^(.*(([^a-df-z]|^)shop|shopping).*)$`
|
|
135
|
+
*/
|
|
136
|
+
utm_campaign?: `${string}cross-network${string}` | `${string}shop${string}` | `${string}shopping${string}` | (string & {});
|
|
137
|
+
/** Paid keyword of the campaign */
|
|
138
|
+
utm_term?: string;
|
|
139
|
+
/** Used to differentiate creatives/links pointing to the same URL */
|
|
140
|
+
utm_content?: string;
|
|
141
|
+
/** Campaign ID (maps to the GA4 "campaign id" dimension) */
|
|
142
|
+
utm_id?: string;
|
|
143
|
+
/** Platform responsible for directing the traffic */
|
|
144
|
+
utm_source_platform?: 'Manual' | 'Google Ads' | 'DV360' | 'CM360' | 'SA360' | 'SFMC' | 'Shopping Free Listings' | (string & {});
|
|
145
|
+
/** Type of the creative */
|
|
146
|
+
utm_creative_format?: 'display' | 'native' | 'video' | 'search' | (string & {});
|
|
147
|
+
/** Targeting criteria applied to the campaign */
|
|
148
|
+
utm_marketing_tactic?: 'remarketing' | 'prospecting' | (string & {});
|
|
121
149
|
}
|
|
122
150
|
interface TrackTags extends PlatformInfo, DeviceInfo, AppInfo, EnvironmentInfo, SourceInfo, AdvertisingInfo, UTMParams {
|
|
123
|
-
|
|
124
|
-
|
|
151
|
+
idempotency_key?: string;
|
|
152
|
+
[key: string]: string | number | boolean | null | undefined;
|
|
125
153
|
}
|
|
126
154
|
interface TrackEvent<T extends EventName = EventName> {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
155
|
+
id: string;
|
|
156
|
+
name: TrackName<T>;
|
|
157
|
+
tags: TrackTags;
|
|
158
|
+
visitor_id: string;
|
|
159
|
+
session_id: string;
|
|
160
|
+
platform: Platform;
|
|
161
|
+
environment: Environment;
|
|
162
|
+
properties?: TrackProperties<T>;
|
|
163
|
+
created_at: string;
|
|
136
164
|
}
|
|
137
165
|
type TrackEventResponse = {
|
|
138
|
-
|
|
139
|
-
|
|
166
|
+
/** track event id: Meta Pixel will use event_id and event_name for deduplication */
|
|
167
|
+
id: string;
|
|
140
168
|
}[];
|
|
141
|
-
|
|
142
|
-
export
|
|
169
|
+
//#endregion
|
|
170
|
+
export { AdvertisingInfo, AllowedPropertyValues, AppInfo, DeviceInfo, Environment, EnvironmentInfo, EventName, Platform, PlatformInfo, SourceInfo, ThirdPartyTracker, TrackEvent, TrackEventResponse, TrackName, TrackProperties, TrackTags, UTMParams, UserData, UserProvidedData };
|
|
171
|
+
//# sourceMappingURL=types.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.cts","names":[],"sources":["../../src/track/types.ts"],"mappings":";;KAEY;KACA,YAAY;KAEZ,UAAU,UAAU,YAAY,aAAa,gBAAgB,iBACrE,IACA;KACQ,gBAAgB,UAAU,YAAY,aAAa,gBAAgB,iBAC3E,eAAe,KACf,OAAO,mBAAmB;KAElB;KACA;UAEK;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe,yBAAyB;EACxC;EACA;EACA;EACA;EACA;IAAa;IAAc;IAAe;;EAE1C;EACA;;KAGU,qBAAqB,UAAU,WACzC,MAAM,UAAU,IAChB,aAAa,gBAAgB,IAC7B;UAGe;EACf;EACA;EACA;EACA;EACA;EACA;;EAEA,UAAU;;UAGK;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;;EAEf;EACA;;UAGe;EACf;EACA;EACA;;EAEA,aAAa;;UAGE;EACf;EACA;EACA;;UAGe;;;;;;;EAOf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EAEA;EACA;EACA;EACA;;EAEA;EACA;;EAEA;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;;;;;UAQe;;EAEf;;;;;;;;;;;;EAqCA;;;;;;EAuDA;;EAMA;;EAEA;;EAEA;;EAEA;;EAUA;;EAEA;;UAGe,kBAEb,cACA,YACA,SACA,iBACA,YACA,iBACA;EACF;GACC;;UAGc,WAAW,UAAU,YAAY;EAChD;EACA,MAAM,UAAU;EAChB,MAAM;EACN;EACA;EACA,UAAU;EACV,aAAa;EACb,aAAa,gBAAgB;EAC7B;;KAGU;;EAEV"}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { StandardEvents, UserProvidedData as UserProvidedData$1 } from "./gtag.mjs";
|
|
2
|
+
//#region src/track/types.d.ts
|
|
3
|
+
type AllowedPropertyValues = string | number | boolean | null;
|
|
4
|
+
type EventName = Lowercase<string> | 'CLS' | 'FCP' | 'INP' | 'LCP' | 'TTFB';
|
|
5
|
+
type TrackName<T extends EventName = EventName> = T extends keyof StandardEvents ? T : EventName;
|
|
6
|
+
type TrackProperties<T extends EventName = EventName> = T extends keyof StandardEvents ? StandardEvents[T] : Record<Lowercase<string>, AllowedPropertyValues>;
|
|
7
|
+
type Platform = 'ios' | 'android' | 'web' | 'macos' | 'windows' | 'linux' | 'unknown';
|
|
8
|
+
type Environment = 'development' | 'production';
|
|
9
|
+
interface UserData {
|
|
10
|
+
userId: string;
|
|
11
|
+
email?: string;
|
|
12
|
+
firstName?: string;
|
|
13
|
+
lastName?: string;
|
|
14
|
+
phone?: string;
|
|
15
|
+
dateOfBirth?: string;
|
|
16
|
+
gender?: string;
|
|
17
|
+
city?: string;
|
|
18
|
+
state?: string;
|
|
19
|
+
postal?: string;
|
|
20
|
+
country?: string;
|
|
21
|
+
}
|
|
22
|
+
interface UserProvidedData extends UserProvidedData$1 {
|
|
23
|
+
user_id?: string;
|
|
24
|
+
ip_address?: string;
|
|
25
|
+
user_agent?: string;
|
|
26
|
+
gender?: 'female' | 'male';
|
|
27
|
+
birthday?: {
|
|
28
|
+
year: number;
|
|
29
|
+
month: number;
|
|
30
|
+
day: number;
|
|
31
|
+
};
|
|
32
|
+
fb_login_id?: string;
|
|
33
|
+
fb_page_id?: string;
|
|
34
|
+
}
|
|
35
|
+
type ThirdPartyTracker = <T extends EventName>(name: TrackName<T>, properties?: TrackProperties<T>, event_id?: string) => void;
|
|
36
|
+
interface PlatformInfo {
|
|
37
|
+
os?: string;
|
|
38
|
+
os_name?: string;
|
|
39
|
+
os_version?: string;
|
|
40
|
+
browser?: string;
|
|
41
|
+
browser_name?: string;
|
|
42
|
+
browser_version?: string;
|
|
43
|
+
/** @deprecated */
|
|
44
|
+
platform: Platform;
|
|
45
|
+
}
|
|
46
|
+
interface DeviceInfo {
|
|
47
|
+
device?: string;
|
|
48
|
+
device_id?: string;
|
|
49
|
+
device_type?: string;
|
|
50
|
+
device_vendor?: string;
|
|
51
|
+
device_model_id?: string;
|
|
52
|
+
device_pixel_ratio?: number;
|
|
53
|
+
screen_width?: number;
|
|
54
|
+
screen_height?: number;
|
|
55
|
+
screen_resolution?: `${number}x${number}`;
|
|
56
|
+
}
|
|
57
|
+
interface AppInfo {
|
|
58
|
+
/** iOS: IDFA, Android: Android Advertising ID */
|
|
59
|
+
advertising_id?: string;
|
|
60
|
+
install_referrer?: string;
|
|
61
|
+
}
|
|
62
|
+
interface EnvironmentInfo {
|
|
63
|
+
release?: string;
|
|
64
|
+
language?: string;
|
|
65
|
+
time_zone?: string;
|
|
66
|
+
/** @deprecated */
|
|
67
|
+
environment: Environment;
|
|
68
|
+
}
|
|
69
|
+
interface SourceInfo {
|
|
70
|
+
source_url?: string;
|
|
71
|
+
source?: 'app' | 'web' | 'offline';
|
|
72
|
+
page_referrer?: string;
|
|
73
|
+
}
|
|
74
|
+
interface AdvertisingInfo {
|
|
75
|
+
/**
|
|
76
|
+
* Meta pixel fields
|
|
77
|
+
* ref: https://developers.facebook.com/docs/marketing-api/conversions-api/parameters/customer-information-parameters#fbc
|
|
78
|
+
* Stored in the _fbc/_fbp browser cookie under your domain
|
|
79
|
+
* ref: https://www.facebook.com/business/help/2360940870872492?checkpoint_src=any
|
|
80
|
+
*/
|
|
81
|
+
fbc?: string;
|
|
82
|
+
fbp?: string;
|
|
83
|
+
fbclid?: string;
|
|
84
|
+
ad_id?: string;
|
|
85
|
+
ad_name?: string;
|
|
86
|
+
adset_id?: string;
|
|
87
|
+
adset_name?: string;
|
|
88
|
+
campaign_id?: string;
|
|
89
|
+
campaign_name?: string;
|
|
90
|
+
placement?: string;
|
|
91
|
+
site_source_name?: string;
|
|
92
|
+
/** Google Analytics fields */
|
|
93
|
+
gclid?: string;
|
|
94
|
+
gclsrc?: string;
|
|
95
|
+
gad_source?: string;
|
|
96
|
+
gad_campaignid?: string;
|
|
97
|
+
/** Reddit Ads fields */
|
|
98
|
+
rdt_cid?: string;
|
|
99
|
+
rdt_uuid?: string;
|
|
100
|
+
/** LinkedIn Ads fields: get click id from url params or first-party cookie */
|
|
101
|
+
li_fat_id?: string;
|
|
102
|
+
dclid?: string;
|
|
103
|
+
ko_click_id?: string;
|
|
104
|
+
msclkid?: string;
|
|
105
|
+
sccid?: string;
|
|
106
|
+
ttclid?: string;
|
|
107
|
+
twclid?: string;
|
|
108
|
+
wbraid?: string;
|
|
109
|
+
yclid?: string;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* UTM campaign parameters.
|
|
113
|
+
* Value unions follow GA4 default channel group definitions:
|
|
114
|
+
* https://support.google.com/analytics/answer/9756891
|
|
115
|
+
*/
|
|
116
|
+
interface UTMParams {
|
|
117
|
+
/** Referrer of the traffic, matched against GA4 source lists (search/social/video/shopping sites) */
|
|
118
|
+
utm_source?: 'google' | 'bing' | 'baidu' | 'duckduckgo' | 'yahoo' | 'yandex' | 'meta' | 'facebook' | 'instagram' | 'twitter' | 'x' | 'linkedin' | 'tiktok' | 'pinterest' | 'reddit' | 'snapchat' | 'youtube' | 'vimeo' | 'twitch' | 'newsletter' | 'email' | 'sms' | 'firebase' | '(direct)' | (string & {});
|
|
119
|
+
/**
|
|
120
|
+
* Marketing medium, the primary input for GA4 channel classification:
|
|
121
|
+
* - Paid *: `^(.*cp.*|ppc|retargeting|paid.*)$`
|
|
122
|
+
* - Display: `^(display|banner|expandable|interstitial|cpm)$`
|
|
123
|
+
* - Organic Social: `^(social|social-network|social-media|sm|social network|social media)$`
|
|
124
|
+
* - Organic Video: `^(.*video.*)$`
|
|
125
|
+
* - Organic Search: `organic`
|
|
126
|
+
* - Referral: `^(referral|app|link)$`
|
|
127
|
+
* - Email: `email|e-mail|e_mail|e mail`
|
|
128
|
+
* - Mobile Push: `^(.*(mobile|notification).*|push$)`
|
|
129
|
+
*/
|
|
130
|
+
utm_medium?: 'cpc' | 'cpm' | 'cpv' | 'cpa' | 'ppc' | 'retargeting' | `${string}cp${string}` | `paid${string}` | 'display' | 'banner' | 'expandable' | 'interstitial' | 'social' | 'social-network' | 'social-media' | 'sm' | 'social network' | 'social media' | 'video' | `${string}video${string}` | 'organic' | 'referral' | 'app' | 'link' | 'email' | 'e-mail' | 'e_mail' | 'e mail' | 'affiliate' | 'audio' | 'sms' | `${string}push` | `${string}mobile${string}` | `${string}notification${string}` | '(none)' | '(not set)' | (string & {});
|
|
131
|
+
/**
|
|
132
|
+
* Campaign name. GA4 special cases:
|
|
133
|
+
* - Cross-network: contains "cross-network"
|
|
134
|
+
* - Shopping: `^(.*(([^a-df-z]|^)shop|shopping).*)$`
|
|
135
|
+
*/
|
|
136
|
+
utm_campaign?: `${string}cross-network${string}` | `${string}shop${string}` | `${string}shopping${string}` | (string & {});
|
|
137
|
+
/** Paid keyword of the campaign */
|
|
138
|
+
utm_term?: string;
|
|
139
|
+
/** Used to differentiate creatives/links pointing to the same URL */
|
|
140
|
+
utm_content?: string;
|
|
141
|
+
/** Campaign ID (maps to the GA4 "campaign id" dimension) */
|
|
142
|
+
utm_id?: string;
|
|
143
|
+
/** Platform responsible for directing the traffic */
|
|
144
|
+
utm_source_platform?: 'Manual' | 'Google Ads' | 'DV360' | 'CM360' | 'SA360' | 'SFMC' | 'Shopping Free Listings' | (string & {});
|
|
145
|
+
/** Type of the creative */
|
|
146
|
+
utm_creative_format?: 'display' | 'native' | 'video' | 'search' | (string & {});
|
|
147
|
+
/** Targeting criteria applied to the campaign */
|
|
148
|
+
utm_marketing_tactic?: 'remarketing' | 'prospecting' | (string & {});
|
|
149
|
+
}
|
|
150
|
+
interface TrackTags extends PlatformInfo, DeviceInfo, AppInfo, EnvironmentInfo, SourceInfo, AdvertisingInfo, UTMParams {
|
|
151
|
+
idempotency_key?: string;
|
|
152
|
+
[key: string]: string | number | boolean | null | undefined;
|
|
153
|
+
}
|
|
154
|
+
interface TrackEvent<T extends EventName = EventName> {
|
|
155
|
+
id: string;
|
|
156
|
+
name: TrackName<T>;
|
|
157
|
+
tags: TrackTags;
|
|
158
|
+
visitor_id: string;
|
|
159
|
+
session_id: string;
|
|
160
|
+
platform: Platform;
|
|
161
|
+
environment: Environment;
|
|
162
|
+
properties?: TrackProperties<T>;
|
|
163
|
+
created_at: string;
|
|
164
|
+
}
|
|
165
|
+
type TrackEventResponse = {
|
|
166
|
+
/** track event id: Meta Pixel will use event_id and event_name for deduplication */
|
|
167
|
+
id: string;
|
|
168
|
+
}[];
|
|
169
|
+
//#endregion
|
|
170
|
+
export { AdvertisingInfo, AllowedPropertyValues, AppInfo, DeviceInfo, Environment, EnvironmentInfo, EventName, Platform, PlatformInfo, SourceInfo, ThirdPartyTracker, TrackEvent, TrackEventResponse, TrackName, TrackProperties, TrackTags, UTMParams, UserData, UserProvidedData };
|
|
171
|
+
//# sourceMappingURL=types.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.mts","names":[],"sources":["../../src/track/types.ts"],"mappings":";;KAEY;KACA,YAAY;KAEZ,UAAU,UAAU,YAAY,aAAa,gBAAgB,iBACrE,IACA;KACQ,gBAAgB,UAAU,YAAY,aAAa,gBAAgB,iBAC3E,eAAe,KACf,OAAO,mBAAmB;KAElB;KACA;UAEK;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe,yBAAyB;EACxC;EACA;EACA;EACA;EACA;IAAa;IAAc;IAAe;;EAE1C;EACA;;KAGU,qBAAqB,UAAU,WACzC,MAAM,UAAU,IAChB,aAAa,gBAAgB,IAC7B;UAGe;EACf;EACA;EACA;EACA;EACA;EACA;;EAEA,UAAU;;UAGK;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;;EAEf;EACA;;UAGe;EACf;EACA;EACA;;EAEA,aAAa;;UAGE;EACf;EACA;EACA;;UAGe;;;;;;;EAOf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EAEA;EACA;EACA;EACA;;EAEA;EACA;;EAEA;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;;;;;UAQe;;EAEf;;;;;;;;;;;;EAqCA;;;;;;EAuDA;;EAMA;;EAEA;;EAEA;;EAEA;;EAUA;;EAEA;;UAGe,kBAEb,cACA,YACA,SACA,iBACA,YACA,iBACA;EACF;GACC;;UAGc,WAAW,UAAU,YAAY;EAChD;EACA,MAAM,UAAU;EAChB,MAAM;EACN;EACA;EACA,UAAU;EACV,aAAa;EACb,aAAa,gBAAgB;EAC7B;;KAGU;;EAEV"}
|
package/dist/track/types.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export {};
|
package/dist/utils/field.cjs
CHANGED
|
@@ -1,35 +1,11 @@
|
|
|
1
|
-
"
|
|
2
|
-
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/utils/field.ts
|
|
21
|
-
var field_exports = {};
|
|
22
|
-
__export(field_exports, {
|
|
23
|
-
getFirst: () => getFirst
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(field_exports);
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
//#region src/utils/field.ts
|
|
26
3
|
function getFirst(field) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
4
|
+
if (!field) return void 0;
|
|
5
|
+
if (Array.isArray(field)) return field.at(0);
|
|
6
|
+
return field;
|
|
30
7
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
});
|
|
8
|
+
//#endregion
|
|
9
|
+
exports.getFirst = getFirst;
|
|
10
|
+
|
|
35
11
|
//# sourceMappingURL=field.cjs.map
|
package/dist/utils/field.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/field.ts"],"sourcesContent":["export function getFirst<T>(field: T | T[] | undefined) {\n if (!field) return undefined;\n if (Array.isArray(field)) return field.at(0);\n return field;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"field.cjs","names":[],"sources":["../../src/utils/field.ts"],"sourcesContent":["export function getFirst<T>(field: T | T[] | undefined) {\n if (!field) return undefined;\n if (Array.isArray(field)) return field.at(0);\n return field;\n}\n"],"mappings":";;AAAA,SAAgB,SAAY,OAA4B;CACtD,IAAI,CAAC,OAAO,OAAO,KAAA;CACnB,IAAI,MAAM,QAAQ,KAAK,GAAG,OAAO,MAAM,GAAG,CAAC;CAC3C,OAAO;AACT"}
|
package/dist/utils/field.d.cts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field.d.cts","names":[],"sources":["../../src/utils/field.ts"],"mappings":";iBAAgB,SAAS,GAAG,OAAO,IAAI,kBAAe"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field.d.mts","names":[],"sources":["../../src/utils/field.ts"],"mappings":";iBAAgB,SAAS,GAAG,OAAO,IAAI,kBAAe"}
|
package/dist/utils/field.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/utils/field.ts
|
|
2
2
|
function getFirst(field) {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
if (!field) return void 0;
|
|
4
|
+
if (Array.isArray(field)) return field.at(0);
|
|
5
|
+
return field;
|
|
6
6
|
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
//#endregion
|
|
8
|
+
export { getFirst };
|
|
9
|
+
|
|
10
10
|
//# sourceMappingURL=field.mjs.map
|
package/dist/utils/field.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/field.ts"],"sourcesContent":["export function getFirst<T>(field: T | T[] | undefined) {\n if (!field) return undefined;\n if (Array.isArray(field)) return field.at(0);\n return field;\n}\n"],"mappings":";
|
|
1
|
+
{"version":3,"file":"field.mjs","names":[],"sources":["../../src/utils/field.ts"],"sourcesContent":["export function getFirst<T>(field: T | T[] | undefined) {\n if (!field) return undefined;\n if (Array.isArray(field)) return field.at(0);\n return field;\n}\n"],"mappings":";AAAA,SAAgB,SAAY,OAA4B;CACtD,IAAI,CAAC,OAAO,OAAO,KAAA;CACnB,IAAI,MAAM,QAAQ,KAAK,GAAG,OAAO,MAAM,GAAG,CAAC;CAC3C,OAAO;AACT"}
|
package/dist/utils/stripe.cjs
CHANGED
|
@@ -1,53 +1,29 @@
|
|
|
1
|
-
"
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
// src/utils/stripe.ts
|
|
21
|
-
var stripe_exports = {};
|
|
22
|
-
__export(stripe_exports, {
|
|
23
|
-
ZERO_DECIMAL_CURRENCIES: () => ZERO_DECIMAL_CURRENCIES,
|
|
24
|
-
stripeMinorUnits: () => stripeMinorUnits
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(stripe_exports);
|
|
27
|
-
var ZERO_DECIMAL_CURRENCIES = [
|
|
28
|
-
"BIF",
|
|
29
|
-
"CLP",
|
|
30
|
-
"DJF",
|
|
31
|
-
"GNF",
|
|
32
|
-
"JPY",
|
|
33
|
-
"KMF",
|
|
34
|
-
"KRW",
|
|
35
|
-
"MGA",
|
|
36
|
-
"PYG",
|
|
37
|
-
"RWF",
|
|
38
|
-
"UGX",
|
|
39
|
-
"VND",
|
|
40
|
-
"VUV",
|
|
41
|
-
"XAF",
|
|
42
|
-
"XOF",
|
|
43
|
-
"XPF"
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
//#region src/utils/stripe.ts
|
|
3
|
+
const ZERO_DECIMAL_CURRENCIES = [
|
|
4
|
+
"BIF",
|
|
5
|
+
"CLP",
|
|
6
|
+
"DJF",
|
|
7
|
+
"GNF",
|
|
8
|
+
"JPY",
|
|
9
|
+
"KMF",
|
|
10
|
+
"KRW",
|
|
11
|
+
"MGA",
|
|
12
|
+
"PYG",
|
|
13
|
+
"RWF",
|
|
14
|
+
"UGX",
|
|
15
|
+
"VND",
|
|
16
|
+
"VUV",
|
|
17
|
+
"XAF",
|
|
18
|
+
"XOF",
|
|
19
|
+
"XPF"
|
|
44
20
|
];
|
|
21
|
+
/** reference: https://docs.stripe.com/currencies#zero-decimal */
|
|
45
22
|
function stripeMinorUnits(currency) {
|
|
46
|
-
|
|
23
|
+
return ZERO_DECIMAL_CURRENCIES.includes(currency.toUpperCase()) ? 1 : 100;
|
|
47
24
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
});
|
|
25
|
+
//#endregion
|
|
26
|
+
exports.ZERO_DECIMAL_CURRENCIES = ZERO_DECIMAL_CURRENCIES;
|
|
27
|
+
exports.stripeMinorUnits = stripeMinorUnits;
|
|
28
|
+
|
|
53
29
|
//# sourceMappingURL=stripe.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/stripe.ts"],"sourcesContent":["export const ZERO_DECIMAL_CURRENCIES = [\n 'BIF',\n 'CLP',\n 'DJF',\n 'GNF',\n 'JPY',\n 'KMF',\n 'KRW',\n 'MGA',\n 'PYG',\n 'RWF',\n 'UGX',\n 'VND',\n 'VUV',\n 'XAF',\n 'XOF',\n 'XPF',\n];\n\n/** reference: https://docs.stripe.com/currencies#zero-decimal */\nexport function stripeMinorUnits(currency: string) {\n return ZERO_DECIMAL_CURRENCIES.includes(currency.toUpperCase()) ? 1 : 100;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"stripe.cjs","names":[],"sources":["../../src/utils/stripe.ts"],"sourcesContent":["export const ZERO_DECIMAL_CURRENCIES = [\n 'BIF',\n 'CLP',\n 'DJF',\n 'GNF',\n 'JPY',\n 'KMF',\n 'KRW',\n 'MGA',\n 'PYG',\n 'RWF',\n 'UGX',\n 'VND',\n 'VUV',\n 'XAF',\n 'XOF',\n 'XPF',\n];\n\n/** reference: https://docs.stripe.com/currencies#zero-decimal */\nexport function stripeMinorUnits(currency: string) {\n return ZERO_DECIMAL_CURRENCIES.includes(currency.toUpperCase()) ? 1 : 100;\n}\n"],"mappings":";;AAAA,MAAa,0BAA0B;CACrC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;;AAGA,SAAgB,iBAAiB,UAAkB;CACjD,OAAO,wBAAwB,SAAS,SAAS,YAAY,CAAC,IAAI,IAAI;AACxE"}
|