-
Notifications
You must be signed in to change notification settings - Fork 192
ENB-7820: Add values for e 8000 vent95 #3782
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
c8aa93e
38978f1
1e25f6a
fb2fafd
4b38be0
9804e9b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -149,6 +149,22 @@ function getOrGenerateUserId() { | |
}; | ||
} | ||
|
||
function getUpdatedVisitAttempt() { | ||
const { hostname } = window.location; | ||
const secondVisitAttempt = Number(localStorage.getItem('secondHit')) || 0; | ||
|
||
const isAdobeDomain = hostname === 'www.adobe.com' || hostname === 'www.stage.adobe.com'; | ||
const consentCookieValue = getCookie('OptanonConsent'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We also have a function There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @swamu - does this need to run before There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. const consentCookieValue = getCookie('OptanonConsent'); There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't we also check for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just to be clear - this is how Privacy currently works, the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @narcis-radu - We have not used OptanonAlertBoxClosed in Launch also. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @mokimo, Can we take this as a separate request and move ahead with the current PR. Since @narcis-radu is OOO, let us know your thoughts on this. |
||
|
||
if (consentCookieValue?.includes('C0002:1') && isAdobeDomain) { | ||
const updatedVisitAttempt = secondVisitAttempt === 0 ? 1 : secondVisitAttempt + 1; | ||
localStorage.setItem('secondHit', updatedVisitAttempt); | ||
return updatedVisitAttempt; | ||
} | ||
|
||
return secondVisitAttempt; | ||
swamu marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
|
||
function getPageNameForAnalytics({ locale }) { | ||
const { host, pathname } = new URL(window.location.href); | ||
const [modifiedPath] = pathname.split('/').filter((x) => x !== locale.prefix).join(':').split('.'); | ||
|
@@ -240,6 +256,7 @@ function createRequestPayload({ updatedContext, pageName, locale, env, hitType } | |
approach: 'martech-API', | ||
edgeConfigIdLaunch: dataStreamId, | ||
edgeConfigId: dataStreamId, | ||
personalisation: 'hybrid', | ||
}, | ||
}, | ||
}, | ||
|
@@ -269,6 +286,12 @@ function createRequestPayload({ updatedContext, pageName, locale, env, hitType } | |
data.web = { webPageDetails }; | ||
data.eventType = hitTypeEventTypeMap[hitType]; | ||
|
||
if (getUpdatedVisitAttempt() === 2) { | ||
digitalData.adobe = { | ||
libraryVersions: 'alloy-api', | ||
experienceCloud: { secondVisits: 'setEvent' }, | ||
}; | ||
} | ||
xdm.implementationDetails = { | ||
name: 'https://ns.adobe.com/experience/alloy/reactor', | ||
version: '1.0', | ||
|
@@ -496,22 +519,17 @@ export const loadAnalyticsAndInteractionData = async ( | |
|
||
const CURRENT_DATE = new Date(); | ||
const localTime = CURRENT_DATE.toISOString(); | ||
|
||
const timezoneOffset = CURRENT_DATE.getTimezoneOffset(); | ||
if (hybridPersEnabled) { | ||
window.hybridPers = true; | ||
} | ||
const hitType = hybridPersEnabled ? 'pageView' : 'propositionFetch'; | ||
|
||
const pageName = getPageNameForAnalytics({ locale }); | ||
|
||
const updatedContext = getUpdatedContext({ ...getDeviceInfo(), localTime, timezoneOffset }); | ||
|
||
const requestUrl = createRequestUrl({ | ||
env, | ||
hitType, | ||
}); | ||
|
||
const requestPayload = { updatedContext, pageName, locale, env, hitType }; | ||
const requestBody = createRequestPayload(requestPayload); | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.