Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/modal/v2/lib/zoid-polyfill.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ const setupBrowser = props => {
event_type: 'modal_rendered',
modal: `${products.join('_').toLowerCase()}:${offer ? offer.toLowerCase() : products[0]}`,
// For standalone modal the stats event does not run, so we duplicate some data here
bn_code: partnerAttributionId
partner_attribution_id: partnerAttributionId
// first_modal_render_delay: Math.round(firstModalRenderDelay).toString(),
// render_duration: Math.round(getCurrentTime() - renderStart).toString()
});
Expand Down
2 changes: 1 addition & 1 deletion src/library/zoid/modal/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ export default createGlobalVariableGetter('__paypal_credit_modal__', () =>
event_type: 'modal_rendered',
modal: `${products.join('_').toLowerCase()}:${offer ? offer.toLowerCase() : products[0]}`,
// For standalone modal the stats event does not run, so we duplicate some data here
bn_code: getScriptAttributes()[SDK_SETTINGS.PARTNER_ATTRIBUTION_ID],
partner_attribution_id: getScriptAttributes()[SDK_SETTINGS.PARTNER_ATTRIBUTION_ID],
first_modal_render_delay: Math.round(firstModalRenderDelay).toString(),
render_duration: Math.round(getCurrentTime() - renderStart).toString()
});
Expand Down
13 changes: 7 additions & 6 deletions src/utils/logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { request } from './miscellaneous';
import { getLibraryVersion, getDisableSetCookie, getClientId } from './sdk';

function generateLogPayload(account, { meta, events: bizEvents, tracking }) {
const { deviceID, sessionID, integration_type, messaging_version, globalSessionID } = meta.global ?? {};
const { deviceID, sessionID, integration_type, integration_version, globalSessionID } = meta.global ?? {};

let clientID;
if (account.startsWith('client-id:')) {
Expand Down Expand Up @@ -39,13 +39,14 @@ function generateLogPayload(account, { meta, events: bizEvents, tracking }) {
merchant_profile_valid = merchant_profile_valid ?? trackingDetails.MERCHANT_PROFILE_VALID;
buyer_profile_hash = buyer_profile_hash ?? trackingDetails.BUYER_PROFILE_HASH;
buyer_profile_valid = buyer_profile_valid ?? trackingDetails.BUYER_PROFILE_VALID;
partner_attribution_id = partner_attribution_id ?? stats.bn_code;
partner_attribution_id = partner_attribution_id ?? stats.partner_attribution_id;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does partner_attribution_id already exist on the stats object?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's there in Stats. However, I see the changes need to be done only in 2 files. If anything I missed please do let me know.
image

@perco12 perco12 Jan 23, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

correct me if I am wrong, but you will also need to update bn_code in stats.js to be partner_attribuition_id or its going to be undefined when it looks for stats.partner_attribuition_id.
Location in stats.js

@perco12 perco12 Jan 23, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to add on to that, do we also need to update all other locations that are using bn_code like here or just in logger @JordanClemons ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should yeah

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JordanClemons @perco12 Resolved the comments. Please review and let me know the changes.


const componentEvents = tracking.filter(event => event.index === index);

// bn_code does not live in stats for standalone modal
// partner_attribution_id does not live in stats for standalone modal
partner_attribution_id =
partner_attribution_id ?? componentEvents.find(event => event.bn_code !== undefined)?.bn_code;
partner_attribution_id ??
componentEvents.find(event => event.partner_attribution_id !== undefined)?.partner_attribution_id;

// Stats payload
const { render_duration, request_duration } = stats;
Expand Down Expand Up @@ -101,7 +102,7 @@ function generateLogPayload(account, { meta, events: bizEvents, tracking }) {
global_session_id: globalSessionID,
session_id: sessionID,
integration_type,
integration_version: messaging_version,
integration_version,
components
}
};
Expand Down Expand Up @@ -205,7 +206,7 @@ logger.addMetaBuilder(() => {
return {
global: {
integration_type: __MESSAGES__.__TARGET__,
messaging_version: getLibraryVersion()
integration_version: getLibraryVersion()
}
};
});
Expand Down
2 changes: 1 addition & 1 deletion src/utils/stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export function buildStatsPayload({ container, activeTags, index, requestDuratio
index,
ad_blocker: detected.toString(),
blocked: isHidden(container).toString(),
bn_code: sdkMetaAttributes[SDK_SETTINGS.PARTNER_ATTRIBUTION_ID],
partner_attribution_id: sdkMetaAttributes[SDK_SETTINGS.PARTNER_ATTRIBUTION_ID],
// Beaver logger filters payload props based on Boolean conversion value
// so everything must be converted to a string to prevent unintended filtering
position_in_page_x: Math.round(containerRect.left).toString(),
Expand Down
Loading