File tree Expand file tree Collapse file tree 3 files changed +30
-2
lines changed Expand file tree Collapse file tree 3 files changed +30
-2
lines changed Original file line number Diff line number Diff line change @@ -272,6 +272,16 @@ describe('Analytics', function () {
272
272
} ) ,
273
273
) . toThrowError ( 'firebase.analytics().logBeginCheckout(*):' ) ;
274
274
} ) ;
275
+
276
+ it ( 'accepts arbitrary custom event parameters' , function ( ) {
277
+ expect ( ( ) =>
278
+ firebase . analytics ( ) . logBeginCheckout ( {
279
+ value : 123 ,
280
+ currency : 'EUR' ,
281
+ foo : 'bar' ,
282
+ } ) ,
283
+ ) . not . toThrow ( ) ;
284
+ } ) ;
275
285
} ) ;
276
286
277
287
describe ( 'logGenerateLead()' , function ( ) {
@@ -459,6 +469,16 @@ describe('Analytics', function () {
459
469
} ) ,
460
470
) . toThrowError ( 'firebase.analytics().logPurchase(*):' ) ;
461
471
} ) ;
472
+
473
+ it ( 'accepts arbitrary custom event parameters' , function ( ) {
474
+ expect ( ( ) =>
475
+ firebase . analytics ( ) . logPurchase ( {
476
+ value : 123 ,
477
+ currency : 'EUR' ,
478
+ foo : 'bar' ,
479
+ } ) ,
480
+ ) . not . toThrow ( ) ;
481
+ } ) ;
462
482
} ) ;
463
483
464
484
describe ( 'logRefund()' , function ( ) {
Original file line number Diff line number Diff line change @@ -179,6 +179,10 @@ export namespace FirebaseAnalyticsTypes {
179
179
coupon ?: string ;
180
180
181
181
items ?: Item [ ] ;
182
+ /**
183
+ * Custom event parameters.
184
+ */
185
+ [ key : string ] : any ;
182
186
}
183
187
184
188
export interface CampaignDetailsEventParameters {
@@ -334,6 +338,10 @@ export namespace FirebaseAnalyticsTypes {
334
338
* A single ID for a ecommerce group transaction.
335
339
*/
336
340
transaction_id ?: string ;
341
+ /**
342
+ * Custom event parameters.
343
+ */
344
+ [ key : string ] : any ;
337
345
}
338
346
339
347
export interface ScreenViewParameters {
Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ export const AddToWishlist = struct({
65
65
currency : 'string?' ,
66
66
} ) ;
67
67
68
- export const BeginCheckout = struct ( {
68
+ export const BeginCheckout = struct . interface ( {
69
69
items : struct . optional ( [ Item ] ) ,
70
70
value : 'number?' ,
71
71
currency : 'string?' ,
@@ -131,7 +131,7 @@ export const Refund = struct({
131
131
transaction_id : 'string?' ,
132
132
} ) ;
133
133
134
- export const Purchase = struct ( {
134
+ export const Purchase = struct . interface ( {
135
135
affiliation : 'string?' ,
136
136
coupon : 'string?' ,
137
137
currency : 'string?' ,
You can’t perform that action at this time.
0 commit comments