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 () {
272272 } ) ,
273273 ) . toThrowError ( 'firebase.analytics().logBeginCheckout(*):' ) ;
274274 } ) ;
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+ } ) ;
275285 } ) ;
276286
277287 describe ( 'logGenerateLead()' , function ( ) {
@@ -459,6 +469,16 @@ describe('Analytics', function () {
459469 } ) ,
460470 ) . toThrowError ( 'firebase.analytics().logPurchase(*):' ) ;
461471 } ) ;
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+ } ) ;
462482 } ) ;
463483
464484 describe ( 'logRefund()' , function ( ) {
Original file line number Diff line number Diff line change @@ -179,6 +179,10 @@ export namespace FirebaseAnalyticsTypes {
179179 coupon ?: string ;
180180
181181 items ?: Item [ ] ;
182+ /**
183+ * Custom event parameters.
184+ */
185+ [ key : string ] : any ;
182186 }
183187
184188 export interface CampaignDetailsEventParameters {
@@ -334,6 +338,10 @@ export namespace FirebaseAnalyticsTypes {
334338 * A single ID for a ecommerce group transaction.
335339 */
336340 transaction_id ?: string ;
341+ /**
342+ * Custom event parameters.
343+ */
344+ [ key : string ] : any ;
337345 }
338346
339347 export interface ScreenViewParameters {
Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ export const AddToWishlist = struct({
6565 currency : 'string?' ,
6666} ) ;
6767
68- export const BeginCheckout = struct ( {
68+ export const BeginCheckout = struct . interface ( {
6969 items : struct . optional ( [ Item ] ) ,
7070 value : 'number?' ,
7171 currency : 'string?' ,
@@ -131,7 +131,7 @@ export const Refund = struct({
131131 transaction_id : 'string?' ,
132132} ) ;
133133
134- export const Purchase = struct ( {
134+ export const Purchase = struct . interface ( {
135135 affiliation : 'string?' ,
136136 coupon : 'string?' ,
137137 currency : 'string?' ,
You can’t perform that action at this time.
0 commit comments