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

feat: add dcfaid support, add test #1640

Closed
wants to merge 3 commits into from

Conversation

yashasvibajpai
Copy link
Contributor

@yashasvibajpai yashasvibajpai commented Mar 10, 2024

PR Description

Please include a summary of the change along with the relevant motivation and context.

Linear task (optional)

Resolves INT-1747

Cross Browser Tests

Please confirm you have tested for the following browsers:

  • Chrome
  • Firefox
  • IE11

Sanity Suite

  • All sanity suite test cases pass locally

Security

  • The code changed/added as part of this pull request won't create any security issues with how the software is being used.

Summary by CodeRabbit

  • New Features
    • Enhanced Google Ads integration with support for dcfaId to improve tracking capabilities.
  • Tests
    • Added tests to ensure correct behavior when dcfaId is provided in Google Ads configurations.

@yashasvibajpai yashasvibajpai self-assigned this Mar 10, 2024
Copy link
Contributor

coderabbitai bot commented Mar 10, 2024

Walkthrough

The recent updates introduce a new dcfaId property to the Google Ads integration, enhancing tracking capabilities. A new configuration object including this property is added to the googleAdsConfigs array. Additionally, a test ensures the correct function call when dcfaId is present, and the main codebase now handles this new property by making a specific gtag call if it's provided.

Changes

File Path Change Summary
.../__tests__/integrations/GoogleAds/__fixtures__/data.js & .../src/integrations/GoogleAds/browser.js Added dcfaId property to configurations; new gtag call for dcfaId.
.../__tests__/integrations/GoogleAds/browser.test.js Added test for gtag call with dcfaId.

🐇✨
In the land of code where the data flows,
A new dcfaId quietly arose.
With a hop and a skip, tests run at night,
Ensuring gtag calls are just right.
Cheers to the devs, with their code so bright!
🎉🐰

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between d025039 and 1961074.
Files selected for processing (3)
  • packages/analytics-js-integrations/tests/integrations/GoogleAds/fixtures/data.js (1 hunks)
  • packages/analytics-js-integrations/tests/integrations/GoogleAds/browser.test.js (1 hunks)
  • packages/analytics-js-integrations/src/integrations/GoogleAds/browser.js (2 hunks)
Additional comments: 4
packages/analytics-js-integrations/src/integrations/GoogleAds/browser.js (2)
  • 51-51: The addition of dcfaId with a default empty string value is consistent with the handling of optional configuration properties in the class. This ensures that dcfaId can be safely used throughout the class without additional null checks.
  • 82-84: The conditional handling of dcfaId in the init method is correctly implemented, ensuring that the gtag configuration call is made only when dcfaId is provided. It's important to verify that the gtag function behaves as expected when called with a single ID parameter, as this differs from the typical use case with both an ID and a configuration object.
packages/analytics-js-integrations/__tests__/integrations/GoogleAds/__fixtures__/data.js (1)
  • 211-214: The addition of a new configuration object with conversionId and dcfaId properties in the googleAdsConfigs array is appropriate for testing the newly introduced dcfaId functionality. This ensures comprehensive test coverage for scenarios involving dcfaId.
packages/analytics-js-integrations/__tests__/integrations/GoogleAds/browser.test.js (1)
  • 53-57: The addition of a test case to verify the behavior of window.gtag when dcfaId is truthy is well-implemented. It effectively ensures that the integration correctly handles the dcfaId property, contributing to comprehensive test coverage for the new functionality.

Copy link

codecov bot commented Mar 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 53.90%. Comparing base (a269da6) to head (906a5c2).
Report is 156 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1640   +/-   ##
========================================
  Coverage    53.89%   53.90%           
========================================
  Files          461      461           
  Lines        15588    15591    +3     
  Branches      3094     3097    +3     
========================================
+ Hits          8401     8404    +3     
  Misses        5871     5871           
  Partials      1316     1316           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

github-actions bot commented Mar 10, 2024

size-limit report 📦

Name Size (Base) Size (Current) Size Limit Status
Common Code - No bundling 15.82 KB 15.81 KB (-0.04% ▼) 16.5 KB
Remote Module Federation Mapping - CDN 330 B 330 B (0%) 512 B
Remote Module Federated Plugins - CDN 5.71 KB 5.71 KB (0%) 6 KB
Core ESM - NPM 7.64 KB 7.64 KB (0%) 8 KB
Core CJS - NPM 22.43 KB 22.43 KB (0%) 23 KB
Core - NPM 22.57 KB 22.57 KB (0%) 23 KB
Core Legacy - CDN 42.9 KB 42.9 KB (0%) 44 KB
Core - CDN 22.72 KB 22.72 KB (0%) 23 KB
Core (legacy build) - CDN - v1.1 31.54 KB 31.54 KB (0%) 32 KB
Core - NPM - v1.1 31.52 KB 31.52 KB (0%) 32 KB
Service Worker Module 22.64 KB 22.64 KB (0%) 24 KB
All Integrations (legacy build) - CDN 98.57 KB 98.51 KB (-0.07% ▼) 105 KB

@yashasvibajpai yashasvibajpai marked this pull request as ready for review March 14, 2024 07:06
Copy link

sonarcloud bot commented Mar 15, 2024

Copy link

github-actions bot commented Apr 5, 2024

Hello! This PR has been open for 20 days without any activity. Therefore, it's considered as stale and is scheduled to be closed in 10 days. If you're still working on this, please remove the 'Stale' label or add a comment to keep it open. Thanks for your contribution!

@github-actions github-actions bot added Stale and removed Stale labels Apr 5, 2024
Copy link

Hello! This PR has been open for 20 days without any activity. Therefore, it's considered as stale and is scheduled to be closed in 10 days. If you're still working on this, please remove the 'Stale' label or add a comment to keep it open. Thanks for your contribution!

@github-actions github-actions bot added Stale and removed Stale labels Apr 26, 2024
Copy link

Hello! This PR has been open for 20 days without any activity. Therefore, it's considered as stale and is scheduled to be closed in 10 days. If you're still working on this, please remove the 'Stale' label or add a comment to keep it open. Thanks for your contribution!

@github-actions github-actions bot added the Stale label May 17, 2024
@MoumitaM MoumitaM removed the Stale label May 18, 2024
Copy link

github-actions bot commented Jun 8, 2024

Hello! This PR has been open for 20 days without any activity. Therefore, it's considered as stale and is scheduled to be closed in 10 days. If you're still working on this, please remove the 'Stale' label or add a comment to keep it open. Thanks for your contribution!

@github-actions github-actions bot added the Stale label Jun 8, 2024
@github-actions github-actions bot closed this Jun 18, 2024
@github-actions github-actions bot deleted the feat.googleads.update branch June 18, 2024 00:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants