Skip to content

Commit 005c35e

Browse files
committed
fix: Trigger correct Facebook Events
1 parent 489bffc commit 005c35e

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

packages/plugins/plugin-facebook-app-events/src/methods/parameterMapping.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export const mapEventNames = {
77
'Order Completed': 'fb_mobile_purchase',
88
'Product Added': 'fb_mobile_add_to_cart',
99
'Product Added to Wishlist': 'fb_mobile_add_to_wishlist',
10+
'Checkout Started': 'fb_mobile_initiated_checkout',
1011
} as any;
1112

1213
export const mapEventProps: { [key: string]: string } = {

packages/plugins/plugin-facebook-app-events/src/methods/track.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export default (event: TrackEventType) => {
4646
let safeProps = sanitizeEvent(safeEvent);
4747
const currency = (safeProps.fb_currency as string | undefined) ?? 'USD';
4848

49-
if (safeProps._valueToSum !== undefined) {
49+
if (safeProps._valueToSum !== undefined && safeName === 'fb_mobile_purchase') {
5050
let purchasePrice = safeProps._valueToSum as number;
5151

5252
AppEventsLogger.logPurchase(purchasePrice, currency, safeProps);

0 commit comments

Comments
 (0)