Skip to content

Google Analytics - add async options for properties #17255

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

Merged
merged 2 commits into from
Jun 25, 2025
Merged

Conversation

michelle0927
Copy link
Collaborator

@michelle0927 michelle0927 commented Jun 24, 2025

Resolves #17147
Resolves #17133

Note: I wasn't able to find a way to use async options for viewId. UA (Universal Analytics) has been deprecated in favor of G4.

Summary by CodeRabbit

  • New Features

    • Added a new property selector for Google Analytics actions, allowing users to easily choose from available properties when configuring actions.
  • Improvements

    • Standardized property selection across multiple Google Analytics actions for a more consistent user experience.
    • Enhanced property input fields now display available property IDs with their names.
  • Bug Fixes

    • Minor updates to documentation links and descriptions for greater clarity.
  • Chores

    • Updated version numbers for several Google Analytics actions and components.

Copy link

vercel bot commented Jun 24, 2025

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

3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
docs-v2 ⬜️ Ignored (Inspect) Jun 24, 2025 4:46pm
pipedream-docs ⬜️ Ignored (Inspect) Jun 24, 2025 4:46pm
pipedream-docs-redirect-do-not-edit ⬜️ Ignored (Inspect) Jun 24, 2025 4:46pm

Copy link
Contributor

coderabbitai bot commented Jun 24, 2025

Walkthrough

The changes introduce a reusable async property selector for Google Analytics properties by adding a property propDefinition and an associated async listProperties method in the app module. Several actions are updated to use this standardized property selector, with adjustments to ensure the correct property ID format is submitted. Minor version bumps and description text tweaks are also included across multiple files.

Changes

File(s) Change Summary
components/google_analytics/google_analytics.app.mjs Added property propDefinition with async options and new listProperties method for property selection.
components/google_analytics/actions/create-key-event/create-key-event.mjs
components/google_analytics/actions/run-report-in-ga4/run-report-in-ga4.mjs
Updated to use new property propDefinition; in run-report-in-ga4, property ID extraction logic added.
components/google_analytics/actions/create-ga4-property/create-ga4-property.mjs
components/google_analytics/actions/run-report/run-report.mjs
components/google_analytics/sources/page-opened/page-opened.mjs
Version bump and/or minor description text change only.
components/google_analytics/package.json Version bump only.

Sequence Diagram(s)

Loading
sequenceDiagram
    participant User
    participant Action
    participant App
    participant GoogleAnalyticsAPI

    User->>Action: Select property via async options
    Action->>App: Request property options (listProperties)
    App->>GoogleAnalyticsAPI: GET /accountSummaries
    GoogleAnalyticsAPI-->>App: Return account summaries
    App-->>Action: Return property list
    User->>Action: Submit action with selected property
    Action->>App: (If needed) Extract property ID
    Action->>GoogleAnalyticsAPI: Perform action with correct property ID

Assessment against linked issues

Objective Addressed Explanation
Use async options for property selection in Google Analytics components (#17147)
Ensure property ID is submitted in correct format (numeric, not "properties/123") in actions (#17133)
Add method(s) to retrieve account properties using the relevant Google Analytics API endpoint (#17147, #17133)

Assessment against linked issues: Out-of-scope changes

No out-of-scope changes detected.

Poem

A hop and a skip through analytics land,
Now properties fetch with a gentle command.
No more guessing IDs or stringly mistakes,
Async options serve up the choices it takes.
With every version hop, the garden grows bright—
A rabbit’s delight in code done right! 🐇✨

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

components/google_analytics/actions/create-ga4-property/create-ga4-property.mjs

Oops! Something went wrong! :(

ESLint: 8.57.1

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs
at Object.getPackageJSONURL (node:internal/modules/package_json_reader:255:9)
at packageResolve (node:internal/modules/esm/resolve:767:81)
at moduleResolve (node:internal/modules/esm/resolve:853:18)
at defaultResolve (node:internal/modules/esm/resolve:983:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:801:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:725:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:708:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:309:38)
at #link (node:internal/modules/esm/module_job:201:49)

components/google_analytics/actions/create-key-event/create-key-event.mjs

Oops! Something went wrong! :(

ESLint: 8.57.1

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs
at Object.getPackageJSONURL (node:internal/modules/package_json_reader:255:9)
at packageResolve (node:internal/modules/esm/resolve:767:81)
at moduleResolve (node:internal/modules/esm/resolve:853:18)
at defaultResolve (node:internal/modules/esm/resolve:983:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:801:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:725:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:708:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:309:38)
at #link (node:internal/modules/esm/module_job:201:49)

components/google_analytics/actions/run-report/run-report.mjs

Oops! Something went wrong! :(

ESLint: 8.57.1

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs
at Object.getPackageJSONURL (node:internal/modules/package_json_reader:255:9)
at packageResolve (node:internal/modules/esm/resolve:767:81)
at moduleResolve (node:internal/modules/esm/resolve:853:18)
at defaultResolve (node:internal/modules/esm/resolve:983:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:801:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:725:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:708:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:309:38)
at #link (node:internal/modules/esm/module_job:201:49)

  • 3 others
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ 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>, please review it.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • 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/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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.

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 884ec80 and 67060ee.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (7)
  • components/google_analytics/actions/create-ga4-property/create-ga4-property.mjs (1 hunks)
  • components/google_analytics/actions/create-key-event/create-key-event.mjs (1 hunks)
  • components/google_analytics/actions/run-report-in-ga4/run-report-in-ga4.mjs (2 hunks)
  • components/google_analytics/actions/run-report/run-report.mjs (1 hunks)
  • components/google_analytics/google_analytics.app.mjs (2 hunks)
  • components/google_analytics/package.json (1 hunks)
  • components/google_analytics/sources/page-opened/page-opened.mjs (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: Lint Code Base
  • GitHub Check: pnpm publish
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Publish TypeScript components
🔇 Additional comments (12)
components/google_analytics/sources/page-opened/page-opened.mjs (1)

7-7: LGTM: Coordinated version bump.

The version increment aligns with the package-wide updates for this release.

components/google_analytics/google_analytics.app.mjs (1)

26-37: LGTM: Well-implemented async property selector.

The new property propDefinition provides a clean interface for selecting Google Analytics properties with async options loading.

components/google_analytics/package.json (1)

3-3: LGTM: Appropriate patch version increment.

The version bump from 0.2.0 to 0.2.1 correctly reflects the addition of new functionality and coordinated component updates.

components/google_analytics/actions/create-ga4-property/create-ga4-property.mjs (1)

8-8: LGTM: Coordinated version bump.

The version increment maintains consistency with the package-wide updates for this release.

components/google_analytics/actions/run-report/run-report.mjs (2)

5-5: LGTM: Coordinated version bump.

The version increment aligns with the package-wide updates for this release.


7-7: LGTM: Improved documentation text.

The description text change from "See the docs here" to "See the documentation" is a minor but professional improvement.

components/google_analytics/actions/create-key-event/create-key-event.mjs (2)

7-7: LGTM: Version bump is appropriate.

The minor version increment reflects the change to use propDefinition for the parent property.


12-16: ```shell
#!/bin/bash

Locate and display the implementation of listProperties in the Google Analytics app

rg -n "listProperties" -A5 -B5 components/google_analytics/google_analytics.app.mjs


</details>
<details>
<summary>components/google_analytics/actions/run-report-in-ga4/run-report-in-ga4.mjs (4)</summary>

`5-5`: **LGTM: Version bump is appropriate.**

The minor version increment reflects the changes to use propDefinition and add property processing.

---

`7-7`: **LGTM: Minor description improvement.**

The removal of "here" from the documentation link makes the sentence more concise.

---

`12-16`: **LGTM: Consistent use of propDefinition.**

The change to use `propDefinition` for the property aligns with the standardization effort across Google Analytics actions.

---

`69-71`: **Verify consistency in property handling across actions.**

This action extracts only the numeric portion from the property (line 69), while the `create-key-event` action uses the full property value directly. This inconsistency suggests different API requirements, but it should be verified that both approaches are correct for their respective endpoints.


```shell
#!/bin/bash
# Description: Compare property usage patterns across Google Analytics actions
# Expected: Understand if different endpoints require different property formats

# Search for property usage in Google Analytics actions
rg -A 5 -B 5 "this\.property|parent.*properties" --type js --glob "**/google_analytics/**/*.mjs"

Copy link
Collaborator

@GTFalcao GTFalcao left a comment

Choose a reason for hiding this comment

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

LGTM!

@michelle0927 michelle0927 merged commit 4cc580e into master Jun 25, 2025
11 checks passed
@michelle0927 michelle0927 deleted the issue-17147 branch June 25, 2025 14:55
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.

[FEATURE] update property (and maybe viewId) to use async options in Google Analytics components Google Analytics
2 participants