CSR-1629
CJ pixel tag event and batch event filter
This commit is contained in:
parent
933434adff
commit
e7a3008b3a
1 changed files with 47 additions and 40 deletions
|
|
@ -542,7 +542,7 @@ export default {
|
||||||
let accountType = "";
|
let accountType = "";
|
||||||
let amount = 0;
|
let amount = 0;
|
||||||
let cjEvent = "";
|
let cjEvent = "";
|
||||||
if (store.getters.applicationUser.affiliateCookies) {
|
if (store.getters.applicationUser.affiliateCookies?.length > 0) {
|
||||||
const affiliateCookies = store.getters.applicationUser.affiliateCookies;
|
const affiliateCookies = store.getters.applicationUser.affiliateCookies;
|
||||||
var cookieArray = [];
|
var cookieArray = [];
|
||||||
affiliateCookies.forEach((item) => {
|
affiliateCookies.forEach((item) => {
|
||||||
|
|
@ -554,7 +554,11 @@ export default {
|
||||||
new Date(b.timestamp.replace("/", "T")) -
|
new Date(b.timestamp.replace("/", "T")) -
|
||||||
new Date(a.timestamp.replace("/", "T"))
|
new Date(a.timestamp.replace("/", "T"))
|
||||||
);
|
);
|
||||||
cjEvent = sortedCookies?.[0]?.tagEvent;
|
const filteredCookie = sortedCookies?.find(
|
||||||
|
(x) => x.tagEvent?.length > 0 && x.batchEvent?.length > 0
|
||||||
|
);
|
||||||
|
if (filteredCookie?.length > 0) {
|
||||||
|
cjEvent = filteredCookie.tagEvent;
|
||||||
const hasSubmittedOrder = baseMixin.methods.hasSubmittedOrder();
|
const hasSubmittedOrder = baseMixin.methods.hasSubmittedOrder();
|
||||||
const submittedOrder = baseMixin.methods.getSubmittedOrder();
|
const submittedOrder = baseMixin.methods.getSubmittedOrder();
|
||||||
|
|
||||||
|
|
@ -565,7 +569,9 @@ export default {
|
||||||
coupons = "";
|
coupons = "";
|
||||||
} else {
|
} else {
|
||||||
const promoCodes = promos.map((promo) => promo.promoCode);
|
const promoCodes = promos.map((promo) => promo.promoCode);
|
||||||
const promoString = promoCodes.reduce((prev, next) => `${prev}_${next}`);
|
const promoString = promoCodes.reduce(
|
||||||
|
(prev, next) => `${prev}_${next}`
|
||||||
|
);
|
||||||
coupons = promoString;
|
coupons = promoString;
|
||||||
}
|
}
|
||||||
refSequenceNum = submittedOrder.referralSequenceNumber;
|
refSequenceNum = submittedOrder.referralSequenceNumber;
|
||||||
|
|
@ -599,6 +605,7 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
pushToDataLayerIfDefined({
|
pushToDataLayerIfDefined({
|
||||||
commissionJunctionGtmData: {
|
commissionJunctionGtmData: {
|
||||||
cj_commission_junction_event: cjEvent,
|
cj_commission_junction_event: cjEvent,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue