Skip to content

Commit

Permalink
Consent Bug (#3645)
Browse files Browse the repository at this point in the history
* Consent Bug

* read event listener to measure time out scenarios

* read event listener to measure time out scenarios

* Lint fix

---------

Co-authored-by: Akansha Arora <>
  • Loading branch information
akanshaa-18 authored Feb 11, 2025
1 parent 963ffb4 commit 5393c3e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 16 deletions.
27 changes: 15 additions & 12 deletions libs/features/personalization/personalization.js
Original file line number Diff line number Diff line change
Expand Up @@ -1181,20 +1181,23 @@ function sendTargetResponseAnalytics(failure, responseStart, timeoutLocal, messa
let val = `target response time ${responseTime}:timed out ${failure}:timeout ${timeoutTime}`;
if (message) val += `:${message}`;
// eslint-disable-next-line no-underscore-dangle
window._satellite?.track?.('event', {
documentUnloading: true,
xdm: {
eventType: 'web.webinteraction.linkClicks',
web: {
webInteraction: {
linkClicks: { value: 1 },
type: 'other',
name: val,
window.addEventListener('alloy_sendEvent', () => {
window._satellite?.track?.('event', {
documentUnloading: true,
xdm: {
eventType: 'web.webinteraction.linkClicks',
web: {
webInteraction: {
linkClicks: { value: 1 },
type: 'other',
name: val,
},
},
},
},
data: { _adobe_corpnew: { digitalData: { primaryEvent: { eventInfo: { eventName: val } } } } },
});
data:
{ _adobe_corpnew: { digitalData: { primaryEvent: { eventInfo: { eventName: val } } } } },
});
}, { once: true });
}

const handleAlloyResponse = (response) => ((response.propositions || response.decisions))
Expand Down
8 changes: 4 additions & 4 deletions libs/martech/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ const KNDCTR_COOKIE_KEYS = [
];

const DATA_STREAM_IDS_PROD = {
firstVisitNoConsent: '57c20bab-94c3-425e-95cb-0b9948b1fdd4',
excludeDS: '57c20bab-94c3-425e-95cb-0b9948b1fdd4',
default: '913eac4d-900b-45e8-9ee7-306216765cd2',
};
const DATA_STREAM_IDS_STAGE = {
firstVisitNoConsent: 'a44f0037-2ada-441f-a012-243832ce5ff9',
excludeDS: 'a44f0037-2ada-441f-a012-243832ce5ff9',
default: 'e065836d-be57-47ef-b8d1-999e1657e8fd',
};

Expand Down Expand Up @@ -363,8 +363,8 @@ export const createRequestUrl = ({
if (hitType === 'pageView' || hitType === 'propositionDisplay') {
const isFirstVisit = !getCookie(AMCV_COOKIE);
const consentCookie = getCookie('OptanonConsent') || '';
if (isFirstVisit || !consentCookie.includes('C0004')) {
dataStreamId = env === 'prod' ? DATA_STREAM_IDS_PROD.firstVisitNoConsent : DATA_STREAM_IDS_STAGE.firstVisitNoConsent;
if (isFirstVisit || !consentCookie || consentCookie.includes('C0004:0')) {
dataStreamId = env === 'prod' ? DATA_STREAM_IDS_PROD.excludeDS : DATA_STREAM_IDS_STAGE.excludeDS;
}
return `${TARGET_API_URL}?dataStreamId=${dataStreamId}&requestId=${generateUUIDv4()}`;
}
Expand Down

0 comments on commit 5393c3e

Please sign in to comment.