Added event names to product array, ecommerce cart and CJ pixel gtm data to data layer.
This commit is contained in:
hiteshkumar87 2024-10-09 13:06:27 +05:30
parent ca6c05a65f
commit eb09eb9a7c

View file

@ -439,6 +439,7 @@ export default {
} }
} }
pushToDataLayerIfDefined({ pushToDataLayerIfDefined({
event: "productArray",
productArray: { productArray: {
coupon: coupon, coupon: coupon,
discount: discount.toFixed(2), discount: discount.toFixed(2),
@ -537,7 +538,11 @@ export default {
); );
} }
pushToDataLayerIfDefined({ pushToDataLayerIfDefined({
eCommerceCart: { products: combinedLineItems, subTotal: parseInt(subtotal) }, event: "eCommerceCart",
eCommerceCart: {
products: combinedLineItems,
subTotal: parseInt(subtotal),
},
}); });
} }
}, },
@ -625,6 +630,7 @@ export default {
} }
} }
pushToDataLayerIfDefined({ pushToDataLayerIfDefined({
event: "commissionJunctionGtmData",
commissionJunctionGtmData: { commissionJunctionGtmData: {
cj_commission_junction_event: cjEvent, cj_commission_junction_event: cjEvent,
cj_referral_sequence_number: refSequenceNum, cj_referral_sequence_number: refSequenceNum,