Skip to content

Commit

Permalink
Add sdkIntegrationSource to tracking builder and metric
Browse files Browse the repository at this point in the history
  • Loading branch information
nbierdeman committed Feb 8, 2024
1 parent c1b139a commit 8425a64
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions src/tracking.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export function getSDKInitTime(): number {
export function setupLogger() {
const logger = getLogger();
const pageType = getPageType();
const integrationSource = getIntegrationSource();
const sdkIntegrationSource = getIntegrationSource();
const version = getVersion();
const userAction = getCommit()
? FPTI_USER_ACTION.COMMIT
Expand All @@ -106,22 +106,22 @@ export function setupLogger() {
const mID = getMerchantID();

return {
[FPTI_KEY.FEED]: FPTI_FEED.PAYMENTS_SDK,
[FPTI_KEY.DATA_SOURCE]: FPTI_DATA_SOURCE.PAYMENTS_SDK,
[FPTI_KEY.CLIENT_ID]: getClientID(),
[FPTI_KEY.SELLER_ID]: mID && mID.toString(),
[FPTI_KEY.SESSION_UID]: getSessionID(),
[FPTI_KEY.REFERER]: window.location.host,
[FPTI_KEY.LOCALE]: `${lang}_${country}`,
[FPTI_KEY.CONTEXT_CORRID]: getCorrelationID(),
[FPTI_KEY.DATA_SOURCE]: FPTI_DATA_SOURCE.PAYMENTS_SDK,
[FPTI_KEY.FEED]: FPTI_FEED.PAYMENTS_SDK,

Check warning on line 112 in src/tracking.js

View check run for this annotation

Codecov / codecov/patch

src/tracking.js#L110-L112

Added lines #L110 - L112 were not covered by tests
[FPTI_KEY.INTEGRATION_IDENTIFIER]: getClientID(),
[FPTI_KEY.PARTNER_ATTRIBUTION_ID]: getPartnerAttributionID(),
[FPTI_KEY.LOCALE]: `${lang}_${country}`,

Check warning on line 114 in src/tracking.js

View check run for this annotation

Codecov / codecov/patch

src/tracking.js#L114

Added line #L114 was not covered by tests
[FPTI_KEY.PAGE_TYPE]: pageType,
[FPTI_KEY.PARTNER_ATTRIBUTION_ID]: getPartnerAttributionID(),
[FPTI_KEY.REFERER]: window.location.host,
[FPTI_KEY.SDK_INTEGRATION_SOURCE]: sdkIntegrationSource,

Check warning on line 118 in src/tracking.js

View check run for this annotation

Codecov / codecov/patch

src/tracking.js#L116-L118

Added lines #L116 - L118 were not covered by tests
[FPTI_KEY.SDK_NAME]: FPTI_SDK_NAME.PAYMENTS_SDK,
[FPTI_KEY.SDK_VERSION]: version,
[FPTI_KEY.USER_AGENT]: window.navigator && window.navigator.userAgent,
[FPTI_KEY.SELLER_ID]: mID && mID.toString(),
[FPTI_KEY.SESSION_UID]: getSessionID(),

Check warning on line 122 in src/tracking.js

View check run for this annotation

Codecov / codecov/patch

src/tracking.js#L121-L122

Added lines #L121 - L122 were not covered by tests
[FPTI_KEY.USER_ACTION]: userAction,
[FPTI_KEY.CONTEXT_CORRID]: getCorrelationID(),
[FPTI_KEY.SDK_INTEGRATION_SOURCE]: integrationSource,
[FPTI_KEY.USER_AGENT]: window.navigator && window.navigator.userAgent,

Check warning on line 124 in src/tracking.js

View check run for this annotation

Codecov / codecov/patch

src/tracking.js#L124

Added line #L124 was not covered by tests
};
});

Expand Down Expand Up @@ -186,13 +186,13 @@ export function setupLogger() {
metricNamespace: "pp.app.paypal_sdk.init.count",
metricEventName: "load",
dimensions: {
integrationSource,
pageType,
userAction,
version,
components: getComponents().join(","),
isPayPalDomain: isLoadedInFrame,
pageType,
sdkIntegrationSource,

Check warning on line 192 in src/tracking.js

View check run for this annotation

Codecov / codecov/patch

src/tracking.js#L191-L192

Added lines #L191 - L192 were not covered by tests
token: getTokenType(),
userAction,
version,

Check warning on line 195 in src/tracking.js

View check run for this annotation

Codecov / codecov/patch

src/tracking.js#L194-L195

Added lines #L194 - L195 were not covered by tests
},
})
.track({
Expand Down

0 comments on commit 8425a64

Please sign in to comment.