@uappi/public-sdk 1.20.0 → 1.20.1
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/modules/Tracking/facebook/events/actions/addPaymentInfo.ts +2 -0
- package/modules/Tracking/facebook/events/actions/addToCart.ts +2 -0
- package/modules/Tracking/facebook/events/actions/initiateCheckout.ts +2 -0
- package/modules/Tracking/facebook/events/actions/purchase.ts +2 -0
- package/modules/Tracking/facebook/events/actions/search.ts +2 -0
- package/modules/Tracking/facebook/events/views/pageView.ts +2 -0
- package/modules/Tracking/facebook/events/views/viewContent.ts +2 -0
- package/package.json +1 -1
|
@@ -5,6 +5,8 @@ import { pushFbq } from '../../../utils/pushFbq';
|
|
|
5
5
|
import type { CartResponse } from '../../../../Api/types';
|
|
6
6
|
|
|
7
7
|
export function addPaymentInfoAction(cartPayload: CartResponse) {
|
|
8
|
+
if (!window.fbq) return;
|
|
9
|
+
|
|
8
10
|
const value = totalValue(cartPayload);
|
|
9
11
|
|
|
10
12
|
api.thirdParty
|
|
@@ -9,6 +9,8 @@ export function addToCartAction(
|
|
|
9
9
|
cartPayload: CartResponse,
|
|
10
10
|
upsertPayload?: UpsertTrackingCartRequest,
|
|
11
11
|
) {
|
|
12
|
+
if (!window.fbq) return;
|
|
13
|
+
|
|
12
14
|
getAddedCartItems(cartPayload, upsertPayload).forEach(item => {
|
|
13
15
|
const quantity = item.oldQuantity
|
|
14
16
|
? item.quantity - item.oldQuantity
|
|
@@ -5,6 +5,8 @@ import { pushFbq } from '../../../utils/pushFbq';
|
|
|
5
5
|
import type { CartResponse } from '../../../../Api/types';
|
|
6
6
|
|
|
7
7
|
export function initiateCheckoutAction(cartPayload: CartResponse) {
|
|
8
|
+
if (!window.fbq) return;
|
|
9
|
+
|
|
8
10
|
const value = totalValue(cartPayload);
|
|
9
11
|
|
|
10
12
|
api.thirdParty
|
|
@@ -5,6 +5,8 @@ import { pushFbq } from '../../../utils/pushFbq';
|
|
|
5
5
|
import type { CartResponse } from '../../../../Api/types';
|
|
6
6
|
|
|
7
7
|
export function purchaseAction(orderGroupId: number, cartPayload: CartResponse) {
|
|
8
|
+
if (!window.fbq) return;
|
|
9
|
+
|
|
8
10
|
const value = totalValue(cartPayload);
|
|
9
11
|
|
|
10
12
|
api.thirdParty
|
|
@@ -2,6 +2,8 @@ import api from '../../../../Api';
|
|
|
2
2
|
import { pushFbq } from '../../../utils/pushFbq';
|
|
3
3
|
|
|
4
4
|
export function searchAction(searchTerm: string, contentIds: Array<string>) {
|
|
5
|
+
if (!window.fbq) return;
|
|
6
|
+
|
|
5
7
|
api.thirdParty
|
|
6
8
|
.facebookSearch({ searchTerm, contentIds })
|
|
7
9
|
.then(eventId =>
|
|
@@ -4,6 +4,8 @@ import { pushFbq } from '../../../utils/pushFbq';
|
|
|
4
4
|
import type { Product } from '../../../../Api/types';
|
|
5
5
|
|
|
6
6
|
export function viewContent(product: Product) {
|
|
7
|
+
if (!window.fbq) return;
|
|
8
|
+
|
|
7
9
|
api.thirdParty
|
|
8
10
|
.facebookViewContent({ productId: product.id })
|
|
9
11
|
.then(eventId =>
|