Skip to content

Commit b972cb6

Browse files
fix(analytics): added missing price parameter to the Item structure (#5232)
* fix(analytics): added missing price parameter to the Item structure Co-authored-by: Mike Hardy <[email protected]>
1 parent da6b811 commit b972cb6

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

packages/analytics/e2e/analytics.e2e.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,15 @@ describe('analytics()', function () {
368368
it('calls logViewItemList', async function () {
369369
await firebase.analytics().logViewItemList({
370370
item_list_name: 'foo',
371+
items: [
372+
{
373+
item_id: 'foo',
374+
item_name: 'foo',
375+
item_category: 'foo',
376+
item_location_id: 'foo',
377+
price: 123,
378+
},
379+
],
371380
});
372381
});
373382
});

packages/analytics/lib/index.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,12 @@ export namespace FirebaseAnalyticsTypes {
103103
* The Item quantity.
104104
*/
105105
quantity?: number;
106+
/**
107+
* The Item price.
108+
* Note that firebase analytics will display this as an integer with trailing zeros, due to some firebase-internal conversion.
109+
* See https://github.com/invertase/react-native-firebase/issues/4578#issuecomment-771703420 for more information
110+
*/
111+
price?: number;
106112
}
107113

108114
export interface AddPaymentInfoEventParameters {

packages/analytics/lib/structs.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ const Item = struct({
2929
item_location_id: 'string?',
3030
item_variant: 'string?',
3131
quantity: 'number?',
32+
price: 'number?',
3233
});
3334

3435
export const ScreenView = struct({

0 commit comments

Comments
 (0)