@coursebuilder/analytics 1.1.0 → 1.1.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/api/index.d.ts +22 -2
- package/dist/api/index.js +40 -5
- package/dist/api/index.js.map +1 -1
- package/dist/catalog.d.ts +1 -1
- package/dist/catalog.js +43 -1
- package/dist/catalog.js.map +1 -1
- package/dist/components/index.d.ts +29 -0
- package/dist/components/index.js +91 -2
- package/dist/components/index.js.map +1 -1
- package/dist/engine.js +94 -6
- package/dist/engine.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +94 -6
- package/dist/index.js.map +1 -1
- package/dist/providers/database.d.ts +144 -2
- package/dist/providers/database.js +652 -20
- package/dist/providers/database.js.map +1 -1
- package/dist/providers/index.js +654 -22
- package/dist/providers/index.js.map +1 -1
- package/dist/providers/survey.d.ts +1 -1
- package/dist/providers/survey.js +2 -2
- package/dist/providers/survey.js.map +1 -1
- package/dist/types.d.ts +151 -3
- package/package.json +5 -3
- package/src/api/catalog-handler.ts +44 -2
- package/src/api/token-handler.ts +3 -2
- package/src/catalog.ts +49 -1
- package/src/components/omnibus-dashboard.tsx +163 -0
- package/src/engine.ts +66 -6
- package/src/providers/attribution-recovery.test.ts +63 -0
- package/src/providers/attribution-recovery.ts +97 -0
- package/src/providers/database.ts +812 -42
- package/src/providers/survey.ts +3 -1
- package/src/types.ts +166 -2
|
@@ -32,6 +32,9 @@ interface DatabaseAnalyticsSchema {
|
|
|
32
32
|
shortlink: any;
|
|
33
33
|
shortlinkAttribution: any;
|
|
34
34
|
shortlinkClick: any;
|
|
35
|
+
questionResponse?: any;
|
|
36
|
+
contactEvent?: any;
|
|
37
|
+
sideEffectIntent?: any;
|
|
35
38
|
}
|
|
36
39
|
/**
|
|
37
40
|
* Creates a database analytics provider that wraps all analytics query
|
|
@@ -53,7 +56,9 @@ declare function createDatabaseProvider(db: any, schema: DatabaseAnalyticsSchema
|
|
|
53
56
|
getRecentPurchases: (limit?: number, filter?: 'all' | 'team' | 'individual', range?: AnalyticsTimeRange) => Promise<any>;
|
|
54
57
|
getAttributionSummary: (range?: AnalyticsTimeRange) => Promise<any>;
|
|
55
58
|
getShortlinkPerformance: (range?: AnalyticsTimeRange) => Promise<any>;
|
|
56
|
-
getRevenueBySource: (range?: AnalyticsTimeRange
|
|
59
|
+
getRevenueBySource: (range?: AnalyticsTimeRange, filters?: {
|
|
60
|
+
productId?: string;
|
|
61
|
+
}) => Promise<any>;
|
|
57
62
|
getConversionFunnel: (range?: AnalyticsTimeRange) => Promise<{
|
|
58
63
|
totalSignups: any;
|
|
59
64
|
totalPurchases: any;
|
|
@@ -61,14 +66,151 @@ declare function createDatabaseProvider(db: any, schema: DatabaseAnalyticsSchema
|
|
|
61
66
|
conversionRate: number;
|
|
62
67
|
attributionCoverage: number;
|
|
63
68
|
}>;
|
|
64
|
-
|
|
69
|
+
getCommerceLaneSummary: (range?: AnalyticsTimeRange, filters?: {
|
|
70
|
+
productId?: string;
|
|
71
|
+
}) => Promise<{
|
|
72
|
+
commerceRecords: any;
|
|
73
|
+
paidPurchases: any;
|
|
74
|
+
paidRevenue: number;
|
|
75
|
+
accessGrants: any;
|
|
76
|
+
accessGrantRevenue: number;
|
|
77
|
+
freeUpgrades: any;
|
|
78
|
+
syntheticPurchases: any;
|
|
79
|
+
byAccessGrantReason: {
|
|
80
|
+
[k: string]: any;
|
|
81
|
+
};
|
|
82
|
+
}>;
|
|
83
|
+
getAttributedRevenueSummary: (range?: AnalyticsTimeRange, filters?: {
|
|
84
|
+
productId?: string;
|
|
85
|
+
}) => Promise<{
|
|
65
86
|
totalRevenue: number;
|
|
66
87
|
attributedRevenue: number;
|
|
67
88
|
unattributedRevenue: number;
|
|
68
89
|
attributionRate: number;
|
|
69
90
|
totalPurchases: any;
|
|
91
|
+
paidPurchases: any;
|
|
92
|
+
purchaseFieldAttributedPurchases: any;
|
|
93
|
+
purchaseFieldAttributedRevenue: number;
|
|
94
|
+
recoveredFromShortlinkAttributionTablePurchases: any;
|
|
95
|
+
recoveredFromShortlinkAttributionTableRevenue: number;
|
|
96
|
+
commerceRecords: any;
|
|
97
|
+
accessGrants: any;
|
|
98
|
+
freeUpgrades: any;
|
|
99
|
+
syntheticPurchases: any;
|
|
100
|
+
commerce: {
|
|
101
|
+
commerceRecords: any;
|
|
102
|
+
paidPurchases: any;
|
|
103
|
+
paidRevenue: number;
|
|
104
|
+
accessGrants: any;
|
|
105
|
+
accessGrantRevenue: number;
|
|
106
|
+
freeUpgrades: any;
|
|
107
|
+
syntheticPurchases: any;
|
|
108
|
+
byAccessGrantReason: {
|
|
109
|
+
[k: string]: any;
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
signals: {
|
|
113
|
+
shortlink: any;
|
|
114
|
+
utm: any;
|
|
115
|
+
paidClickId: any;
|
|
116
|
+
gaClientId: any;
|
|
117
|
+
selfReportedSource: any;
|
|
118
|
+
recoveredFromShortlinkAttributionTable: any;
|
|
119
|
+
internalFreeUpgrade: any;
|
|
120
|
+
};
|
|
70
121
|
}>;
|
|
71
122
|
getContentPurchaseCorrelation: (range?: AnalyticsTimeRange, limit?: number) => Promise<any>;
|
|
123
|
+
getCheckoutAttributionReceipt: (opts: {
|
|
124
|
+
purchaseId?: string;
|
|
125
|
+
}) => Promise<{
|
|
126
|
+
purchase: null;
|
|
127
|
+
checks: {
|
|
128
|
+
purchaseFound: boolean;
|
|
129
|
+
attributionSnapshot: boolean;
|
|
130
|
+
utm: boolean;
|
|
131
|
+
actualUtm: boolean;
|
|
132
|
+
clickId: boolean;
|
|
133
|
+
synthetic: boolean;
|
|
134
|
+
shortlink: boolean;
|
|
135
|
+
selfReportedSource: boolean;
|
|
136
|
+
gaClientId: boolean;
|
|
137
|
+
};
|
|
138
|
+
attribution: null;
|
|
139
|
+
legacy: {};
|
|
140
|
+
fieldKeys: never[];
|
|
141
|
+
} | {
|
|
142
|
+
purchase: {
|
|
143
|
+
id: any;
|
|
144
|
+
createdAt: any;
|
|
145
|
+
productId: any;
|
|
146
|
+
productName: any;
|
|
147
|
+
totalAmount: number;
|
|
148
|
+
status: any;
|
|
149
|
+
country: any;
|
|
150
|
+
};
|
|
151
|
+
checks: {
|
|
152
|
+
purchaseFound: boolean;
|
|
153
|
+
attributionSnapshot: boolean;
|
|
154
|
+
utm: boolean;
|
|
155
|
+
actualUtm: boolean;
|
|
156
|
+
clickId: boolean;
|
|
157
|
+
synthetic: boolean;
|
|
158
|
+
shortlink: boolean;
|
|
159
|
+
selfReportedSource: boolean;
|
|
160
|
+
gaClientId: boolean;
|
|
161
|
+
};
|
|
162
|
+
attribution: Record<string, any> | null;
|
|
163
|
+
legacy: any;
|
|
164
|
+
fieldKeys: string[];
|
|
165
|
+
}>;
|
|
166
|
+
getCheckoutSurveyFallbackReport: (range?: AnalyticsTimeRange, limit?: number, filters?: {
|
|
167
|
+
productId?: string;
|
|
168
|
+
}) => Promise<{
|
|
169
|
+
label: string;
|
|
170
|
+
productId: string | null;
|
|
171
|
+
totalDarkPurchases: any;
|
|
172
|
+
totalDarkRevenue: any;
|
|
173
|
+
exactPurchaseLinkedPurchases: number;
|
|
174
|
+
exactPurchaseLinkedRevenue: number;
|
|
175
|
+
userLinkedPurchases: number;
|
|
176
|
+
userLinkedRevenue: number;
|
|
177
|
+
byAnswer: {
|
|
178
|
+
answer: string;
|
|
179
|
+
confidence: 'exact_purchase_link' | 'user_linked';
|
|
180
|
+
purchases: number;
|
|
181
|
+
revenue: number;
|
|
182
|
+
}[];
|
|
183
|
+
notes: string[];
|
|
184
|
+
}>;
|
|
185
|
+
getValuePathSummary: (range?: AnalyticsTimeRange) => Promise<{
|
|
186
|
+
contacts: number;
|
|
187
|
+
events: any;
|
|
188
|
+
intents: any;
|
|
189
|
+
completedIntents: any;
|
|
190
|
+
pendingIntents: any;
|
|
191
|
+
blockedIntents: any;
|
|
192
|
+
answerEvents: any;
|
|
193
|
+
dripEvents: any;
|
|
194
|
+
enteredEvents: any;
|
|
195
|
+
participantsWithAnswerClicks: number;
|
|
196
|
+
participantsWithNoAnswerClicks: number;
|
|
197
|
+
terminalParticipants: number;
|
|
198
|
+
answerOptions: {
|
|
199
|
+
key: string;
|
|
200
|
+
step: string;
|
|
201
|
+
optionValue: string;
|
|
202
|
+
count: number;
|
|
203
|
+
}[];
|
|
204
|
+
answerSteps: {
|
|
205
|
+
step: string;
|
|
206
|
+
count: number;
|
|
207
|
+
}[];
|
|
208
|
+
terminalSteps: {
|
|
209
|
+
emailResourceId: string;
|
|
210
|
+
count: number;
|
|
211
|
+
}[];
|
|
212
|
+
notes: string[];
|
|
213
|
+
}>;
|
|
72
214
|
traceAttribution: (opts: {
|
|
73
215
|
email?: string;
|
|
74
216
|
purchaseId?: string;
|