Skip to content

Conversation

@anushreeshah2405
Copy link
Collaborator

Description

Ticket - DTCRCJPTR-5015 - Extend instrumentation to include language_requested

  • Add language_requested field to FPTI logging to track the requested language parameter in analytics

Changes

  • Modified component.js to extract the language prop in the onReady handler
  • Added language_requested field to the component tracking data passed to logger
  • Updated logger.js to include language_requested in the log payload with a fallback value of 'undefined' when not present

PR for UCG: https://github.paypal.com/Credit-R/upstream-common-go/pull/127
PR for CULS: Credit-R/creditupstreamlogserv/pull/230

Screenshots

Testing instructions

Test Environment: te-lang-req-fpti-culs-anushah
CDN Bundle for paypal-messaging-components: lang_fpti_anushah3

Test Scenarios:

Scenario 1: Valid language_requested Parameter

Steps:

  1. Open standalone.html with language set to "fr-CA" (refer attached code snippet)
  2. Capture the Paypal-Debug-Id from the page
  3. Look up the debug ID in Lighthouse (search for debug_cal_correlation_id)

Expected Result:
FPTI data in Lighthouse should show language_requested: "fr-CA"
Debug ID example: d3e030ea9b570

Scenario 2: Missing language_requested Parameter

Steps:

  1. Open standalone.html with language omitted (refer attached code snippet)
  2. Capture the Paypal-Debug-Id from the page
  3. Look up the debug ID in Lighthouse (search for debug_cal_correlation_id)

Expected Result:
FPTI data in Lighthouse should show language_requested: undefined
Debug ID example: ff955bde8b499

standalone.html code snippet for configuring CULS TE, CDNX Bundle for paypal-messaging-components , and setting the language prop.

<!DOCTYPE html>
<html lang="en">
    <head>
        <title>Messaging.js Dev Sandbox</title>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
        <script> window.__TEST_ENV__ = "https://www.te-lang-req-fpti-culs-anushah.qa.paypal.com"</script>
       <script src='https://cdn-lang_fpti_anushah3.static.engineering.dev.paypalinc.com/upstream/bizcomponents/stage/messaging.js' data-pp-account="VT5U8UR66R68N"></script>
    </head>
    <body>
        <div class="messages" data-pp-message></div>
        <script>
            paypal
                .Messages({
                    style: {
                        layout: 'text',
                        logo: {
                            type: 'none'
                        }
                    },
                    language: "fr-CA",
                })
                .render('.messages');
        </script>
    </body>
</html>

Copy link
Contributor

@danzhaaspaypal danzhaaspaypal left a comment

Choose a reason for hiding this comment

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

requesting language_requested be added to the modal event as well please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants