Skip to content

feat(ga4): added validation for event name - #2222

Merged
mihir-4116 merged 9 commits into
developfrom
feat/ga4-event-name-validation
Jun 13, 2023
Merged

mihir-4116 merged 9 commits into
developfrom
feat/ga4-event-name-validation

Conversation

@mihir-4116

Copy link
Copy Markdown
Contributor

Description of the change

  • This pull request introduces event name validation rules for GA4 (Google Analytics 4) custom events. The purpose of this validation is to ensure that event names adhere to the specified guidelines set by GA4. The following validations have been implemented:
  1. Reserved Prefixes: The validation checks if the event name begins with any of the reserved prefixes defined by GA4. These reserved prefixes are reserved for system events and should not be used for custom events.

  2. Reserved Custom Event Names: The validation ensures that the event name does not match any of the reserved custom event names defined by GA4. These reserved names are reserved for specific pre-defined events and should not be used for custom events.

  3. Alphabetic Character Start: The validation now includes a rule that the event name should not start without an alphabetic character. This means that the event name must begin with a letter from the alphabet.

  • By implementing these validation rules, we have covered all the necessary validations that GA4 expects for custom event names. Additionally, this pull request includes comprehensive test cases to ensure the functionality and accuracy of the validation process.

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Related issues

Fix #1

Checklists

Development

  • Lint rules pass locally
  • The code changed/added as part of this pull request has been covered with tests
  • All tests related to the changed code pass in development

Code review

  • This pull request has a descriptive title and information useful to a reviewer. There may be a screenshot or screencast attached
  • "Ready for review" label attached to the PR and reviewers mentioned in a comment
  • Changes have been reviewed by at least one other engineer
  • Issue from task tracker has a link to this pull request

@mihir-4116
mihir-4116 requested review from ItsSudip and utsabc May 31, 2023 08:47
@mihir-4116 mihir-4116 self-assigned this May 31, 2023
@mihir-4116
mihir-4116 requested a review from a team as a code owner May 31, 2023 08:47
@mihir-4116 mihir-4116 changed the title Feat/ga4 event name validation feat(ga4): added validation for event name May 31, 2023
@codecov

codecov Bot commented May 31, 2023 •

Copy link
Copy Markdown

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (d21df68) 86.16% compared to head (6152fb9) 86.16%.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #2222   +/-   ##
========================================
  Coverage    86.16%   86.16%           
========================================
  Files          497      497           
  Lines        25451    25458    +7     
  Branches      6289     6290    +1     
========================================
+ Hits         21929    21936    +7     
  Misses        3112     3112           
  Partials       410      410           
Impacted Files Coverage Δ
src/v0/destinations/ga4/transform.js 92.66% <100.00%> (-0.15%) ⬇️
src/v0/destinations/ga4/utils.js 95.78% <100.00%> (+0.49%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

koladilip
koladilip previously approved these changes May 31, 2023
@mihir-4116
mihir-4116 requested a review from a team as a code owner June 2, 2023 04:20
@mihir-4116
mihir-4116 requested a review from krishna2020 June 7, 2023 04:32
@sonarqubecloud

sonarqubecloud Bot commented Jun 8, 2023

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@mihir-4116
mihir-4116 merged commit 9dbd0f5 into develop Jun 13, 2023
krishna2020 pushed a commit that referenced this pull request Jun 20, 2023
* feat(ga4): added validation for event name

* fix(ga4): event name validations
@devops-github-rudderstack
devops-github-rudderstack deleted the feat/ga4-event-name-validation branch September 9, 2023 01:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants