@react-native-firebase/analytics 23.7.0 → 23.8.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/commonjs/index.js +38 -0
- package/dist/commonjs/index.js.map +1 -0
- package/dist/commonjs/modular.js +613 -0
- package/dist/commonjs/modular.js.map +1 -0
- package/dist/commonjs/namespaced.js +441 -0
- package/dist/commonjs/namespaced.js.map +1 -0
- package/dist/commonjs/package.json +1 -0
- package/dist/commonjs/struct.js +54 -0
- package/dist/commonjs/struct.js.map +1 -0
- package/dist/commonjs/structs.js +214 -0
- package/dist/commonjs/structs.js.map +1 -0
- package/dist/commonjs/types/analytics.js +79 -0
- package/dist/commonjs/types/analytics.js.map +1 -0
- package/dist/commonjs/types/web.js +2 -0
- package/dist/commonjs/types/web.js.map +1 -0
- package/dist/commonjs/version.js +9 -0
- package/dist/commonjs/version.js.map +1 -0
- package/dist/commonjs/web/RNFBAnalyticsModule.android.js +9 -0
- package/dist/commonjs/web/RNFBAnalyticsModule.android.js.map +1 -0
- package/dist/commonjs/web/RNFBAnalyticsModule.ios.js +9 -0
- package/dist/commonjs/web/RNFBAnalyticsModule.ios.js.map +1 -0
- package/dist/commonjs/web/RNFBAnalyticsModule.js +119 -0
- package/dist/commonjs/web/RNFBAnalyticsModule.js.map +1 -0
- package/dist/commonjs/web/api.js +294 -0
- package/dist/commonjs/web/api.js.map +1 -0
- package/{ios/RNFBAnalytics/RNFBAnalyticsModule.h → dist/module/index.js} +10 -6
- package/dist/module/index.js.map +1 -0
- package/{lib/modular/index.js → dist/module/modular.js} +43 -161
- package/dist/module/modular.js.map +1 -0
- package/dist/module/namespaced.js +438 -0
- package/dist/module/namespaced.js.map +1 -0
- package/dist/module/package.json +1 -0
- package/{lib → dist/module}/struct.js +12 -14
- package/dist/module/struct.js.map +1 -0
- package/dist/module/structs.js +210 -0
- package/dist/module/structs.js.map +1 -0
- package/dist/module/types/analytics.js +75 -0
- package/dist/module/types/analytics.js.map +1 -0
- package/dist/module/types/web.js +2 -0
- package/dist/module/types/web.js.map +1 -0
- package/dist/module/version.js +5 -0
- package/dist/module/version.js.map +1 -0
- package/dist/module/web/RNFBAnalyticsModule.android.js +6 -0
- package/dist/module/web/RNFBAnalyticsModule.android.js.map +1 -0
- package/dist/module/web/RNFBAnalyticsModule.ios.js +6 -0
- package/dist/module/web/RNFBAnalyticsModule.ios.js.map +1 -0
- package/{lib → dist/module}/web/RNFBAnalyticsModule.js +17 -21
- package/dist/module/web/RNFBAnalyticsModule.js.map +1 -0
- package/{lib → dist/module}/web/api.js +34 -77
- package/dist/module/web/api.js.map +1 -0
- package/dist/typescript/commonjs/lib/index.d.ts +5 -0
- package/dist/typescript/commonjs/lib/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/lib/modular.d.ts +476 -0
- package/dist/typescript/commonjs/lib/modular.d.ts.map +1 -0
- package/dist/typescript/commonjs/lib/namespaced.d.ts +12 -0
- package/dist/typescript/commonjs/lib/namespaced.d.ts.map +1 -0
- package/dist/typescript/commonjs/lib/struct.d.ts +3 -0
- package/dist/typescript/commonjs/lib/struct.d.ts.map +1 -0
- package/dist/typescript/commonjs/lib/structs.d.ts +1155 -0
- package/dist/typescript/commonjs/lib/structs.d.ts.map +1 -0
- package/dist/typescript/commonjs/lib/types/analytics.d.ts +944 -0
- package/dist/typescript/commonjs/lib/types/analytics.d.ts.map +1 -0
- package/dist/typescript/commonjs/lib/types/web.d.ts +36 -0
- package/dist/typescript/commonjs/lib/types/web.d.ts.map +1 -0
- package/dist/typescript/commonjs/lib/version.d.ts +2 -0
- package/dist/typescript/commonjs/lib/version.d.ts.map +1 -0
- package/dist/typescript/commonjs/lib/web/RNFBAnalyticsModule.android.d.ts +3 -0
- package/dist/typescript/commonjs/lib/web/RNFBAnalyticsModule.android.d.ts.map +1 -0
- package/dist/typescript/commonjs/lib/web/RNFBAnalyticsModule.d.ts +9 -0
- package/dist/typescript/commonjs/lib/web/RNFBAnalyticsModule.d.ts.map +1 -0
- package/dist/typescript/commonjs/lib/web/RNFBAnalyticsModule.ios.d.ts +3 -0
- package/dist/typescript/commonjs/lib/web/RNFBAnalyticsModule.ios.d.ts.map +1 -0
- package/dist/typescript/commonjs/lib/web/api.d.ts +37 -0
- package/dist/typescript/commonjs/lib/web/api.d.ts.map +1 -0
- package/dist/typescript/commonjs/package.json +1 -0
- package/dist/typescript/module/lib/index.d.ts +5 -0
- package/dist/typescript/module/lib/index.d.ts.map +1 -0
- package/dist/typescript/module/lib/modular.d.ts +476 -0
- package/dist/typescript/module/lib/modular.d.ts.map +1 -0
- package/dist/typescript/module/lib/namespaced.d.ts +12 -0
- package/dist/typescript/module/lib/namespaced.d.ts.map +1 -0
- package/dist/typescript/module/lib/struct.d.ts +3 -0
- package/dist/typescript/module/lib/struct.d.ts.map +1 -0
- package/dist/typescript/module/lib/structs.d.ts +1155 -0
- package/dist/typescript/module/lib/structs.d.ts.map +1 -0
- package/dist/typescript/module/lib/types/analytics.d.ts +944 -0
- package/dist/typescript/module/lib/types/analytics.d.ts.map +1 -0
- package/dist/typescript/module/lib/types/web.d.ts +36 -0
- package/dist/typescript/module/lib/types/web.d.ts.map +1 -0
- package/dist/typescript/module/lib/version.d.ts +2 -0
- package/dist/typescript/module/lib/version.d.ts.map +1 -0
- package/dist/typescript/module/lib/web/RNFBAnalyticsModule.android.d.ts +3 -0
- package/dist/typescript/module/lib/web/RNFBAnalyticsModule.android.d.ts.map +1 -0
- package/dist/typescript/module/lib/web/RNFBAnalyticsModule.d.ts +9 -0
- package/dist/typescript/module/lib/web/RNFBAnalyticsModule.d.ts.map +1 -0
- package/dist/typescript/module/lib/web/RNFBAnalyticsModule.ios.d.ts +3 -0
- package/dist/typescript/module/lib/web/RNFBAnalyticsModule.ios.d.ts.map +1 -0
- package/dist/typescript/module/lib/web/api.d.ts +37 -0
- package/dist/typescript/module/lib/web/api.d.ts.map +1 -0
- package/dist/typescript/module/package.json +1 -0
- package/lib/index.ts +73 -0
- package/lib/modular.ts +1026 -0
- package/lib/{index.js → namespaced.ts} +145 -72
- package/lib/struct.ts +61 -0
- package/lib/{structs.js → structs.ts} +3 -3
- package/lib/types/analytics.ts +1078 -0
- package/lib/types/web.ts +56 -0
- package/lib/version.ts +2 -0
- package/lib/web/RNFBAnalyticsModule.android.ts +3 -0
- package/lib/web/RNFBAnalyticsModule.ios.ts +3 -0
- package/lib/web/RNFBAnalyticsModule.ts +135 -0
- package/lib/web/api.ts +366 -0
- package/package.json +61 -7
- package/CHANGELOG.md +0 -1085
- package/RNFBAnalytics.podspec +0 -71
- package/android/.editorconfig +0 -10
- package/android/build.gradle +0 -177
- package/android/lint.xml +0 -5
- package/android/settings.gradle +0 -1
- package/android/src/main/AndroidManifest.xml +0 -21
- package/android/src/main/java/io/invertase/firebase/analytics/UniversalFirebaseAnalyticsModule.java +0 -141
- package/android/src/reactnative/AndroidManifest.xml +0 -2
- package/android/src/reactnative/java/io/invertase/firebase/analytics/ReactNativeFirebaseAnalyticsModule.java +0 -213
- package/android/src/reactnative/java/io/invertase/firebase/analytics/ReactNativeFirebaseAnalyticsPackage.java +0 -41
- package/ios/RNFBAnalytics/RNFBAnalyticsModule.m +0 -268
- package/ios/RNFBAnalytics.xcodeproj/project.pbxproj +0 -349
- package/ios/RNFBAnalytics.xcodeproj/xcshareddata/IDETemplateMacros.plist +0 -24
- package/lib/index.d.ts +0 -1903
- package/lib/modular/index.d.ts +0 -1267
- package/lib/version.js +0 -2
- package/lib/web/RNFBAnalyticsModule.android.js +0 -2
- package/lib/web/RNFBAnalyticsModule.ios.js +0 -2
|
@@ -0,0 +1,1078 @@
|
|
|
1
|
+
import type { ReactNativeFirebase } from '@react-native-firebase/app';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A currency amount.
|
|
5
|
+
*/
|
|
6
|
+
export type Currency = number;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Consent status string values.
|
|
10
|
+
*/
|
|
11
|
+
export type ConsentStatusString = 'granted' | 'denied';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Promotion object for analytics events.
|
|
15
|
+
*/
|
|
16
|
+
export interface Promotion {
|
|
17
|
+
/**
|
|
18
|
+
* The name of a creative used in a promotional spot
|
|
19
|
+
*/
|
|
20
|
+
creative_name?: string;
|
|
21
|
+
/**
|
|
22
|
+
* The name of a creative slot
|
|
23
|
+
*/
|
|
24
|
+
creative_slot?: string;
|
|
25
|
+
/**
|
|
26
|
+
* The ID of a product promotion
|
|
27
|
+
*/
|
|
28
|
+
promotion_id?: string;
|
|
29
|
+
/**
|
|
30
|
+
* The name of a product promotion
|
|
31
|
+
*/
|
|
32
|
+
promotion_name?: string;
|
|
33
|
+
[key: string]: any;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface Item {
|
|
37
|
+
/**
|
|
38
|
+
* The item's brand.
|
|
39
|
+
*/
|
|
40
|
+
item_brand?: string;
|
|
41
|
+
/**
|
|
42
|
+
* An item ID.
|
|
43
|
+
*/
|
|
44
|
+
item_id?: string;
|
|
45
|
+
/**
|
|
46
|
+
* An item name.
|
|
47
|
+
*/
|
|
48
|
+
item_name?: string;
|
|
49
|
+
/**
|
|
50
|
+
* First class item category.
|
|
51
|
+
*/
|
|
52
|
+
item_category?: string;
|
|
53
|
+
/**
|
|
54
|
+
* Second class item category.
|
|
55
|
+
*/
|
|
56
|
+
item_category2?: string;
|
|
57
|
+
/**
|
|
58
|
+
* Third class item category.
|
|
59
|
+
*/
|
|
60
|
+
item_category3?: string;
|
|
61
|
+
/**
|
|
62
|
+
* Fourth class item category.
|
|
63
|
+
*/
|
|
64
|
+
item_category4?: string;
|
|
65
|
+
/**
|
|
66
|
+
* Fifth class item category.
|
|
67
|
+
*/
|
|
68
|
+
item_category5?: string;
|
|
69
|
+
/**
|
|
70
|
+
* The ID of the list in which the item was presented to the user.
|
|
71
|
+
*/
|
|
72
|
+
item_list_id?: string;
|
|
73
|
+
/**
|
|
74
|
+
* The name of the list in which the item was presented to the user.
|
|
75
|
+
*/
|
|
76
|
+
item_list_name?: string;
|
|
77
|
+
/**
|
|
78
|
+
* The Google [Place ID](https://developers.google.com/places/place-id) that corresponds to the associated item (String). Alternatively, you can supply your own custom Location ID.
|
|
79
|
+
*/
|
|
80
|
+
location_id?: string;
|
|
81
|
+
/**
|
|
82
|
+
* The Item variant.
|
|
83
|
+
*/
|
|
84
|
+
item_variant?: string;
|
|
85
|
+
/**
|
|
86
|
+
* The Item quantity.
|
|
87
|
+
*/
|
|
88
|
+
quantity?: number;
|
|
89
|
+
/**
|
|
90
|
+
* The Item price.
|
|
91
|
+
* Note that firebase analytics will display this as an integer with trailing zeros, due to some firebase-internal conversion.
|
|
92
|
+
* See https://github.com/invertase/react-native-firebase/issues/4578#issuecomment-771703420 for more information
|
|
93
|
+
*/
|
|
94
|
+
price?: number;
|
|
95
|
+
/**
|
|
96
|
+
* The affiliation of the item.
|
|
97
|
+
*/
|
|
98
|
+
affiliation?: string;
|
|
99
|
+
/**
|
|
100
|
+
* The coupon associated with the item.
|
|
101
|
+
*/
|
|
102
|
+
coupon?: string;
|
|
103
|
+
/**
|
|
104
|
+
* The creative name associated with the item.
|
|
105
|
+
*/
|
|
106
|
+
creative_name?: string;
|
|
107
|
+
/**
|
|
108
|
+
* The creative slot associated with the item.
|
|
109
|
+
*/
|
|
110
|
+
creative_slot?: string;
|
|
111
|
+
/**
|
|
112
|
+
* The discount applied to the item.
|
|
113
|
+
*/
|
|
114
|
+
discount?: Currency;
|
|
115
|
+
/**
|
|
116
|
+
* The index of the item.
|
|
117
|
+
*/
|
|
118
|
+
index?: number;
|
|
119
|
+
/**
|
|
120
|
+
* The promotion ID associated with the item.
|
|
121
|
+
*/
|
|
122
|
+
promotion_id?: string;
|
|
123
|
+
/**
|
|
124
|
+
* The promotion name associated with the item.
|
|
125
|
+
*/
|
|
126
|
+
promotion_name?: string;
|
|
127
|
+
/**
|
|
128
|
+
* Custom event parameters. The parameter names can be up to 40 characters long and must start with an alphabetic character and contain only alphanumeric characters and underscores. String parameter values can be up to 100 characters long.
|
|
129
|
+
* The "firebase_", "google_" and "ga_" prefixes are reserved and should not be used for parameter names.
|
|
130
|
+
*/
|
|
131
|
+
[key: string]: string | number | undefined;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export interface AddPaymentInfoEventParameters {
|
|
135
|
+
items?: Item[];
|
|
136
|
+
/**
|
|
137
|
+
* Purchase currency in 3 letter [ISO_4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format. E.g. `USD`.
|
|
138
|
+
*/
|
|
139
|
+
currency?: string;
|
|
140
|
+
value?: number;
|
|
141
|
+
/**
|
|
142
|
+
* Coupon code for a purchasable item.
|
|
143
|
+
*/
|
|
144
|
+
coupon?: string;
|
|
145
|
+
/**
|
|
146
|
+
* The chosen method of payment
|
|
147
|
+
*/
|
|
148
|
+
payment_type?: string;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export interface AddShippingInfoEventParameters {
|
|
152
|
+
items?: Item[];
|
|
153
|
+
/**
|
|
154
|
+
* Purchase currency in 3 letter [ISO_4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format. E.g. `USD`.
|
|
155
|
+
*/
|
|
156
|
+
currency?: string;
|
|
157
|
+
value?: number;
|
|
158
|
+
/**
|
|
159
|
+
* Coupon code for a purchasable item.
|
|
160
|
+
*/
|
|
161
|
+
coupon?: string;
|
|
162
|
+
/**
|
|
163
|
+
* The shipping tier (e.g. Ground, Air, Next-day) selected for delivery of the purchased item
|
|
164
|
+
*/
|
|
165
|
+
shipping_tier?: string;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export interface AddToCartEventParameters {
|
|
169
|
+
items?: Item[];
|
|
170
|
+
/**
|
|
171
|
+
* Purchase currency in 3 letter [ISO_4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format. E.g. `USD`.
|
|
172
|
+
*/
|
|
173
|
+
currency?: string;
|
|
174
|
+
/**
|
|
175
|
+
* value of item
|
|
176
|
+
*/
|
|
177
|
+
value?: number;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
export interface AddToWishlistEventParameters {
|
|
181
|
+
items?: Item[];
|
|
182
|
+
/**
|
|
183
|
+
* Purchase currency in 3 letter [ISO_4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format. E.g. `USD`.
|
|
184
|
+
*/
|
|
185
|
+
currency?: string;
|
|
186
|
+
value?: number;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export interface BeginCheckoutEventParameters {
|
|
190
|
+
/**
|
|
191
|
+
* Purchase currency in 3 letter [ISO_4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format. E.g. `USD`.
|
|
192
|
+
*/
|
|
193
|
+
//TODO if value is a param, so must currency: https://firebase.google.com/docs/reference/android/com/google/firebase/analytics/FirebaseAnalytics.Event#public-static-final-string-add_to_wishlist
|
|
194
|
+
currency?: string;
|
|
195
|
+
value?: number;
|
|
196
|
+
/**
|
|
197
|
+
* Coupon code for a purchasable item.
|
|
198
|
+
*/
|
|
199
|
+
coupon?: string;
|
|
200
|
+
|
|
201
|
+
items?: Item[];
|
|
202
|
+
/**
|
|
203
|
+
* Custom event parameters.
|
|
204
|
+
*/
|
|
205
|
+
[key: string]: any;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
export interface CampaignDetailsEventParameters {
|
|
209
|
+
/**
|
|
210
|
+
* Used to identify a search engine, newsletter, or other source.
|
|
211
|
+
*/
|
|
212
|
+
source: string;
|
|
213
|
+
/**
|
|
214
|
+
* Used to identify a medium such as email or cost-per-click (cpc).
|
|
215
|
+
*/
|
|
216
|
+
medium: string;
|
|
217
|
+
/**
|
|
218
|
+
* Used for keyword analysis to identify a specific product promotion or strategic campaign.
|
|
219
|
+
*/
|
|
220
|
+
campaign: string;
|
|
221
|
+
/**
|
|
222
|
+
* Used with paid search to supply the keywords for ads.
|
|
223
|
+
*/
|
|
224
|
+
term?: string;
|
|
225
|
+
/**
|
|
226
|
+
* Used for A/B testing and content-targeted ads to differentiate ads or links that point to the same URL.
|
|
227
|
+
*/
|
|
228
|
+
content?: string;
|
|
229
|
+
/**
|
|
230
|
+
* A campaign detail click ID.
|
|
231
|
+
*/
|
|
232
|
+
aclid?: string;
|
|
233
|
+
cp1?: string;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
//
|
|
237
|
+
// Unsupported in "Enhanced Ecommerce reports":
|
|
238
|
+
// https://firebase.google.com/docs/reference/android/com/google/firebase/analytics/FirebaseAnalytics.Event#public-static-final-string-checkout_progress
|
|
239
|
+
//
|
|
240
|
+
// export interface CheckoutProgressEventParameters {
|
|
241
|
+
// checkout_step: string;
|
|
242
|
+
// checkout_options: string;
|
|
243
|
+
// }
|
|
244
|
+
|
|
245
|
+
export interface EarnVirtualCurrencyEventParameters {
|
|
246
|
+
/**
|
|
247
|
+
* Name of virtual currency type. E.g. `gems`.
|
|
248
|
+
*/
|
|
249
|
+
virtual_currency_name: string;
|
|
250
|
+
/**
|
|
251
|
+
* A context-specific numeric value which is accumulated automatically for each event type. Values
|
|
252
|
+
* can include revenue, distance, time and points.
|
|
253
|
+
*/
|
|
254
|
+
value: number;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
export interface GenerateLeadEventParameters {
|
|
258
|
+
/**
|
|
259
|
+
* Purchase currency in 3 letter [ISO_4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format. E.g. `USD`.
|
|
260
|
+
*/
|
|
261
|
+
currency?: string;
|
|
262
|
+
/**
|
|
263
|
+
* A context-specific numeric value which is accumulated automatically for each event type. Values
|
|
264
|
+
* can include revenue, distance, time and points. When a value is set, the accompanying `currency`
|
|
265
|
+
* parameter should also be defined.
|
|
266
|
+
*/
|
|
267
|
+
value?: number;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
export interface JoinGroupEventParameters {
|
|
271
|
+
/**
|
|
272
|
+
* Group/clan/guild id.
|
|
273
|
+
*/
|
|
274
|
+
group_id: string;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
export interface LevelEndEventParameters {
|
|
278
|
+
/**
|
|
279
|
+
* Level in game.
|
|
280
|
+
*/
|
|
281
|
+
level: number;
|
|
282
|
+
/**
|
|
283
|
+
* The result of an operation.
|
|
284
|
+
*/
|
|
285
|
+
success?: string;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
export interface LevelStartEventParameters {
|
|
289
|
+
/**
|
|
290
|
+
* Level in game.
|
|
291
|
+
*/
|
|
292
|
+
level: number;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
export interface LevelUpEventParameters {
|
|
296
|
+
/**
|
|
297
|
+
* Level in game.
|
|
298
|
+
*/
|
|
299
|
+
level: number;
|
|
300
|
+
/**
|
|
301
|
+
* Character used in game.
|
|
302
|
+
*/
|
|
303
|
+
character?: string;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
export interface LoginEventParameters {
|
|
307
|
+
/**
|
|
308
|
+
* The login method. E.g. `facebook.com`.
|
|
309
|
+
*/
|
|
310
|
+
method: string;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
export interface PostScoreEventParameters {
|
|
314
|
+
/**
|
|
315
|
+
* Score in game.
|
|
316
|
+
*/
|
|
317
|
+
score: number;
|
|
318
|
+
/**
|
|
319
|
+
* Level in game.
|
|
320
|
+
*/
|
|
321
|
+
level?: number;
|
|
322
|
+
/**
|
|
323
|
+
* Character used in game.
|
|
324
|
+
*/
|
|
325
|
+
character?: string;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
export interface PurchaseEventParameters {
|
|
329
|
+
/**
|
|
330
|
+
* A product affiliation to designate a supplying company or brick and mortar store location
|
|
331
|
+
*/
|
|
332
|
+
affiliation?: string;
|
|
333
|
+
/**
|
|
334
|
+
* Coupon code for a purchasable item.
|
|
335
|
+
*/
|
|
336
|
+
coupon?: string;
|
|
337
|
+
/**
|
|
338
|
+
* Purchase currency in 3 letter [ISO_4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format. E.g. `USD`.
|
|
339
|
+
*/
|
|
340
|
+
currency?: string;
|
|
341
|
+
|
|
342
|
+
items?: Item[];
|
|
343
|
+
/**
|
|
344
|
+
* Shipping cost.
|
|
345
|
+
*/
|
|
346
|
+
shipping?: number;
|
|
347
|
+
/**
|
|
348
|
+
* Tax amount.
|
|
349
|
+
*/
|
|
350
|
+
tax?: number;
|
|
351
|
+
/**
|
|
352
|
+
* A context-specific numeric value which is accumulated automatically for each event type. Values
|
|
353
|
+
* can include revenue, distance, time and points. When a value is set, the accompanying `currency`
|
|
354
|
+
* parameter should also be defined.
|
|
355
|
+
*/
|
|
356
|
+
value?: number;
|
|
357
|
+
/**
|
|
358
|
+
* A single ID for a ecommerce group transaction.
|
|
359
|
+
*/
|
|
360
|
+
transaction_id?: string;
|
|
361
|
+
/**
|
|
362
|
+
* Custom event parameters.
|
|
363
|
+
*/
|
|
364
|
+
[key: string]: any;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
export interface ScreenViewParameters {
|
|
368
|
+
/**
|
|
369
|
+
* Screen name the user is currently viewing.
|
|
370
|
+
*/
|
|
371
|
+
screen_name?: string;
|
|
372
|
+
/**
|
|
373
|
+
* Current class associated with the view the user is currently viewing.
|
|
374
|
+
*/
|
|
375
|
+
screen_class?: string;
|
|
376
|
+
|
|
377
|
+
/**
|
|
378
|
+
* Custom event parameters.
|
|
379
|
+
*/
|
|
380
|
+
[key: string]: any;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
export interface RefundEventParameters {
|
|
384
|
+
/**
|
|
385
|
+
* A product affiliation to designate a supplying company or brick and mortar store location
|
|
386
|
+
*/
|
|
387
|
+
affiliation?: string;
|
|
388
|
+
/**
|
|
389
|
+
* Coupon code for a purchasable item.
|
|
390
|
+
*/
|
|
391
|
+
coupon?: string;
|
|
392
|
+
/**
|
|
393
|
+
* Purchase currency in 3 letter [ISO_4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format. E.g. `USD`.
|
|
394
|
+
*/
|
|
395
|
+
currency?: string;
|
|
396
|
+
|
|
397
|
+
items?: Item[];
|
|
398
|
+
/**
|
|
399
|
+
* Shipping cost.
|
|
400
|
+
*/
|
|
401
|
+
shipping?: number;
|
|
402
|
+
/**
|
|
403
|
+
* Tax amount.
|
|
404
|
+
*/
|
|
405
|
+
tax?: number;
|
|
406
|
+
/**
|
|
407
|
+
* A context-specific numeric value which is accumulated automatically for each event type. Values
|
|
408
|
+
* can include revenue, distance, time and points. When a value is set, the accompanying `currency`
|
|
409
|
+
* parameter should also be defined.
|
|
410
|
+
*/
|
|
411
|
+
value?: number;
|
|
412
|
+
/**
|
|
413
|
+
* A single ID for a ecommerce group transaction.
|
|
414
|
+
*/
|
|
415
|
+
transaction_id?: string;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
export interface RemoveFromCartEventParameters {
|
|
419
|
+
items?: Item[];
|
|
420
|
+
/**
|
|
421
|
+
* A context-specific numeric value which is accumulated automatically for each event type. Values
|
|
422
|
+
* can include revenue, distance, time and points. When a value is set, the accompanying `currency`
|
|
423
|
+
* parameter should also be defined.
|
|
424
|
+
*/
|
|
425
|
+
value?: number;
|
|
426
|
+
/**
|
|
427
|
+
* Purchase currency in 3 letter [ISO_4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format. E.g. `USD`.
|
|
428
|
+
x */
|
|
429
|
+
currency?: string;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
export interface SearchEventParameters {
|
|
433
|
+
search_term: string;
|
|
434
|
+
/**
|
|
435
|
+
* Number of nights staying at hotel.
|
|
436
|
+
*/
|
|
437
|
+
number_of_nights?: number;
|
|
438
|
+
/**
|
|
439
|
+
* Number of rooms for travel events.
|
|
440
|
+
*/
|
|
441
|
+
number_of_rooms?: number;
|
|
442
|
+
/**
|
|
443
|
+
* Number of passengers traveling.
|
|
444
|
+
*/
|
|
445
|
+
number_of_passengers?: number;
|
|
446
|
+
/**
|
|
447
|
+
* Flight or Travel origin. E.g. `Mountain View, CA`.
|
|
448
|
+
*/
|
|
449
|
+
origin?: string;
|
|
450
|
+
/**
|
|
451
|
+
* Flight or Travel destination. E.g. `Mountain View, CA`.
|
|
452
|
+
*/
|
|
453
|
+
destination?: string;
|
|
454
|
+
/**
|
|
455
|
+
* The departure date, check-in date, or rental start date for the item (String). The parameter expects a date formatted as YYYY-MM-DD.
|
|
456
|
+
*/
|
|
457
|
+
start_date?: string;
|
|
458
|
+
/**
|
|
459
|
+
* The arrival date, check-out date, or rental end date for the item (String). The parameter expects a date formatted as YYYY-MM-DD.
|
|
460
|
+
*/
|
|
461
|
+
end_date?: string;
|
|
462
|
+
/**
|
|
463
|
+
* Travel class. E.g. `business`.
|
|
464
|
+
*/
|
|
465
|
+
travel_class?: string;
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
export interface SelectContentEventParameters {
|
|
469
|
+
content_type: string;
|
|
470
|
+
/**
|
|
471
|
+
* An item ID.
|
|
472
|
+
*/
|
|
473
|
+
item_id: string;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
export interface SelectItemEventParameters {
|
|
477
|
+
items?: Item[];
|
|
478
|
+
content_type: string;
|
|
479
|
+
/**
|
|
480
|
+
* The ID of the list in which the item was presented to the user
|
|
481
|
+
*/
|
|
482
|
+
item_list_id: string;
|
|
483
|
+
/**
|
|
484
|
+
* The name of the list in which the item was presented to the user
|
|
485
|
+
*/
|
|
486
|
+
item_list_name: string;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
export interface SetCheckoutOptionEventParameters {
|
|
490
|
+
checkout_step?: EventParams['checkout_step'];
|
|
491
|
+
checkout_option?: EventParams['checkout_option'];
|
|
492
|
+
|
|
493
|
+
[key: string]: any;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
export interface SelectPromotionEventParameters {
|
|
497
|
+
/**
|
|
498
|
+
* The name of a creative used in a promotional spot
|
|
499
|
+
*/
|
|
500
|
+
creative_name: string;
|
|
501
|
+
/**
|
|
502
|
+
* The name of a creative slot
|
|
503
|
+
*/
|
|
504
|
+
creative_slot: string;
|
|
505
|
+
items?: Item[];
|
|
506
|
+
/**
|
|
507
|
+
* The location associated with the event. Preferred to be the Google Place ID that corresponds to the associated item but could be overridden to a custom location ID string
|
|
508
|
+
*/
|
|
509
|
+
location_id: string;
|
|
510
|
+
/**
|
|
511
|
+
* The ID of a product promotion
|
|
512
|
+
*/
|
|
513
|
+
promotion_id: string;
|
|
514
|
+
/**
|
|
515
|
+
* The name of a product promotion
|
|
516
|
+
*/
|
|
517
|
+
promotion_name: string;
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
export interface ShareEventParameters {
|
|
521
|
+
/**
|
|
522
|
+
* Type of content selected.
|
|
523
|
+
*/
|
|
524
|
+
content_type: string;
|
|
525
|
+
/**
|
|
526
|
+
* An item ID.
|
|
527
|
+
*/
|
|
528
|
+
item_id: string;
|
|
529
|
+
/**
|
|
530
|
+
* A particular approach used in an operation; for example, "facebook" or "email" in the context of a sign_up or login event.
|
|
531
|
+
*/
|
|
532
|
+
method: string;
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
export interface SignUpEventParameters {
|
|
536
|
+
/**
|
|
537
|
+
* A particular approach used in an operation; for example, "facebook" or "email" in the context of a sign_up or login event.
|
|
538
|
+
*/
|
|
539
|
+
method: string;
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
export interface SpendVirtualCurrencyEventParameters {
|
|
543
|
+
/**
|
|
544
|
+
* An item name.
|
|
545
|
+
*/
|
|
546
|
+
item_name: string;
|
|
547
|
+
/**
|
|
548
|
+
* Name of virtual currency type. E.g. `gems`.
|
|
549
|
+
*/
|
|
550
|
+
virtual_currency_name: string;
|
|
551
|
+
/**
|
|
552
|
+
* A context-specific numeric value which is accumulated automatically for each event type. Values
|
|
553
|
+
* can include revenue, distance, time and points. When a value is set, the accompanying `currency`
|
|
554
|
+
* parameter should also be defined.
|
|
555
|
+
*/
|
|
556
|
+
value: number;
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
export interface UnlockAchievementEventParameters {
|
|
560
|
+
/**
|
|
561
|
+
* Game achievement ID (String).
|
|
562
|
+
*/
|
|
563
|
+
achievement_id: string;
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
export interface ViewCartEventParameters {
|
|
567
|
+
items?: Item[];
|
|
568
|
+
/**
|
|
569
|
+
* Purchase currency in 3 letter [ISO_4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format. E.g. `USD`.
|
|
570
|
+
*/
|
|
571
|
+
currency?: string;
|
|
572
|
+
/**
|
|
573
|
+
* A context-specific numeric value which is accumulated automatically for each event type. Values
|
|
574
|
+
* can include revenue, distance, time and points. When a value is set, the accompanying `currency`
|
|
575
|
+
* parameter should also be defined.
|
|
576
|
+
*/
|
|
577
|
+
value?: number;
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
export interface ViewItemEventParameters {
|
|
581
|
+
items?: Item[];
|
|
582
|
+
/**
|
|
583
|
+
* Purchase currency in 3 letter [ISO_4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format. E.g. `USD`.
|
|
584
|
+
*/
|
|
585
|
+
currency?: string;
|
|
586
|
+
/**
|
|
587
|
+
* A context-specific numeric value which is accumulated automatically for each event type. Values
|
|
588
|
+
* can include revenue, distance, time and points. When a value is set, the accompanying `currency`
|
|
589
|
+
* parameter should also be defined.
|
|
590
|
+
*/
|
|
591
|
+
value?: number;
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
export interface ViewSearchResultsParameters {
|
|
595
|
+
/**
|
|
596
|
+
* The search string/keywords used.
|
|
597
|
+
*/
|
|
598
|
+
search_term: string;
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
export interface ViewItemListEventParameters {
|
|
602
|
+
items?: Item[];
|
|
603
|
+
/**
|
|
604
|
+
* The ID of the list in which the item was presented to the user
|
|
605
|
+
*/
|
|
606
|
+
item_list_id?: string;
|
|
607
|
+
/**
|
|
608
|
+
* The name of the list in which the item was presented to the user
|
|
609
|
+
*/
|
|
610
|
+
item_list_name?: string;
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
export interface ViewPromotionEventParameters {
|
|
614
|
+
items?: Item[];
|
|
615
|
+
/**
|
|
616
|
+
* The location associated with the event. Preferred to be the Google Place ID that corresponds to the associated item but could be overridden to a custom location ID string
|
|
617
|
+
*/
|
|
618
|
+
location_id?: string;
|
|
619
|
+
/**
|
|
620
|
+
* The name of a creative used in a promotional spot
|
|
621
|
+
*/
|
|
622
|
+
creative_name?: string;
|
|
623
|
+
/**
|
|
624
|
+
* The name of a creative slot
|
|
625
|
+
*/
|
|
626
|
+
creative_slot?: string;
|
|
627
|
+
/**
|
|
628
|
+
* The ID of a product promotion
|
|
629
|
+
*/
|
|
630
|
+
promotion_id?: string;
|
|
631
|
+
/**
|
|
632
|
+
* The name of a product promotion
|
|
633
|
+
*/
|
|
634
|
+
promotion_name?: string;
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
export interface AddShippingInfoParameters {
|
|
638
|
+
items?: Item[];
|
|
639
|
+
/**
|
|
640
|
+
* Purchase currency in 3 letter [ISO_4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format. E.g. `USD`.
|
|
641
|
+
*/
|
|
642
|
+
currency?: string;
|
|
643
|
+
/**
|
|
644
|
+
* A context-specific numeric value which is accumulated automatically for each event type. Values
|
|
645
|
+
* can include revenue, distance, time and points. When a value is set, the accompanying `currency`
|
|
646
|
+
* parameter should also be defined.
|
|
647
|
+
*/
|
|
648
|
+
value?: number;
|
|
649
|
+
/**
|
|
650
|
+
* Coupon code for a purchasable item.
|
|
651
|
+
*/
|
|
652
|
+
coupon?: string;
|
|
653
|
+
/**
|
|
654
|
+
* The shipping tier (e.g. Ground, Air, Next-day) selected for delivery of the purchased item
|
|
655
|
+
*/
|
|
656
|
+
shipping_tier?: string;
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
/**
|
|
660
|
+
* Standard gtag.js event parameters. For more information, see the GA4 reference documentation. Web only.
|
|
661
|
+
*/
|
|
662
|
+
export interface EventParams {
|
|
663
|
+
checkout_option?: string;
|
|
664
|
+
checkout_step?: number;
|
|
665
|
+
item_id?: string;
|
|
666
|
+
content_type?: string;
|
|
667
|
+
coupon?: string;
|
|
668
|
+
currency?: string;
|
|
669
|
+
description?: string;
|
|
670
|
+
fatal?: boolean;
|
|
671
|
+
items?: Item[];
|
|
672
|
+
method?: string;
|
|
673
|
+
number?: string;
|
|
674
|
+
promotions?: Promotion[];
|
|
675
|
+
screen_name?: string;
|
|
676
|
+
/**
|
|
677
|
+
* Firebase-specific. Use to log a `screen_name` to Firebase Analytics.
|
|
678
|
+
*/
|
|
679
|
+
firebase_screen?: string;
|
|
680
|
+
/**
|
|
681
|
+
* Firebase-specific. Use to log a `screen_class` to Firebase Analytics.
|
|
682
|
+
*/
|
|
683
|
+
firebase_screen_class?: string;
|
|
684
|
+
search_term?: string;
|
|
685
|
+
shipping?: Currency;
|
|
686
|
+
tax?: Currency;
|
|
687
|
+
transaction_id?: string;
|
|
688
|
+
value?: number;
|
|
689
|
+
event_label?: string;
|
|
690
|
+
event_category?: string;
|
|
691
|
+
shipping_tier?: string;
|
|
692
|
+
item_list_id?: string;
|
|
693
|
+
item_list_name?: string;
|
|
694
|
+
promotion_id?: string;
|
|
695
|
+
promotion_name?: string;
|
|
696
|
+
payment_type?: string;
|
|
697
|
+
affiliation?: string;
|
|
698
|
+
page_title?: string;
|
|
699
|
+
page_location?: string;
|
|
700
|
+
page_path?: string;
|
|
701
|
+
|
|
702
|
+
[key: string]: unknown;
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
/**
|
|
706
|
+
* Unsupported in "Enhanced Ecommerce reports":
|
|
707
|
+
* https://firebase.google.com/docs/reference/android/com/google/firebase/analytics/FirebaseAnalytics.Event#public-static-final-string-view_search_results
|
|
708
|
+
*/
|
|
709
|
+
// export interface ViewSearchResults {
|
|
710
|
+
// /**
|
|
711
|
+
// * The search string/keywords used.
|
|
712
|
+
// */
|
|
713
|
+
// search_term: string;
|
|
714
|
+
// }
|
|
715
|
+
|
|
716
|
+
export interface Statics {
|
|
717
|
+
SDK_VERSION: string;
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
/**
|
|
721
|
+
* Analytics instance initialization options. Web only.
|
|
722
|
+
*/
|
|
723
|
+
export interface AnalyticsSettings {
|
|
724
|
+
config?: GtagConfigParams | EventParams;
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
/**
|
|
728
|
+
* Additional options that can be passed to Analytics method calls such as logEvent. Web only.
|
|
729
|
+
*/
|
|
730
|
+
export interface AnalyticsCallOptions {
|
|
731
|
+
/**
|
|
732
|
+
* If true, this config or event call applies globally to all Google Analytics properties on the page. Web only.
|
|
733
|
+
*/
|
|
734
|
+
global: boolean;
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
/**
|
|
738
|
+
* A set of common Google Analytics config settings recognized by gtag.js. Web only.
|
|
739
|
+
*/
|
|
740
|
+
export interface GtagConfigParams {
|
|
741
|
+
/**
|
|
742
|
+
* Whether or not a page view should be sent.
|
|
743
|
+
* If set to true (default), a page view is automatically sent upon initialization
|
|
744
|
+
* of analytics.
|
|
745
|
+
* See {@link https://developers.google.com/analytics/devguides/collection/ga4/page-view | Page views }
|
|
746
|
+
*/
|
|
747
|
+
send_page_view?: boolean;
|
|
748
|
+
/**
|
|
749
|
+
* The title of the page.
|
|
750
|
+
* See {@link https://developers.google.com/analytics/devguides/collection/ga4/page-view | Page views }
|
|
751
|
+
*/
|
|
752
|
+
page_title?: string;
|
|
753
|
+
/**
|
|
754
|
+
* The URL of the page.
|
|
755
|
+
* See {@link https://developers.google.com/analytics/devguides/collection/ga4/page-view | Page views }
|
|
756
|
+
*/
|
|
757
|
+
page_location?: string;
|
|
758
|
+
/**
|
|
759
|
+
* Defaults to `auto`.
|
|
760
|
+
* See {@link https://developers.google.com/analytics/devguides/collection/ga4/cookies-user-id | Cookies and user identification }
|
|
761
|
+
*/
|
|
762
|
+
cookie_domain?: string;
|
|
763
|
+
/**
|
|
764
|
+
* Defaults to 63072000 (two years, in seconds).
|
|
765
|
+
* See {@link https://developers.google.com/analytics/devguides/collection/ga4/cookies-user-id | Cookies and user identification }
|
|
766
|
+
*/
|
|
767
|
+
cookie_expires?: number;
|
|
768
|
+
/**
|
|
769
|
+
* Defaults to `_ga`.
|
|
770
|
+
* See {@link https://developers.google.com/analytics/devguides/collection/ga4/cookies-user-id | Cookies and user identification }
|
|
771
|
+
*/
|
|
772
|
+
cookie_prefix?: string;
|
|
773
|
+
/**
|
|
774
|
+
* If set to true, will update cookies on each page load.
|
|
775
|
+
* Defaults to true.
|
|
776
|
+
* See {@link https://developers.google.com/analytics/devguides/collection/ga4/cookies-user-id | Cookies and user identification }
|
|
777
|
+
*/
|
|
778
|
+
cookie_update?: boolean;
|
|
779
|
+
/**
|
|
780
|
+
* Appends additional flags to the cookie when set.
|
|
781
|
+
* See {@link https://developers.google.com/analytics/devguides/collection/ga4/cookies-user-id | Cookies and user identification }
|
|
782
|
+
*/
|
|
783
|
+
cookie_flags?: string;
|
|
784
|
+
/**
|
|
785
|
+
* If set to false, disables all advertising features with `gtag.js`.
|
|
786
|
+
* See {@link https://developers.google.com/analytics/devguides/collection/ga4/display-features | Disable advertising features }
|
|
787
|
+
*/
|
|
788
|
+
allow_google_signals?: boolean;
|
|
789
|
+
/**
|
|
790
|
+
* If set to false, disables all advertising personalization with `gtag.js`.
|
|
791
|
+
* See {@link https://developers.google.com/analytics/devguides/collection/ga4/display-features | Disable advertising features }
|
|
792
|
+
*/
|
|
793
|
+
allow_ad_personalization_signals?: boolean;
|
|
794
|
+
|
|
795
|
+
[key: string]: unknown;
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
/**
|
|
799
|
+
* Consent status settings for each consent type.
|
|
800
|
+
* For more information, see
|
|
801
|
+
* {@link https://developers.google.com/tag-platform/tag-manager/templates/consent-apis
|
|
802
|
+
* | the GA4 reference documentation for consent state and consent types}.
|
|
803
|
+
*/
|
|
804
|
+
export interface ConsentSettings {
|
|
805
|
+
/** Enables storage, such as cookies, related to advertising */
|
|
806
|
+
ad_storage?: boolean;
|
|
807
|
+
/** Sets consent for sending user data to Google for online advertising purposes */
|
|
808
|
+
ad_user_data?: boolean;
|
|
809
|
+
/** Sets consent for personalized advertising */
|
|
810
|
+
ad_personalization?: boolean;
|
|
811
|
+
/** Enables storage, such as cookies, related to analytics (for example, visit duration) */
|
|
812
|
+
analytics_storage?: boolean;
|
|
813
|
+
/**
|
|
814
|
+
* Enables storage that supports the functionality of the website or app such as language settings
|
|
815
|
+
*/
|
|
816
|
+
functionality_storage?: boolean;
|
|
817
|
+
/** Enables storage related to personalization such as video recommendations */
|
|
818
|
+
personalization_storage?: boolean;
|
|
819
|
+
/**
|
|
820
|
+
* Enables storage related to security such as authentication functionality, fraud prevention,
|
|
821
|
+
* and other user protection.
|
|
822
|
+
*/
|
|
823
|
+
security_storage?: ConsentStatusString;
|
|
824
|
+
|
|
825
|
+
[key: string]: unknown;
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
/**
|
|
829
|
+
* Specifies custom options for your Firebase Analytics instance.
|
|
830
|
+
* You must set these before initializing `firebase.analytics()`.
|
|
831
|
+
*/
|
|
832
|
+
export interface SettingsOptions {
|
|
833
|
+
/** Sets custom name for `gtag` function. */
|
|
834
|
+
gtagName?: string;
|
|
835
|
+
/** Sets custom name for `dataLayer` array used by `gtag.js`. */
|
|
836
|
+
dataLayerName?: string;
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
/**
|
|
840
|
+
* Any custom event name string not in the standard list of recommended event names.
|
|
841
|
+
*/
|
|
842
|
+
export declare type CustomEventName<T> = T extends EventNameString ? never : T;
|
|
843
|
+
/**
|
|
844
|
+
* Type for standard Google Analytics event names. logEvent also accepts any custom string and interprets it as a custom event name.
|
|
845
|
+
* See https://firebase.google.com/docs/reference/js/analytics.md#eventnamestring
|
|
846
|
+
*/
|
|
847
|
+
export declare type EventNameString =
|
|
848
|
+
| 'add_payment_info'
|
|
849
|
+
| 'add_shipping_info'
|
|
850
|
+
| 'add_to_cart'
|
|
851
|
+
| 'add_to_wishlist'
|
|
852
|
+
| 'begin_checkout'
|
|
853
|
+
| 'checkout_progress'
|
|
854
|
+
| 'exception'
|
|
855
|
+
| 'generate_lead'
|
|
856
|
+
| 'login'
|
|
857
|
+
| 'page_view'
|
|
858
|
+
| 'purchase'
|
|
859
|
+
| 'refund'
|
|
860
|
+
| 'remove_from_cart'
|
|
861
|
+
| 'screen_view'
|
|
862
|
+
| 'search'
|
|
863
|
+
| 'select_content'
|
|
864
|
+
| 'select_item'
|
|
865
|
+
| 'select_promotion'
|
|
866
|
+
| 'set_checkout_option'
|
|
867
|
+
| 'share'
|
|
868
|
+
| 'sign_up'
|
|
869
|
+
| 'timing_complete'
|
|
870
|
+
| 'view_cart'
|
|
871
|
+
| 'view_item'
|
|
872
|
+
| 'view_item_list'
|
|
873
|
+
| 'view_promotion'
|
|
874
|
+
| 'view_search_results';
|
|
875
|
+
|
|
876
|
+
// ============ Module Interface ============
|
|
877
|
+
|
|
878
|
+
/**
|
|
879
|
+
* Analytics module instance - returned from firebase.analytics() or firebase.app().analytics()
|
|
880
|
+
*/
|
|
881
|
+
export interface Analytics extends ReactNativeFirebase.FirebaseModule {
|
|
882
|
+
/** The FirebaseApp this module is associated with */
|
|
883
|
+
app: ReactNativeFirebase.FirebaseApp;
|
|
884
|
+
|
|
885
|
+
logEvent(
|
|
886
|
+
name: string,
|
|
887
|
+
params?: { [key: string]: any },
|
|
888
|
+
options?: AnalyticsCallOptions,
|
|
889
|
+
): Promise<void>;
|
|
890
|
+
|
|
891
|
+
setAnalyticsCollectionEnabled(enabled: boolean): Promise<void>;
|
|
892
|
+
|
|
893
|
+
setSessionTimeoutDuration(milliseconds?: number): Promise<void>;
|
|
894
|
+
|
|
895
|
+
getAppInstanceId(): Promise<string | null>;
|
|
896
|
+
|
|
897
|
+
getSessionId(): Promise<number | null>;
|
|
898
|
+
|
|
899
|
+
setUserId(id: string | null): Promise<void>;
|
|
900
|
+
|
|
901
|
+
setUserProperty(name: string, value: string | null): Promise<void>;
|
|
902
|
+
|
|
903
|
+
setUserProperties(
|
|
904
|
+
properties: { [key: string]: string | null },
|
|
905
|
+
options?: AnalyticsCallOptions,
|
|
906
|
+
): Promise<void>;
|
|
907
|
+
|
|
908
|
+
resetAnalyticsData(): Promise<void>;
|
|
909
|
+
|
|
910
|
+
setConsent(consentSettings: ConsentSettings): Promise<void>;
|
|
911
|
+
|
|
912
|
+
setDefaultEventParameters(params?: { [key: string]: any }): Promise<void>;
|
|
913
|
+
|
|
914
|
+
// Event logging methods
|
|
915
|
+
logAddPaymentInfo(object: AddPaymentInfoEventParameters): Promise<void>;
|
|
916
|
+
logScreenView(object: ScreenViewParameters): Promise<void>;
|
|
917
|
+
logAddShippingInfo(object?: AddShippingInfoParameters): Promise<void>;
|
|
918
|
+
logAddToCart(object?: AddToCartEventParameters): Promise<void>;
|
|
919
|
+
logAddToWishlist(object?: AddToWishlistEventParameters): Promise<void>;
|
|
920
|
+
logAppOpen(): Promise<void>;
|
|
921
|
+
logBeginCheckout(object?: BeginCheckoutEventParameters): Promise<void>;
|
|
922
|
+
logCampaignDetails(object: CampaignDetailsEventParameters): Promise<void>;
|
|
923
|
+
logEarnVirtualCurrency(object: EarnVirtualCurrencyEventParameters): Promise<void>;
|
|
924
|
+
logGenerateLead(object?: GenerateLeadEventParameters): Promise<void>;
|
|
925
|
+
logJoinGroup(object: JoinGroupEventParameters): Promise<void>;
|
|
926
|
+
logLevelEnd(object: LevelEndEventParameters): Promise<void>;
|
|
927
|
+
logLevelStart(object: LevelStartEventParameters): Promise<void>;
|
|
928
|
+
logLevelUp(object: LevelUpEventParameters): Promise<void>;
|
|
929
|
+
logLogin(object: LoginEventParameters): Promise<void>;
|
|
930
|
+
logPostScore(object: PostScoreEventParameters): Promise<void>;
|
|
931
|
+
logSelectContent(object: SelectContentEventParameters): Promise<void>;
|
|
932
|
+
logPurchase(object?: PurchaseEventParameters): Promise<void>;
|
|
933
|
+
logRefund(object?: RefundEventParameters): Promise<void>;
|
|
934
|
+
logRemoveFromCart(object?: RemoveFromCartEventParameters): Promise<void>;
|
|
935
|
+
logSearch(object: SearchEventParameters): Promise<void>;
|
|
936
|
+
logSelectItem(object: SelectItemEventParameters): Promise<void>;
|
|
937
|
+
logSetCheckoutOption(object: SetCheckoutOptionEventParameters): Promise<void>;
|
|
938
|
+
logSelectPromotion(object: SelectPromotionEventParameters): Promise<void>;
|
|
939
|
+
logShare(object: ShareEventParameters): Promise<void>;
|
|
940
|
+
logSignUp(object: SignUpEventParameters): Promise<void>;
|
|
941
|
+
logSpendVirtualCurrency(object: SpendVirtualCurrencyEventParameters): Promise<void>;
|
|
942
|
+
logTutorialBegin(): Promise<void>;
|
|
943
|
+
logTutorialComplete(): Promise<void>;
|
|
944
|
+
logUnlockAchievement(object: UnlockAchievementEventParameters): Promise<void>;
|
|
945
|
+
logViewCart(object?: ViewCartEventParameters): Promise<void>;
|
|
946
|
+
logViewItem(object?: ViewItemEventParameters): Promise<void>;
|
|
947
|
+
logViewItemList(object?: ViewItemListEventParameters): Promise<void>;
|
|
948
|
+
logViewPromotion(object?: ViewPromotionEventParameters): Promise<void>;
|
|
949
|
+
logViewSearchResults(object: ViewSearchResultsParameters): Promise<void>;
|
|
950
|
+
|
|
951
|
+
// iOS-specific methods
|
|
952
|
+
initiateOnDeviceConversionMeasurementWithEmailAddress(emailAddress: string): Promise<void>;
|
|
953
|
+
initiateOnDeviceConversionMeasurementWithHashedEmailAddress(
|
|
954
|
+
hashedEmailAddress: string,
|
|
955
|
+
): Promise<void>;
|
|
956
|
+
initiateOnDeviceConversionMeasurementWithPhoneNumber(phoneNumber: string): Promise<void>;
|
|
957
|
+
initiateOnDeviceConversionMeasurementWithHashedPhoneNumber(
|
|
958
|
+
hashedPhoneNumber: string,
|
|
959
|
+
): Promise<void>;
|
|
960
|
+
}
|
|
961
|
+
|
|
962
|
+
/* eslint-disable @typescript-eslint/no-namespace */
|
|
963
|
+
declare module '@react-native-firebase/app' {
|
|
964
|
+
namespace ReactNativeFirebase {
|
|
965
|
+
interface Module {
|
|
966
|
+
analytics: FirebaseModuleWithStaticsAndApp<Analytics, Statics>;
|
|
967
|
+
}
|
|
968
|
+
interface FirebaseApp {
|
|
969
|
+
analytics(): Analytics;
|
|
970
|
+
}
|
|
971
|
+
}
|
|
972
|
+
}
|
|
973
|
+
/* eslint-enable @typescript-eslint/no-namespace */
|
|
974
|
+
|
|
975
|
+
// ============ Backwards Compatibility Namespace - to be removed with namespaced exports ============
|
|
976
|
+
|
|
977
|
+
// Helper types to reference outer scope types within the namespace
|
|
978
|
+
// These are needed because TypeScript can't directly alias types with the same name
|
|
979
|
+
type _Item = Item;
|
|
980
|
+
type _AddPaymentInfoEventParameters = AddPaymentInfoEventParameters;
|
|
981
|
+
type _AddShippingInfoEventParameters = AddShippingInfoEventParameters;
|
|
982
|
+
type _AddToCartEventParameters = AddToCartEventParameters;
|
|
983
|
+
type _AddToWishlistEventParameters = AddToWishlistEventParameters;
|
|
984
|
+
type _BeginCheckoutEventParameters = BeginCheckoutEventParameters;
|
|
985
|
+
type _CampaignDetailsEventParameters = CampaignDetailsEventParameters;
|
|
986
|
+
type _EarnVirtualCurrencyEventParameters = EarnVirtualCurrencyEventParameters;
|
|
987
|
+
type _GenerateLeadEventParameters = GenerateLeadEventParameters;
|
|
988
|
+
type _JoinGroupEventParameters = JoinGroupEventParameters;
|
|
989
|
+
type _LevelEndEventParameters = LevelEndEventParameters;
|
|
990
|
+
type _LevelStartEventParameters = LevelStartEventParameters;
|
|
991
|
+
type _LevelUpEventParameters = LevelUpEventParameters;
|
|
992
|
+
type _LoginEventParameters = LoginEventParameters;
|
|
993
|
+
type _PostScoreEventParameters = PostScoreEventParameters;
|
|
994
|
+
type _PurchaseEventParameters = PurchaseEventParameters;
|
|
995
|
+
type _ScreenViewParameters = ScreenViewParameters;
|
|
996
|
+
type _RefundEventParameters = RefundEventParameters;
|
|
997
|
+
type _RemoveFromCartEventParameters = RemoveFromCartEventParameters;
|
|
998
|
+
type _SearchEventParameters = SearchEventParameters;
|
|
999
|
+
type _SelectContentEventParameters = SelectContentEventParameters;
|
|
1000
|
+
type _SelectItemEventParameters = SelectItemEventParameters;
|
|
1001
|
+
type _SetCheckoutOptionEventParameters = SetCheckoutOptionEventParameters;
|
|
1002
|
+
type _SelectPromotionEventParameters = SelectPromotionEventParameters;
|
|
1003
|
+
type _ShareEventParameters = ShareEventParameters;
|
|
1004
|
+
type _SignUpEventParameters = SignUpEventParameters;
|
|
1005
|
+
type _SpendVirtualCurrencyEventParameters = SpendVirtualCurrencyEventParameters;
|
|
1006
|
+
type _UnlockAchievementEventParameters = UnlockAchievementEventParameters;
|
|
1007
|
+
type _ViewCartEventParameters = ViewCartEventParameters;
|
|
1008
|
+
type _ViewItemEventParameters = ViewItemEventParameters;
|
|
1009
|
+
type _ViewSearchResultsParameters = ViewSearchResultsParameters;
|
|
1010
|
+
type _ViewItemListEventParameters = ViewItemListEventParameters;
|
|
1011
|
+
type _ViewPromotionEventParameters = ViewPromotionEventParameters;
|
|
1012
|
+
type _AddShippingInfoParameters = AddShippingInfoParameters;
|
|
1013
|
+
type _AnalyticsSettings = AnalyticsSettings;
|
|
1014
|
+
type _AnalyticsCallOptions = AnalyticsCallOptions;
|
|
1015
|
+
type _GtagConfigParams = GtagConfigParams;
|
|
1016
|
+
type _ConsentSettings = ConsentSettings;
|
|
1017
|
+
type _SettingsOptions = SettingsOptions;
|
|
1018
|
+
type _EventParams = EventParams;
|
|
1019
|
+
type _Statics = Statics;
|
|
1020
|
+
|
|
1021
|
+
/**
|
|
1022
|
+
* @deprecated Use the exported types directly instead.
|
|
1023
|
+
* FirebaseAnalyticsTypes namespace is kept for backwards compatibility.
|
|
1024
|
+
*/
|
|
1025
|
+
/* eslint-disable @typescript-eslint/no-namespace */
|
|
1026
|
+
export namespace FirebaseAnalyticsTypes {
|
|
1027
|
+
// Short name aliases referencing top-level types
|
|
1028
|
+
export type Module = Analytics;
|
|
1029
|
+
export type CallOptions = AnalyticsCallOptions;
|
|
1030
|
+
export type Consent = ConsentSettings;
|
|
1031
|
+
export type Settings = AnalyticsSettings;
|
|
1032
|
+
export type Statics = _Statics;
|
|
1033
|
+
|
|
1034
|
+
// Event parameter interfaces
|
|
1035
|
+
export type Item = _Item;
|
|
1036
|
+
export type AddPaymentInfoEventParameters = _AddPaymentInfoEventParameters;
|
|
1037
|
+
export type AddShippingInfoEventParameters = _AddShippingInfoEventParameters;
|
|
1038
|
+
export type AddToCartEventParameters = _AddToCartEventParameters;
|
|
1039
|
+
export type AddToWishlistEventParameters = _AddToWishlistEventParameters;
|
|
1040
|
+
export type BeginCheckoutEventParameters = _BeginCheckoutEventParameters;
|
|
1041
|
+
export type CampaignDetailsEventParameters = _CampaignDetailsEventParameters;
|
|
1042
|
+
export type EarnVirtualCurrencyEventParameters = _EarnVirtualCurrencyEventParameters;
|
|
1043
|
+
export type GenerateLeadEventParameters = _GenerateLeadEventParameters;
|
|
1044
|
+
export type JoinGroupEventParameters = _JoinGroupEventParameters;
|
|
1045
|
+
export type LevelEndEventParameters = _LevelEndEventParameters;
|
|
1046
|
+
export type LevelStartEventParameters = _LevelStartEventParameters;
|
|
1047
|
+
export type LevelUpEventParameters = _LevelUpEventParameters;
|
|
1048
|
+
export type LoginEventParameters = _LoginEventParameters;
|
|
1049
|
+
export type PostScoreEventParameters = _PostScoreEventParameters;
|
|
1050
|
+
export type PurchaseEventParameters = _PurchaseEventParameters;
|
|
1051
|
+
export type ScreenViewParameters = _ScreenViewParameters;
|
|
1052
|
+
export type RefundEventParameters = _RefundEventParameters;
|
|
1053
|
+
export type RemoveFromCartEventParameters = _RemoveFromCartEventParameters;
|
|
1054
|
+
export type SearchEventParameters = _SearchEventParameters;
|
|
1055
|
+
export type SelectContentEventParameters = _SelectContentEventParameters;
|
|
1056
|
+
export type SelectItemEventParameters = _SelectItemEventParameters;
|
|
1057
|
+
export type SetCheckoutOptionEventParameters = _SetCheckoutOptionEventParameters;
|
|
1058
|
+
export type SelectPromotionEventParameters = _SelectPromotionEventParameters;
|
|
1059
|
+
export type ShareEventParameters = _ShareEventParameters;
|
|
1060
|
+
export type SignUpEventParameters = _SignUpEventParameters;
|
|
1061
|
+
export type SpendVirtualCurrencyEventParameters = _SpendVirtualCurrencyEventParameters;
|
|
1062
|
+
export type UnlockAchievementEventParameters = _UnlockAchievementEventParameters;
|
|
1063
|
+
export type ViewCartEventParameters = _ViewCartEventParameters;
|
|
1064
|
+
export type ViewItemEventParameters = _ViewItemEventParameters;
|
|
1065
|
+
export type ViewSearchResultsParameters = _ViewSearchResultsParameters;
|
|
1066
|
+
export type ViewItemListEventParameters = _ViewItemListEventParameters;
|
|
1067
|
+
export type ViewPromotionEventParameters = _ViewPromotionEventParameters;
|
|
1068
|
+
export type AddShippingInfoParameters = _AddShippingInfoParameters;
|
|
1069
|
+
|
|
1070
|
+
// Configuration and settings interfaces
|
|
1071
|
+
export type AnalyticsSettings = _AnalyticsSettings;
|
|
1072
|
+
export type AnalyticsCallOptions = _AnalyticsCallOptions;
|
|
1073
|
+
export type GtagConfigParams = _GtagConfigParams;
|
|
1074
|
+
export type ConsentSettings = _ConsentSettings;
|
|
1075
|
+
export type SettingsOptions = _SettingsOptions;
|
|
1076
|
+
export type EventParams = _EventParams;
|
|
1077
|
+
}
|
|
1078
|
+
/* eslint-enable @typescript-eslint/no-namespace */
|