Skip to content

feat(google-ads): add google ads integration for campaign and ad performance queries - #3360

Merged
waleedlatif1 merged 8 commits into
stagingfrom
waleedlatif1/google-ads
Mar 13, 2026
Merged

feat(google-ads): add google ads integration for campaign and ad performance queries#3360
waleedlatif1 merged 8 commits into
stagingfrom
waleedlatif1/google-ads

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Add Google Ads integration with 6 tools: list customers, list campaigns, campaign performance, list ad groups, ad performance, custom GAQL query
  • Register OAuth provider in auth.ts, oauth.ts, and oauth-required-modal with adwords scope
  • Add block with operation dropdown, developer token field, wandConfig on GAQL input, and optional fields behind advanced mode
  • Generate docs with manual intro section

Type of Change

  • New feature

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercelBot commented Feb 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

ProjectDeploymentActionsUpdated (UTC)
docsReadyReadyPreview, CommentMar 13, 2026 1:50am

Request Review

@greptile-apps

greptile-appsBot commented Feb 27, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds a complete Google Ads integration with 6 tools (list customers, list campaigns, campaign performance, list ad groups, ad performance, and custom GAQL queries). The implementation follows established patterns with proper OAuth setup, input validation, and comprehensive block configuration including AI-assisted query generation via wandConfig.

Key additions:

  • OAuth provider registration with adwords scope across auth.ts, oauth.ts, and oauth-required-modal
  • Six tool implementations with validated GAQL query construction
  • Block configuration with operation dropdown, conditional fields, and advanced mode
  • Comprehensive documentation with manual intro section
  • Input validation functions for IDs, statuses, dates, and date ranges

The code follows project standards with absolute imports, proper type definitions, correct credential visibility settings (hidden for OAuth, user-only for developer token per custom rules), and consistent error handling patterns.

Confidence Score: 5/5

  • This PR is safe to merge with no critical issues found
  • The implementation is well-structured, follows all project patterns and custom instructions, includes proper validation and error handling, and demonstrates thorough attention to security with appropriate credential visibility settings
  • No files require special attention

Important Files Changed

FilenameOverview
apps/sim/tools/google_ads/types.tsDefines TypeScript types and validation functions for Google Ads API parameters with proper input validation
apps/sim/tools/google_ads/campaign_performance.tsImplements campaign performance tool with validated GAQL query generation and date range handling
apps/sim/tools/google_ads/ad_performance.tsImplements ad performance tool with filtering by campaign/ad group and proper validation
apps/sim/tools/google_ads/search.tsImplements custom GAQL query tool with pagination support and proper search settings
apps/sim/blocks/blocks/google_ads.tsDefines block configuration with operation dropdown, conditional fields, and wandConfig for AI-assisted GAQL query generation
apps/sim/lib/auth/auth.tsAdds google-ads OAuth provider with proper scopes, redirect URI, and user info fetching
apps/sim/lib/oauth/oauth.tsRegisters google-ads service in OAuth provider configuration with icon and scopes
apps/sim/tools/registry.tsRegisters all six Google Ads tools in the global tools registry

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
Start[User selects operation] --> OAuth[Connect Google Ads account]
OAuth --> Config[Configure parameters]
Config --> Route{Route by operation}
Route -->|list_customers| LC[List Customers Tool]
Route -->|list_campaigns| LCamp[List Campaigns Tool]
Route -->|campaign_performance| CP[Campaign Performance Tool]
Route -->|list_ad_groups| LAG[List Ad Groups Tool]
Route -->|ad_performance| AP[Ad Performance Tool]
Route -->|search| GS[Custom GAQL Query Tool]
LC --> Validate[Validate inputs]
LCamp --> Validate
CP --> Validate
LAG --> Validate
AP --> Validate
GS --> Validate
Validate --> BuildQuery[Build GAQL query]
BuildQuery --> CallAPI[Call Google Ads API]
CallAPI --> Transform[Transform response]
Transform --> Output[Return formatted output]
Loading

Last reviewed commit: 129de50

@greptile-appsgreptile-appsBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

20 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Comment threadapps/sim/tools/google_ads/list_ad_groups.ts Outdated
@waleedlatif1

Copy link
Copy Markdown
CollaboratorAuthor

@cursor review

@waleedlatif1

Copy link
Copy Markdown
CollaboratorAuthor

@greptile

@cursorcursorBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Comment threadapps/sim/tools/google_ads/search.ts
waleedlatif1and others added 6 commits March 12, 2026 18:35
- Replace hardcoded scopes in auth.ts with getCanonicalScopesForProvider('google-ads')
- Replace hardcoded requiredScopes in block with getScopesForService('google-ads')
- Add type re-export from index.ts barrel
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@waleedlatif1
waleedlatif1force-pushed the waleedlatif1/google-ads branch from 6703226 to 88cfe0cCompareMarch 13, 2026 01:43
Align google-ads with all other Google services by including
userinfo.email and userinfo.profile scopes in the centralized
OAUTH_PROVIDERS config.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@waleedlatif1
waleedlatif1 merged commit a8bbab2 into stagingMar 13, 2026
11 checks passed
@waleedlatif1
waleedlatif1 deleted the waleedlatif1/google-ads branch March 13, 2026 04:09
adithyaakrishna pushed a commit to adithyaakrishna/sim that referenced this pull request Mar 20, 2026
…ormance queries (simstudioai#3360)
* feat(google-ads): add google ads integration for campaign and ad performance queries
* fix(google-ads): add input validation for GAQL query parameters
* fix(google-ads): remove deprecated pageSize param, fix searchSettings nesting, add missing date ranges
* fix(google-ads): validate managerCustomerId before use in login-customer-id header
* chore(docs): regenerate docs after google ads integration
* fix(google-ads): use centralized scope utilities and add type re-export
- Replace hardcoded scopes in auth.ts with getCanonicalScopesForProvider('google-ads')
- Replace hardcoded requiredScopes in block with getScopesForService('google-ads')
- Add type re-export from index.ts barrel
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix(google-ads): add userinfo scopes to oauth provider config
Align google-ads with all other Google services by including
userinfo.email and userinfo.profile scopes in the centralized
OAUTH_PROVIDERS config.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* lint
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for freeto 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.

1 participant

@waleedlatif1