Skip to content

Commit

Permalink
MWPW-159369 [cc][LANA] Error reported: target response time: 0.5 (#3475)
Browse files Browse the repository at this point in the history
* add sample rate

* change error type
  • Loading branch information
vgoodric authored Jan 24, 2025
1 parent db30bfc commit 0080957
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
6 changes: 5 additions & 1 deletion libs/features/personalization/personalization.js
Original file line number Diff line number Diff line change
Expand Up @@ -1213,7 +1213,11 @@ async function handleMartechTargetInteraction(
performance.clearMarks();
performance.clearMeasures();
try {
window.lana.log(`target response time: ${roundedResponseTime}`, { tags: 'martech', errorType: 'i' });
window.lana.log(`target response time: ${roundedResponseTime}`, {
tags: 'martech',
errorType: 'e',
sampleRate: 0.5,
});
} catch (e) {
// eslint-disable-next-line no-console
console.error('Error logging target response time:', e);
Expand Down
12 changes: 10 additions & 2 deletions libs/martech/martech.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,11 @@ export const getTargetPersonalization = async (
window.addEventListener(ALLOY_SEND_EVENT, () => {
const responseTime = calculateResponseTime(responseStart);
try {
window.lana.log(`target response time: ${responseTime}`, { tags: 'martech', errorType: 'i' });
window.lana.log(`target response time: ${responseTime}`, {
tags: 'martech',
errorType: 'e',
sampleRate: 0.5,
});
} catch (e) {
// eslint-disable-next-line no-console
console.error('Error logging target response time:', e);
Expand All @@ -82,7 +86,11 @@ export const getTargetPersonalization = async (
const response = await waitForEventOrTimeout(ALLOY_SEND_EVENT, timeout);
if (response.error) {
try {
window.lana.log('target response time: ad blocker', { tags: 'martech', errorType: 'i' });
window.lana.log('target response time: ad blocker', {
tags: 'martech',
errorType: 'e',
sampleRate: 0.5,
});
} catch (e) {
// eslint-disable-next-line no-console
console.error('Error logging target response time for ad blocker:', e);
Expand Down

0 comments on commit 0080957

Please sign in to comment.