Skip to content
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

[WALL] george /WALL-5255 / GrowthBook initialization fix for loggedIn and residence_country values #17854

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

heorhi-deriv
Copy link
Contributor

@heorhi-deriv heorhi-deriv commented Dec 18, 2024

Changes:

1. Cookie Name Fix

  • Corrected the cookie name from clients_information to client_information to ensure proper data retrieval.

2. Data Prepopulation Fix

  • Due to race conditions, the user's email was not properly initialized, resulting in the removal of the client_information cookie. As a result, the AnalyticsInitializer was unable to retrieve this cookie, and since the loggedIn value relied on the presence of the client_information cookie, it was always set to false, even when the client was logged in. This issue was resolved by prepopulating the email and residence values from client.accounts stored in localStorage.

3. LoggedIn Value Fix

  • Resolved an issue where the loggedIn value was always false due to the missing client_information cookie.
  • This fix ensures accurate recognition of the user's authentication status.

4. Analytics Configuration Update

  • Added residence_country to the analytics configuration to enhance data tracking capabilities.

Impact

These changes address the following:

  • Data Retrieval: Ensures proper structure and retrieval of client information through correct cookie names.
  • Data Prepopulation: Ensures accurate prepopulation of user data, such as email and residence, from client.accounts in localStorage before analytics initialization.
  • User Authentication Status: Resolves issues with incorrect loggedIn states for reliable user authentication tracking.
  • Enhanced Analytics Tracking: Incorporates residence_country in analytics for improved tracking and reporting.

Overall, these updates ensure that analytics systems have access to critical client information, offering more accurate and effective tracking capabilities.

Screenshots:

Screenshot 2024-12-18 at 18 22 14
Screenshot 2024-12-18 at 18 59 39

Copy link

vercel bot commented Dec 18, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
deriv-app ✅ Ready (Inspect) Visit Preview Dec 19, 2024 7:26am

@heorhi-deriv heorhi-deriv changed the title george / streamline client data retrieval and enhance analytics logging george / GrowthBook inialization fix for loggedIn and residence_country values Dec 18, 2024
@heorhi-deriv heorhi-deriv changed the title george / GrowthBook inialization fix for loggedIn and residence_country values george / GrowthBook initialization fix for loggedIn and residence_country values Dec 18, 2024
@coveralls
Copy link

coveralls commented Dec 18, 2024

Pull Request Test Coverage Report for Build 12407870032

Details

  • 0 of 5 (0.0%) changed or added relevant lines in 2 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.004%) to 53.911%

Changes Missing Coverage Covered Lines Changed/Added Lines %
packages/core/src/Utils/Analytics/index.ts 0 1 0.0%
packages/core/src/Stores/client-store.js 0 4 0.0%
Files with Coverage Reduction New Missed Lines %
packages/core/src/Utils/Analytics/index.ts 1 0.0%
Totals Coverage Status
Change from base Build 12407631215: -0.004%
Covered Lines: 33032
Relevant Lines: 57098

💛 - Coveralls

Copy link
Contributor

github-actions bot commented Dec 18, 2024

A production App ID was automatically generated for this PR. (log)

Click here to copy & paste above information.
- **PR**: [https://github.com/deriv-com/deriv-app/pull/17854](https://github.com/deriv-com/deriv-app/pull/17854)
- **URLs**:
    - **w/ App ID + Server**: https://deriv-app-git-fork-heorhi-deriv-fix-analytics-config-options.binary.sx?qa_server=red.derivws.com&app_id=23938
    - **Original**: https://deriv-app-git-fork-heorhi-deriv-fix-analytics-config-options.binary.sx
- **App ID**: `23938`

Copy link
Contributor

github-actions bot commented Dec 18, 2024

🚨 Lighthouse report for the changes in this PR:

Category Score
🔺 Performance 42
🟧 Accessibility 70
🟧 Best practices 83
🟧 SEO 77
🟧 PWA 78

Lighthouse ran with https://deriv-app-git-fork-heorhi-deriv-fix-analytics-config-options.binary.sx/

@heorhi-deriv heorhi-deriv changed the title george / GrowthBook initialization fix for loggedIn and residence_country values [WALL] george /WALL-5255 / GrowthBook initialization fix for loggedIn and residence_country values Dec 19, 2024
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.

5 participants