-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Fix filter handling for Google Search Console action #16467
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
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,18 +1,39 @@ | ||
| # Overview | ||
|
|
||
| The Google Search Console API opens a treasure trove of data and insights about your website’s presence in Google Search results. You can get detailed reports on your site's search traffic, manage and test your site's sitemaps and robots.txt files, and see which queries bring users to your site. On Pipedream, utilize this API to automate checks on site performance, integrate with other tools for deeper analysis, or keep tabs on your SEO strategy's effectiveness. | ||
| The Google Search Console API opens a treasure trove of data and insights about your website's presence in Google Search results. You can get detailed reports on your site's search traffic, manage and test your site's sitemaps and robots.txt files, and see which queries bring users to your site. On Pipedream, utilize this API to automate checks on site performance, integrate with other tools for deeper analysis, or keep tabs on your SEO strategy's effectiveness. | ||
|
|
||
| # Example Use Cases | ||
| ## Working with Domain Properties and Subdomains | ||
|
|
||
| - **SEO Performance Report to Slack**: Automate daily or weekly SEO performance reports. Use the Google Search Console API to fetch search analytics data, then send a summary report to a Slack channel, keeping the team informed about trends, keyword rankings, and click-through rates. | ||
| Google Search Console distinguishes between URL properties and Domain properties: | ||
|
|
||
| - **Sync Search Results with Google Sheets**: Create a workflow that periodically pulls data from the Google Search Console API and adds it to a Google Sheet. This is useful for maintaining an evolving dataset for deeper analysis, historical reference, or sharing insights across teams without giving direct access to the Search Console. | ||
| - **URL properties** are specific site URLs (e.g., `https://example.com` or `https://www.example.com`) | ||
| - **Domain properties** include all subdomains and protocols (e.g., `sc-domain:example.com`) | ||
|
|
||
| - **Automatic Sitemap Submission**: Set up a Pipedream workflow that triggers whenever a new sitemap is generated in your content management system (CMS). The workflow can then automatically submit the sitemap to Google Search Console via API, ensuring Google has the latest structure of your site for crawling and indexing. | ||
| When working with subdomains: | ||
|
|
||
| 1. Select the domain property from the dropdown (e.g., `sc-domain:example.com`) | ||
| 2. Enter the subdomain URL in the "Subdomain Filter" field (e.g., `https://mcp.example.com`) | ||
| 3. By default, this will filter for pages containing that subdomain URL, including all subpages like `https://mcp.example.com/app/slack` | ||
|
|
||
| This approach ensures you can access subdomain data even if the subdomain isn't individually verified in Search Console. | ||
|
|
||
| ### Important: Getting Data for Individual Pages | ||
|
|
||
| To see data broken down by individual pages (rather than just aggregate data): | ||
|
|
||
| ## Available Actions | ||
| - Add "page" to your dimensions list | ||
| - This will return separate rows for each page, rather than a single aggregated row | ||
|
|
||
| [Retrieve Site Performance Data](./actions/retrieve-site-performance-data/README.md) | ||
| [Submit URL for Indexing](./actions/submit-url-for-indexing/README.md) | ||
| For advanced filtering needs, you can also: | ||
|
|
||
| - Change the filter dimension (page, query, country, etc.) | ||
| - Change the filter operator (contains, equals, etc.) | ||
| - Or use the advanced filters for complete customization | ||
|
|
||
| ## Example Use Cases | ||
|
|
||
| - **SEO Performance Report to Slack**: Automate daily or weekly SEO performance reports. Use the Google Search Console API to fetch search analytics data, then send a summary report to a Slack channel, keeping the team informed about trends, keyword rankings, and click-through rates. | ||
|
|
||
| - **Sync Search Results with Google Sheets**: Create a workflow that periodically pulls data from the Google Search Console API and adds it to a Google Sheet. This is useful for maintaining an evolving dataset for deeper analysis, historical reference, or sharing insights across teams without giving direct access to the Search Console. | ||
|
|
||
| - **Automatic Sitemap Submission**: Set up a Pipedream workflow that triggers whenever a new sitemap is generated in your content management system (CMS). The workflow can then automatically submit the sitemap to Google Search Console via API, ensuring Google has the latest structure of your site for crawling and indexing. |
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
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
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Good implementation of dynamic filter construction!
The approach to dynamically build dimension filters based on user input is clean and maintainable. However, there's one potential edge case to address:
Consider handling the case where both
subdomainFilterandadvancedDimensionFiltersare provided:if (subdomainFilter) { // If user provided a subdomain filter, create the filter structure dimensionFilterGroups = { filterGroups: [ { filters: [ { dimension: filterDimension || "page", operator: filterOperator || "contains", expression: subdomainFilter, }, ], }, ], }; } else if (advancedDimensionFilters) { // If user provided advanced filters, use those dimensionFilterGroups = googleSearchConsole.parseIfJsonString(advancedDimensionFilters); +} else { + dimensionFilterGroups = undefined; }This would make the intention explicit when neither filter is provided.
📝 Committable suggestion