@healthya-team/pharmacy-analytics 1.0.0 → 1.0.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.
@@ -1,4 +1,5 @@
1
- import react__default from 'react';
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import React from 'react';
2
3
 
3
4
  declare global {
4
5
  interface Window {
@@ -201,7 +202,7 @@ interface GaScriptProps {
201
202
  * Loaded with `beforeInteractive` priority so `gtag` is always available.
202
203
  * Consent is initialized as DENIED by default until user accepts cookies.
203
204
  */
204
- declare function GaScript({ measurementId }: GaScriptProps): react__default.JSX.Element | null;
205
+ declare function GaScript({ measurementId }: GaScriptProps): react_jsx_runtime.JSX.Element | null;
205
206
 
206
207
  interface MixpanelInitProps {
207
208
  token?: string | null;
@@ -209,7 +210,7 @@ interface MixpanelInitProps {
209
210
  declare function MixpanelInit({ token }?: MixpanelInitProps): null;
210
211
 
211
212
  declare function AnalyticsProvider({ children }: {
212
- children: react__default.ReactNode;
213
- }): react__default.JSX.Element;
213
+ children: React.ReactNode;
214
+ }): react_jsx_runtime.JSX.Element;
214
215
 
215
216
  export { AnalyticsProvider, type AuthCompletedParams, type CartAuthCompletedParams, type CartViewedParams, type CheckoutStartedParams, type ConditionSearchedParams, type ConditionTrackingParams, type EligibilityCheckedParams, GaScript, type GaScriptProps, type GetTreatmentClickedParams, MixpanelInit, type MixpanelInitProps, type OrderSuccessParams, type PMStartAssessmentClickedParams, type ProductSearchedParams, type ProductSelectedParams, type ProductTrackingParams, type QuestionnaireFlowStepParams, type QuestionnairePmParams, type StartAssessmentClickedParams, trackAuthCompleted, trackCartAuthCompleted, trackCartViewed, trackCheckoutStarted, trackConditionSearched, trackConditionViewed, trackEligibilityChecked, trackEvent, trackGetTreatmentClicked, trackOrderSuccess, trackPMStartAssessmentClicked, trackPageView, trackProductSearched, trackProductSelected, trackProductViewed, trackQuestionnaireFlowStep, trackQuestionnairePm, trackStartAssessmentClicked };
@@ -1,4 +1,5 @@
1
- import react__default from 'react';
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import React from 'react';
2
3
 
3
4
  declare global {
4
5
  interface Window {
@@ -201,7 +202,7 @@ interface GaScriptProps {
201
202
  * Loaded with `beforeInteractive` priority so `gtag` is always available.
202
203
  * Consent is initialized as DENIED by default until user accepts cookies.
203
204
  */
204
- declare function GaScript({ measurementId }: GaScriptProps): react__default.JSX.Element | null;
205
+ declare function GaScript({ measurementId }: GaScriptProps): react_jsx_runtime.JSX.Element | null;
205
206
 
206
207
  interface MixpanelInitProps {
207
208
  token?: string | null;
@@ -209,7 +210,7 @@ interface MixpanelInitProps {
209
210
  declare function MixpanelInit({ token }?: MixpanelInitProps): null;
210
211
 
211
212
  declare function AnalyticsProvider({ children }: {
212
- children: react__default.ReactNode;
213
- }): react__default.JSX.Element;
213
+ children: React.ReactNode;
214
+ }): react_jsx_runtime.JSX.Element;
214
215
 
215
216
  export { AnalyticsProvider, type AuthCompletedParams, type CartAuthCompletedParams, type CartViewedParams, type CheckoutStartedParams, type ConditionSearchedParams, type ConditionTrackingParams, type EligibilityCheckedParams, GaScript, type GaScriptProps, type GetTreatmentClickedParams, MixpanelInit, type MixpanelInitProps, type OrderSuccessParams, type PMStartAssessmentClickedParams, type ProductSearchedParams, type ProductSelectedParams, type ProductTrackingParams, type QuestionnaireFlowStepParams, type QuestionnairePmParams, type StartAssessmentClickedParams, trackAuthCompleted, trackCartAuthCompleted, trackCartViewed, trackCheckoutStarted, trackConditionSearched, trackConditionViewed, trackEligibilityChecked, trackEvent, trackGetTreatmentClicked, trackOrderSuccess, trackPMStartAssessmentClicked, trackPageView, trackProductSearched, trackProductSelected, trackProductViewed, trackQuestionnaireFlowStep, trackQuestionnairePm, trackStartAssessmentClicked };
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  "use strict";
2
3
  var __create = Object.create;
3
4
  var __defProp = Object.defineProperty;
@@ -1,3 +1,5 @@
1
+ "use client";
2
+
1
3
  // src/client/analytics.ts
2
4
  import mixpanel from "mixpanel-browser";
3
5
  function trackEvent(eventName, params) {
package/dist/index.d.mts CHANGED
@@ -1,6 +1,220 @@
1
- export { AnalyticsProvider, AuthCompletedParams, CartAuthCompletedParams, CartViewedParams, CheckoutStartedParams, ConditionSearchedParams, ConditionTrackingParams, EligibilityCheckedParams, GaScript, GaScriptProps, GetTreatmentClickedParams, MixpanelInit, MixpanelInitProps, OrderSuccessParams, PMStartAssessmentClickedParams, ProductSearchedParams, ProductSelectedParams, ProductTrackingParams, QuestionnaireFlowStepParams, QuestionnairePmParams, StartAssessmentClickedParams, trackAuthCompleted, trackCartAuthCompleted, trackCartViewed, trackCheckoutStarted, trackConditionSearched, trackConditionViewed, trackEligibilityChecked, trackEvent, trackGetTreatmentClicked, trackOrderSuccess, trackPMStartAssessmentClicked, trackPageView, trackProductSearched, trackProductSelected, trackProductViewed, trackQuestionnaireFlowStep, trackQuestionnairePm, trackStartAssessmentClicked } from './client/index.mjs';
2
- export { AnalyticsServerConfig, GET, POST, createAnalyticsApiHandler } from './server/index.mjs';
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import React from 'react';
3
+ export { AnalyticsServerConfig, GET, OPTIONS, POST, createAnalyticsApiHandler } from './server/index.mjs';
3
4
  export { AnalyticsData, AppearanceTab, BrowserData, ChannelData, CityData, CountriesTab, CountryData, DASHBOARD_CSS, DashboardShell, DataTable, DateRange, DeviceCategory, DevicesTab, Donut, ErrorState, EventData, EventParamRow, GA_ACCENT, HorizontalBar, HourlyDataPoint, InitialLoading, LandingPage, MainSection, MetricCard, MetricGrid, OsData, OverviewMetrics, OverviewTab, PagesTab, Panel, PathCell, PharmacyAnalyticsDashboard, PharmacyAnalyticsPluginConfig, QueriesTab, ReferrerData, SC_ACCENT, ScAppearanceTab, ScCountriesTab, ScCountry, ScDateRange, ScDevice, ScDevicesTab, ScOverviewTab, ScPage, ScPagesTab, ScQueriesTab, ScQuery, ScRow, ScSearchAppearance, ScSitemapsTab, ScTab, ScTimeSeriesPoint, SearchConsoleDashboard, SearchConsoleData, SearchConsolePluginConfig, SearchConsoleTab, SearchConsoleTool, Sitemap, SitemapContent, SitemapsTab, SkeletonChart, StatusPill, TimeSeriesDataPoint, TopPage, TrafficSource, PharmacyAnalyticsDashboard as UnifiedDashboard, UnifiedDashboardProps, UnifiedTabId, UserTypeData, pharmacyAnalyticsPlugin, searchConsolePlugin } from './studio/index.mjs';
4
- import 'react';
5
5
  import 'sanity';
6
6
  import 'lucide-react';
7
+
8
+ declare global {
9
+ interface Window {
10
+ gtag: (...args: unknown[]) => void;
11
+ dataLayer: unknown[];
12
+ }
13
+ }
14
+ /**
15
+ * Fires an analytics event to GA4 (via gtag) and Mixpanel in parallel.
16
+ * No-ops server-side. GA4 is skipped when gtag is unavailable (e.g. consent denied).
17
+ */
18
+ declare function trackEvent(eventName: string, params?: Record<string, unknown>): void;
19
+ declare function trackPageView(pagePath: string, pageTitle: string): void;
20
+ interface ConditionTrackingParams {
21
+ condition_slug: string;
22
+ condition_name: string;
23
+ condition_id: string | number;
24
+ branch_corporate_id?: string | number;
25
+ source?: string;
26
+ is_pre_consult: boolean;
27
+ is_private_medication: boolean;
28
+ }
29
+ declare function trackConditionViewed(params: ConditionTrackingParams): void;
30
+ interface StartAssessmentClickedParams {
31
+ eligibility_status: 'passed' | 'failed';
32
+ is_nhs: boolean;
33
+ gender: string;
34
+ date_of_birth: string;
35
+ condition_id: string | number;
36
+ condition_name: string;
37
+ branch_corporate_id?: string | number;
38
+ }
39
+ declare function trackStartAssessmentClicked(params: StartAssessmentClickedParams): void;
40
+ interface EligibilityCheckedParams {
41
+ status: 'passed' | 'failed';
42
+ gender: string;
43
+ date_of_birth: string;
44
+ condition_name: string;
45
+ condition_id: string | number;
46
+ branch_corporate_id?: string | number;
47
+ }
48
+ declare function trackEligibilityChecked(params: EligibilityCheckedParams): void;
49
+ interface QuestionnaireFlowStepParams {
50
+ step: string;
51
+ condition_token: string;
52
+ condition_id: string | number;
53
+ condition_name: string;
54
+ user_journey_flow: string;
55
+ branch_corporate_id?: string | number;
56
+ }
57
+ declare function trackQuestionnaireFlowStep(params: QuestionnaireFlowStepParams): void;
58
+ interface ProductTrackingParams {
59
+ product_slug: string;
60
+ product_name: string;
61
+ product_id: string | number;
62
+ core_drug_id?: number;
63
+ branch_corporate_id?: string | number;
64
+ condition_id?: string | number;
65
+ condition_name?: string;
66
+ source?: string;
67
+ category_type?: string;
68
+ }
69
+ declare function trackProductViewed(params: ProductTrackingParams): void;
70
+ interface GetTreatmentClickedParams {
71
+ product_slug: string;
72
+ product_name: string;
73
+ category_type?: string;
74
+ product_id: string | number;
75
+ core_drug_id?: number;
76
+ branch_corporate_id?: string | number;
77
+ condition_id?: string | number;
78
+ condition_name?: string;
79
+ pm_flow_source?: 'product_detail' | 'condition_detail';
80
+ button_origin?: string;
81
+ }
82
+ declare function trackGetTreatmentClicked(params: GetTreatmentClickedParams): void;
83
+ interface PMStartAssessmentClickedParams {
84
+ branch_corporate_id?: string | number;
85
+ condition_id?: string | number;
86
+ condition_name?: string;
87
+ pm_flow_source?: 'product_detail' | 'condition_detail';
88
+ }
89
+ declare function trackPMStartAssessmentClicked(params: PMStartAssessmentClickedParams): void;
90
+ interface AuthCompletedParams {
91
+ method: 'signup' | 'signin' | 'guest' | 'already_logged_in';
92
+ branch_corporate_id?: string | number;
93
+ core_drug_id?: number;
94
+ condition_id?: string | number;
95
+ condition_name?: string;
96
+ formulary?: string;
97
+ product_name?: string;
98
+ user_name?: string;
99
+ user_email?: string;
100
+ user_gender?: string;
101
+ user_phone?: string;
102
+ user_dob?: string;
103
+ pm_flow_source?: 'product_detail' | 'condition_detail';
104
+ }
105
+ declare function trackAuthCompleted(params: AuthCompletedParams): void;
106
+ interface QuestionnairePmParams {
107
+ product_id?: string | number;
108
+ product_slug?: string;
109
+ product_name?: string;
110
+ core_drug_id?: number;
111
+ condition_id?: string | number;
112
+ condition_name?: string;
113
+ branch_corporate_id?: string | number;
114
+ pm_flow_source?: 'product_detail' | 'condition_detail';
115
+ }
116
+ declare function trackQuestionnairePm(params: QuestionnairePmParams): void;
117
+ interface CartViewedParams {
118
+ product_id?: string | number;
119
+ product_slug?: string;
120
+ product_name?: string;
121
+ branch_corporate_id?: string | number;
122
+ core_drug_id?: number;
123
+ condition_id?: string | number;
124
+ condition_name?: string;
125
+ cart_item_count?: number;
126
+ cart_total_price?: number;
127
+ pm_flow_source?: 'product_detail' | 'condition_detail';
128
+ /** 'signed_in' when user is authenticated, 'guest' when browsing as a guest */
129
+ cart_auth_status?: 'signed_in' | 'guest';
130
+ }
131
+ declare function trackCartViewed(params: CartViewedParams): void;
132
+ interface CheckoutStartedParams {
133
+ product_id?: string | number;
134
+ product_slug?: string;
135
+ product_name?: string;
136
+ branch_corporate_id?: string | number;
137
+ core_drug_id?: number;
138
+ condition_id?: string | number;
139
+ condition_name?: string;
140
+ cart_item_count?: number;
141
+ cart_total_price?: number;
142
+ pm_flow_source?: 'product_detail' | 'condition_detail';
143
+ }
144
+ declare function trackCheckoutStarted(params: CheckoutStartedParams): void;
145
+ interface OrderSuccessParams {
146
+ product_id?: string | number;
147
+ product_slug?: string;
148
+ product_name?: string;
149
+ branch_corporate_id?: string | number;
150
+ core_drug_id?: number;
151
+ condition_id?: string | number;
152
+ condition_name?: string;
153
+ order_id?: string | number;
154
+ cart_item_count?: number;
155
+ cart_total_price?: number;
156
+ payment_mode?: string;
157
+ pm_flow_source?: 'product_detail' | 'condition_detail';
158
+ }
159
+ declare function trackOrderSuccess(params: OrderSuccessParams): void;
160
+ interface CartAuthCompletedParams {
161
+ method: 'signup' | 'signin' | 'guest';
162
+ product_id?: string | number;
163
+ product_slug?: string;
164
+ product_name?: string;
165
+ branch_corporate_id?: string | number;
166
+ core_drug_id?: number;
167
+ condition_id?: string | number;
168
+ condition_name?: string;
169
+ user_name?: string;
170
+ user_email?: string;
171
+ user_gender?: string;
172
+ user_phone?: string;
173
+ user_dob?: string;
174
+ pm_flow_source?: 'product_detail' | 'condition_detail';
175
+ }
176
+ declare function trackCartAuthCompleted(params: CartAuthCompletedParams): void;
177
+ interface ProductSelectedParams {
178
+ product_id?: string | number;
179
+ product_slug?: string;
180
+ product_name?: string;
181
+ core_drug_id?: number;
182
+ condition_id?: string | number;
183
+ condition_name?: string;
184
+ branch_corporate_id?: string | number;
185
+ pm_flow_source?: 'product_detail' | 'condition_detail';
186
+ }
187
+ declare function trackProductSelected(params: ProductSelectedParams): void;
188
+ interface ConditionSearchedParams {
189
+ search_term: string;
190
+ results_count: number;
191
+ source: 'hero' | 'nav' | 'mobile_nav' | 'page';
192
+ }
193
+ declare function trackConditionSearched(params: ConditionSearchedParams): void;
194
+ interface ProductSearchedParams {
195
+ search_term: string;
196
+ results_count: number;
197
+ }
198
+ declare function trackProductSearched(params: ProductSearchedParams): void;
199
+
200
+ interface GaScriptProps {
201
+ measurementId?: string | null;
202
+ }
203
+ /**
204
+ * Injects the GA4 gtag.js script globally in Next.js layout.
205
+ *
206
+ * Loaded with `beforeInteractive` priority so `gtag` is always available.
207
+ * Consent is initialized as DENIED by default until user accepts cookies.
208
+ */
209
+ declare function GaScript({ measurementId }: GaScriptProps): react_jsx_runtime.JSX.Element | null;
210
+
211
+ interface MixpanelInitProps {
212
+ token?: string | null;
213
+ }
214
+ declare function MixpanelInit({ token }?: MixpanelInitProps): null;
215
+
216
+ declare function AnalyticsProvider({ children }: {
217
+ children: React.ReactNode;
218
+ }): react_jsx_runtime.JSX.Element;
219
+
220
+ export { AnalyticsProvider, type AuthCompletedParams, type CartAuthCompletedParams, type CartViewedParams, type CheckoutStartedParams, type ConditionSearchedParams, type ConditionTrackingParams, type EligibilityCheckedParams, GaScript, type GaScriptProps, type GetTreatmentClickedParams, MixpanelInit, type MixpanelInitProps, type OrderSuccessParams, type PMStartAssessmentClickedParams, type ProductSearchedParams, type ProductSelectedParams, type ProductTrackingParams, type QuestionnaireFlowStepParams, type QuestionnairePmParams, type StartAssessmentClickedParams, trackAuthCompleted, trackCartAuthCompleted, trackCartViewed, trackCheckoutStarted, trackConditionSearched, trackConditionViewed, trackEligibilityChecked, trackEvent, trackGetTreatmentClicked, trackOrderSuccess, trackPMStartAssessmentClicked, trackPageView, trackProductSearched, trackProductSelected, trackProductViewed, trackQuestionnaireFlowStep, trackQuestionnairePm, trackStartAssessmentClicked };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,220 @@
1
- export { AnalyticsProvider, AuthCompletedParams, CartAuthCompletedParams, CartViewedParams, CheckoutStartedParams, ConditionSearchedParams, ConditionTrackingParams, EligibilityCheckedParams, GaScript, GaScriptProps, GetTreatmentClickedParams, MixpanelInit, MixpanelInitProps, OrderSuccessParams, PMStartAssessmentClickedParams, ProductSearchedParams, ProductSelectedParams, ProductTrackingParams, QuestionnaireFlowStepParams, QuestionnairePmParams, StartAssessmentClickedParams, trackAuthCompleted, trackCartAuthCompleted, trackCartViewed, trackCheckoutStarted, trackConditionSearched, trackConditionViewed, trackEligibilityChecked, trackEvent, trackGetTreatmentClicked, trackOrderSuccess, trackPMStartAssessmentClicked, trackPageView, trackProductSearched, trackProductSelected, trackProductViewed, trackQuestionnaireFlowStep, trackQuestionnairePm, trackStartAssessmentClicked } from './client/index.js';
2
- export { AnalyticsServerConfig, GET, POST, createAnalyticsApiHandler } from './server/index.js';
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import React from 'react';
3
+ export { AnalyticsServerConfig, GET, OPTIONS, POST, createAnalyticsApiHandler } from './server/index.js';
3
4
  export { AnalyticsData, AppearanceTab, BrowserData, ChannelData, CityData, CountriesTab, CountryData, DASHBOARD_CSS, DashboardShell, DataTable, DateRange, DeviceCategory, DevicesTab, Donut, ErrorState, EventData, EventParamRow, GA_ACCENT, HorizontalBar, HourlyDataPoint, InitialLoading, LandingPage, MainSection, MetricCard, MetricGrid, OsData, OverviewMetrics, OverviewTab, PagesTab, Panel, PathCell, PharmacyAnalyticsDashboard, PharmacyAnalyticsPluginConfig, QueriesTab, ReferrerData, SC_ACCENT, ScAppearanceTab, ScCountriesTab, ScCountry, ScDateRange, ScDevice, ScDevicesTab, ScOverviewTab, ScPage, ScPagesTab, ScQueriesTab, ScQuery, ScRow, ScSearchAppearance, ScSitemapsTab, ScTab, ScTimeSeriesPoint, SearchConsoleDashboard, SearchConsoleData, SearchConsolePluginConfig, SearchConsoleTab, SearchConsoleTool, Sitemap, SitemapContent, SitemapsTab, SkeletonChart, StatusPill, TimeSeriesDataPoint, TopPage, TrafficSource, PharmacyAnalyticsDashboard as UnifiedDashboard, UnifiedDashboardProps, UnifiedTabId, UserTypeData, pharmacyAnalyticsPlugin, searchConsolePlugin } from './studio/index.js';
4
- import 'react';
5
5
  import 'sanity';
6
6
  import 'lucide-react';
7
+
8
+ declare global {
9
+ interface Window {
10
+ gtag: (...args: unknown[]) => void;
11
+ dataLayer: unknown[];
12
+ }
13
+ }
14
+ /**
15
+ * Fires an analytics event to GA4 (via gtag) and Mixpanel in parallel.
16
+ * No-ops server-side. GA4 is skipped when gtag is unavailable (e.g. consent denied).
17
+ */
18
+ declare function trackEvent(eventName: string, params?: Record<string, unknown>): void;
19
+ declare function trackPageView(pagePath: string, pageTitle: string): void;
20
+ interface ConditionTrackingParams {
21
+ condition_slug: string;
22
+ condition_name: string;
23
+ condition_id: string | number;
24
+ branch_corporate_id?: string | number;
25
+ source?: string;
26
+ is_pre_consult: boolean;
27
+ is_private_medication: boolean;
28
+ }
29
+ declare function trackConditionViewed(params: ConditionTrackingParams): void;
30
+ interface StartAssessmentClickedParams {
31
+ eligibility_status: 'passed' | 'failed';
32
+ is_nhs: boolean;
33
+ gender: string;
34
+ date_of_birth: string;
35
+ condition_id: string | number;
36
+ condition_name: string;
37
+ branch_corporate_id?: string | number;
38
+ }
39
+ declare function trackStartAssessmentClicked(params: StartAssessmentClickedParams): void;
40
+ interface EligibilityCheckedParams {
41
+ status: 'passed' | 'failed';
42
+ gender: string;
43
+ date_of_birth: string;
44
+ condition_name: string;
45
+ condition_id: string | number;
46
+ branch_corporate_id?: string | number;
47
+ }
48
+ declare function trackEligibilityChecked(params: EligibilityCheckedParams): void;
49
+ interface QuestionnaireFlowStepParams {
50
+ step: string;
51
+ condition_token: string;
52
+ condition_id: string | number;
53
+ condition_name: string;
54
+ user_journey_flow: string;
55
+ branch_corporate_id?: string | number;
56
+ }
57
+ declare function trackQuestionnaireFlowStep(params: QuestionnaireFlowStepParams): void;
58
+ interface ProductTrackingParams {
59
+ product_slug: string;
60
+ product_name: string;
61
+ product_id: string | number;
62
+ core_drug_id?: number;
63
+ branch_corporate_id?: string | number;
64
+ condition_id?: string | number;
65
+ condition_name?: string;
66
+ source?: string;
67
+ category_type?: string;
68
+ }
69
+ declare function trackProductViewed(params: ProductTrackingParams): void;
70
+ interface GetTreatmentClickedParams {
71
+ product_slug: string;
72
+ product_name: string;
73
+ category_type?: string;
74
+ product_id: string | number;
75
+ core_drug_id?: number;
76
+ branch_corporate_id?: string | number;
77
+ condition_id?: string | number;
78
+ condition_name?: string;
79
+ pm_flow_source?: 'product_detail' | 'condition_detail';
80
+ button_origin?: string;
81
+ }
82
+ declare function trackGetTreatmentClicked(params: GetTreatmentClickedParams): void;
83
+ interface PMStartAssessmentClickedParams {
84
+ branch_corporate_id?: string | number;
85
+ condition_id?: string | number;
86
+ condition_name?: string;
87
+ pm_flow_source?: 'product_detail' | 'condition_detail';
88
+ }
89
+ declare function trackPMStartAssessmentClicked(params: PMStartAssessmentClickedParams): void;
90
+ interface AuthCompletedParams {
91
+ method: 'signup' | 'signin' | 'guest' | 'already_logged_in';
92
+ branch_corporate_id?: string | number;
93
+ core_drug_id?: number;
94
+ condition_id?: string | number;
95
+ condition_name?: string;
96
+ formulary?: string;
97
+ product_name?: string;
98
+ user_name?: string;
99
+ user_email?: string;
100
+ user_gender?: string;
101
+ user_phone?: string;
102
+ user_dob?: string;
103
+ pm_flow_source?: 'product_detail' | 'condition_detail';
104
+ }
105
+ declare function trackAuthCompleted(params: AuthCompletedParams): void;
106
+ interface QuestionnairePmParams {
107
+ product_id?: string | number;
108
+ product_slug?: string;
109
+ product_name?: string;
110
+ core_drug_id?: number;
111
+ condition_id?: string | number;
112
+ condition_name?: string;
113
+ branch_corporate_id?: string | number;
114
+ pm_flow_source?: 'product_detail' | 'condition_detail';
115
+ }
116
+ declare function trackQuestionnairePm(params: QuestionnairePmParams): void;
117
+ interface CartViewedParams {
118
+ product_id?: string | number;
119
+ product_slug?: string;
120
+ product_name?: string;
121
+ branch_corporate_id?: string | number;
122
+ core_drug_id?: number;
123
+ condition_id?: string | number;
124
+ condition_name?: string;
125
+ cart_item_count?: number;
126
+ cart_total_price?: number;
127
+ pm_flow_source?: 'product_detail' | 'condition_detail';
128
+ /** 'signed_in' when user is authenticated, 'guest' when browsing as a guest */
129
+ cart_auth_status?: 'signed_in' | 'guest';
130
+ }
131
+ declare function trackCartViewed(params: CartViewedParams): void;
132
+ interface CheckoutStartedParams {
133
+ product_id?: string | number;
134
+ product_slug?: string;
135
+ product_name?: string;
136
+ branch_corporate_id?: string | number;
137
+ core_drug_id?: number;
138
+ condition_id?: string | number;
139
+ condition_name?: string;
140
+ cart_item_count?: number;
141
+ cart_total_price?: number;
142
+ pm_flow_source?: 'product_detail' | 'condition_detail';
143
+ }
144
+ declare function trackCheckoutStarted(params: CheckoutStartedParams): void;
145
+ interface OrderSuccessParams {
146
+ product_id?: string | number;
147
+ product_slug?: string;
148
+ product_name?: string;
149
+ branch_corporate_id?: string | number;
150
+ core_drug_id?: number;
151
+ condition_id?: string | number;
152
+ condition_name?: string;
153
+ order_id?: string | number;
154
+ cart_item_count?: number;
155
+ cart_total_price?: number;
156
+ payment_mode?: string;
157
+ pm_flow_source?: 'product_detail' | 'condition_detail';
158
+ }
159
+ declare function trackOrderSuccess(params: OrderSuccessParams): void;
160
+ interface CartAuthCompletedParams {
161
+ method: 'signup' | 'signin' | 'guest';
162
+ product_id?: string | number;
163
+ product_slug?: string;
164
+ product_name?: string;
165
+ branch_corporate_id?: string | number;
166
+ core_drug_id?: number;
167
+ condition_id?: string | number;
168
+ condition_name?: string;
169
+ user_name?: string;
170
+ user_email?: string;
171
+ user_gender?: string;
172
+ user_phone?: string;
173
+ user_dob?: string;
174
+ pm_flow_source?: 'product_detail' | 'condition_detail';
175
+ }
176
+ declare function trackCartAuthCompleted(params: CartAuthCompletedParams): void;
177
+ interface ProductSelectedParams {
178
+ product_id?: string | number;
179
+ product_slug?: string;
180
+ product_name?: string;
181
+ core_drug_id?: number;
182
+ condition_id?: string | number;
183
+ condition_name?: string;
184
+ branch_corporate_id?: string | number;
185
+ pm_flow_source?: 'product_detail' | 'condition_detail';
186
+ }
187
+ declare function trackProductSelected(params: ProductSelectedParams): void;
188
+ interface ConditionSearchedParams {
189
+ search_term: string;
190
+ results_count: number;
191
+ source: 'hero' | 'nav' | 'mobile_nav' | 'page';
192
+ }
193
+ declare function trackConditionSearched(params: ConditionSearchedParams): void;
194
+ interface ProductSearchedParams {
195
+ search_term: string;
196
+ results_count: number;
197
+ }
198
+ declare function trackProductSearched(params: ProductSearchedParams): void;
199
+
200
+ interface GaScriptProps {
201
+ measurementId?: string | null;
202
+ }
203
+ /**
204
+ * Injects the GA4 gtag.js script globally in Next.js layout.
205
+ *
206
+ * Loaded with `beforeInteractive` priority so `gtag` is always available.
207
+ * Consent is initialized as DENIED by default until user accepts cookies.
208
+ */
209
+ declare function GaScript({ measurementId }: GaScriptProps): react_jsx_runtime.JSX.Element | null;
210
+
211
+ interface MixpanelInitProps {
212
+ token?: string | null;
213
+ }
214
+ declare function MixpanelInit({ token }?: MixpanelInitProps): null;
215
+
216
+ declare function AnalyticsProvider({ children }: {
217
+ children: React.ReactNode;
218
+ }): react_jsx_runtime.JSX.Element;
219
+
220
+ export { AnalyticsProvider, type AuthCompletedParams, type CartAuthCompletedParams, type CartViewedParams, type CheckoutStartedParams, type ConditionSearchedParams, type ConditionTrackingParams, type EligibilityCheckedParams, GaScript, type GaScriptProps, type GetTreatmentClickedParams, MixpanelInit, type MixpanelInitProps, type OrderSuccessParams, type PMStartAssessmentClickedParams, type ProductSearchedParams, type ProductSelectedParams, type ProductTrackingParams, type QuestionnaireFlowStepParams, type QuestionnairePmParams, type StartAssessmentClickedParams, trackAuthCompleted, trackCartAuthCompleted, trackCartViewed, trackCheckoutStarted, trackConditionSearched, trackConditionViewed, trackEligibilityChecked, trackEvent, trackGetTreatmentClicked, trackOrderSuccess, trackPMStartAssessmentClicked, trackPageView, trackProductSearched, trackProductSelected, trackProductViewed, trackQuestionnaireFlowStep, trackQuestionnairePm, trackStartAssessmentClicked };