@codecademy/tracking 1.0.11 → 1.0.12-alpha.4472ece6ec.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/dist/events/track.d.ts +1 -1
- package/dist/events/types.d.ts +17 -17
- package/dist/integrations/conditionallyLoadAnalytics.d.ts +1 -1
- package/dist/integrations/fetchDestinationsForWriteKey.d.ts +1 -1
- package/dist/integrations/index.d.ts +1 -1
- package/dist/integrations/mapDestinations.d.ts +1 -1
- package/dist/integrations/onetrust.d.ts +1 -1
- package/package.json +2 -5
package/dist/events/track.d.ts
CHANGED
package/dist/events/types.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Follows the format EventDataTypes[Category].[Event].EventData
|
|
4
4
|
* Category + Event gives the corresponding event table in redshift
|
|
5
5
|
*/
|
|
6
|
-
export
|
|
6
|
+
export type EventDataTypes = {
|
|
7
7
|
user: {
|
|
8
8
|
click: UserClickData;
|
|
9
9
|
visit: UserVisitData;
|
|
@@ -69,7 +69,7 @@ export declare type EventDataTypes = {
|
|
|
69
69
|
/**
|
|
70
70
|
* Base event data shared by all events
|
|
71
71
|
*/
|
|
72
|
-
export
|
|
72
|
+
export type BaseEventData = {
|
|
73
73
|
fullpath?: null;
|
|
74
74
|
search?: null;
|
|
75
75
|
path?: null;
|
|
@@ -81,13 +81,13 @@ export declare type BaseEventData = {
|
|
|
81
81
|
/**
|
|
82
82
|
* Generic type to use for event data not typed yet
|
|
83
83
|
*/
|
|
84
|
-
export
|
|
84
|
+
export type BaseEventAnyData = BaseEventData & {
|
|
85
85
|
[key: string]: any;
|
|
86
86
|
};
|
|
87
87
|
/**
|
|
88
88
|
* Options to pass to the tracking function
|
|
89
89
|
*/
|
|
90
|
-
export
|
|
90
|
+
export type TrackingOptions = {
|
|
91
91
|
/** tells backend not to merge user-identifying data onto the event payload */
|
|
92
92
|
gdprSafe?: boolean;
|
|
93
93
|
};
|
|
@@ -96,7 +96,7 @@ export declare type TrackingOptions = {
|
|
|
96
96
|
* These IDs get hashed into a single value and overwrite content_id before they are sent to
|
|
97
97
|
* redshift in lib/content_group_id.rb
|
|
98
98
|
*/
|
|
99
|
-
export
|
|
99
|
+
export type TrackingContentIds = {
|
|
100
100
|
assessment_id?: string;
|
|
101
101
|
content_item_id?: string;
|
|
102
102
|
exercise_id?: string;
|
|
@@ -112,7 +112,7 @@ export declare type TrackingContentIds = {
|
|
|
112
112
|
/**
|
|
113
113
|
* Shared data relevant for all user events
|
|
114
114
|
*/
|
|
115
|
-
export
|
|
115
|
+
export type UserSharedData = BaseEventData & {
|
|
116
116
|
/** the click target of the event */
|
|
117
117
|
target?: string;
|
|
118
118
|
/** the page the event is coming from */
|
|
@@ -136,7 +136,7 @@ export declare type UserSharedData = BaseEventData & {
|
|
|
136
136
|
* Instead, reuse existing properties, or make any additional properties generic so that they can be reused.
|
|
137
137
|
* https://www.notion.so/codecademy/Guide-to-Event-Tracking-Schema-5d40b09a297743f7a30a2690208194c8#800bbf6cdf2e44de9823cd75bcc574e5
|
|
138
138
|
*/
|
|
139
|
-
export
|
|
139
|
+
export type UserClickData = UserSharedData & {
|
|
140
140
|
target: string;
|
|
141
141
|
id?: string;
|
|
142
142
|
distinct_id?: string;
|
|
@@ -183,7 +183,7 @@ export declare type UserClickData = UserSharedData & {
|
|
|
183
183
|
* Instead, reuse existing properties, or make any additional properties generic so that they can be reused.
|
|
184
184
|
* https://www.notion.so/codecademy/Guide-to-Event-Tracking-Schema-5d40b09a297743f7a30a2690208194c8#800bbf6cdf2e44de9823cd75bcc574e5
|
|
185
185
|
*/
|
|
186
|
-
export
|
|
186
|
+
export type UserVisitData = UserSharedData & {
|
|
187
187
|
page_name: string;
|
|
188
188
|
category?: string;
|
|
189
189
|
distinct_id?: string;
|
|
@@ -205,19 +205,19 @@ export declare type UserVisitData = UserSharedData & {
|
|
|
205
205
|
lesson?: string;
|
|
206
206
|
is_ugc?: boolean;
|
|
207
207
|
};
|
|
208
|
-
export
|
|
208
|
+
export type UserImpressionData = Pick<UserSharedData, 'context' | 'source_codebase' | 'content_ids'> & {
|
|
209
209
|
page_name: string;
|
|
210
210
|
target: string;
|
|
211
211
|
slug?: string;
|
|
212
212
|
is_ugc?: boolean;
|
|
213
213
|
};
|
|
214
|
-
export
|
|
214
|
+
export type EventAnswerData = BaseEventData & {
|
|
215
215
|
question_index: number;
|
|
216
216
|
answer_index: number;
|
|
217
217
|
answer: any;
|
|
218
218
|
answer_slug: string;
|
|
219
219
|
};
|
|
220
|
-
export
|
|
220
|
+
export type User = {
|
|
221
221
|
id?: string;
|
|
222
222
|
auth_token: string;
|
|
223
223
|
profile_image_url?: string;
|
|
@@ -230,23 +230,23 @@ export declare type User = {
|
|
|
230
230
|
};
|
|
231
231
|
features: string[];
|
|
232
232
|
};
|
|
233
|
-
export
|
|
233
|
+
export type UseUserResponse = {
|
|
234
234
|
user?: User;
|
|
235
235
|
status: string;
|
|
236
236
|
};
|
|
237
|
-
export
|
|
237
|
+
export type PagePathVisitedData = BaseEventData & {
|
|
238
238
|
path_id: string;
|
|
239
239
|
path_full_title: string;
|
|
240
240
|
};
|
|
241
|
-
export
|
|
241
|
+
export type CoursePageVisitedData = BaseEventData & {
|
|
242
242
|
course_id: string;
|
|
243
243
|
course_full_title: string;
|
|
244
244
|
};
|
|
245
|
-
export
|
|
246
|
-
export
|
|
245
|
+
export type FilterType = string | string[] | number | boolean;
|
|
246
|
+
export type BusinessFilterData = BaseEventData & {
|
|
247
247
|
filter_key: string;
|
|
248
248
|
filter_value: FilterType;
|
|
249
249
|
};
|
|
250
|
-
export
|
|
250
|
+
export type BusinessSearchData = BaseEventData & {
|
|
251
251
|
search_query: string;
|
|
252
252
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SegmentAnalytics, UserIntegrationSummary } from './types';
|
|
2
|
-
export
|
|
2
|
+
export type AnalyticsLoadOptions = {
|
|
3
3
|
analytics: SegmentAnalytics;
|
|
4
4
|
destinationPreferences: Record<string, boolean>;
|
|
5
5
|
identifyPreferences: Record<string, boolean>;
|
package/package.json
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codecademy/tracking",
|
|
3
3
|
"description": "Tracking library for Codecademy",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.12-alpha.4472ece6ec.0",
|
|
5
5
|
"author": "Codecademy Engineering <dev@codecademy.com>",
|
|
6
|
-
"dependencies": {
|
|
7
|
-
"@babel/runtime": "^7.12.1"
|
|
8
|
-
},
|
|
9
6
|
"files": [
|
|
10
7
|
"dist/**"
|
|
11
8
|
],
|
|
@@ -16,5 +13,5 @@
|
|
|
16
13
|
"access": "public"
|
|
17
14
|
},
|
|
18
15
|
"repository": "git@github.com:codecademy-engineering/mono.git",
|
|
19
|
-
"gitHead": "
|
|
16
|
+
"gitHead": "84178a6ecc7198002c044626efa49b45536ec403"
|
|
20
17
|
}
|