Repository navigation
fix(ga4): added validation and extended support for context.traits for user_properties - #2178
Merged
Merged
Conversation
… for context.traits for user_properties
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## develop #2178 +/- ##
========================================
Coverage 86.26% 86.26%
========================================
Files 500 500
Lines 25672 25684 +12
Branches 6328 6333 +5
========================================
+ Hits 22145 22157 +12
Misses 3116 3116
Partials 411 411
☔ View full report in Codecov by Sentry. |
|
@mihir-4116 can we add some description to have context about why we're making this change & also have a description about what is the change exactly ? |
koladilip
previously approved these changes
May 17, 2023
utsabc
reviewed
May 17, 2023
utsabc
previously approved these changes
May 31, 2023
krishna2020
previously approved these changes
Jun 15, 2023
utsabc
previously approved these changes
Jun 19, 2023
utsabc
previously approved these changes
Jun 19, 2023
krishna2020
reviewed
Jun 19, 2023
utsabc
previously approved these changes
Jun 20, 2023
krishna2020
approved these changes
Jun 20, 2023
|
Kudos, SonarCloud Quality Gate passed! |
utsabc
approved these changes
Jun 20, 2023
krishna2020
pushed a commit
that referenced
this pull request
Jun 20, 2023
…r user_properties (#2178) * fix(ga4): add validation for ga4 user_properties and extended support for context.traits for user_properties * fix(ga4): added boolean type support for user_properties * fix(ga4): added validation for user_properties names * chore: removed un-used import * fix(ga4): refactor user_properties * chore: added unit tests for user_properties * chore: added reserved prefix in test cases --------- Co-authored-by: Utsab Chowdhury <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.








Description of the change
This pull request enhances the support for user_properties within the context.traits feature. Based on customer feedback and recommendations from the customer success team, we have made changes to automatically consider the properties inside context.traits as user_properties.
To achieve this, we have added support for context.traits while maintaining the existing mapping properties.user_properties. This ensures compatibility with the previous implementation while expanding the capabilities of user_properties.
To align with the requirements of GA4 (Google Analytics 4), we have made modifications to drop any properties that are not of type string or number or boolean. GA4 silently drops events if any user_property is an array or object, so we are handling this scenario proactively.
Additionally, we have transformed the user_properties to conform to the structure expected by the measurement protocol. This ensures seamless integration and accurate reporting within the GA4 framework.
Type of change
Related issues
Checklists
Development
Code review