gotrip-fx-transaction-form 1.0.281-dev → 1.0.283-dev

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gotrip-fx-transaction-form",
3
- "version": "1.0.281-dev",
3
+ "version": "1.0.283-dev",
4
4
  "description": "FX Transaction Form ES6 module",
5
5
  "main": "index.js",
6
6
  "types": "types/index.d.ts",
@@ -5,6 +5,7 @@ type InitProps = {
5
5
  apiKey: string;
6
6
  type?: ESdkFormType;
7
7
  scrollable?: boolean;
8
+ utm?: Record<string, string> | null;
8
9
  };
9
10
  interface GoTripSDKProps {
10
11
  init: (props: InitProps) => void;
@@ -11,6 +11,8 @@ export interface TrackingDto {
11
11
  fbid?: string;
12
12
  /** Campaign identifier */
13
13
  campaign?: string;
14
+ /** UTM and ad network parameters (utm_source, utm_campaign, gclid, fbclid, ttclid, etc.) */
15
+ utm?: Record<string, string>;
14
16
  }
15
17
  /**
16
18
  * Type helper to extend any DTO with tracking fields
@@ -14,16 +14,23 @@ export declare const saveAnonymousUid: (uid: string) => void;
14
14
  */
15
15
  export declare const getAnonymousUid: () => string;
16
16
  /**
17
- * Parse tracking parameters from URL query string
18
- * Extracts gclid, fbid, campaign, etc. from URL
17
+ * Parse UTM and ad network parameters from URL query string
18
+ * Extracts all UTM params (utm_source, utm_campaign, etc.) and ad network params (gclid, fbclid, ttclid, etc.)
19
19
  */
20
- export declare const parseTrackingParamsFromUrl: () => {
21
- gclid?: string;
22
- fbid?: string;
23
- campaign?: string;
24
- [key: string]: string | undefined;
25
- };
20
+ export declare const parseUTMParamsFromUrl: () => Record<string, string>;
26
21
  /**
27
22
  * Validate tracking data
28
23
  */
29
24
  export declare const validateTrackingData: (data: any) => boolean;
25
+ /**
26
+ * Capture UTM and ad network parameters into a 7-day cookie
27
+ * If params are explicitly provided, use them; otherwise read from URL params
28
+ * Always overrides existing params (last-click wins)
29
+ * Expires in 7 days
30
+ */
31
+ export declare const captureUTMParams: (explicitParams?: Record<string, string> | null) => void;
32
+ /**
33
+ * Get UTM and ad network parameters from cookie
34
+ * Returns empty object if not found or expired
35
+ */
36
+ export declare const getUTMParams: () => Record<string, string>;