mathiaschu/google-ads-analyzer

A Claude Code skill + MCP server setup for expert-level Google Ads campaign analysis

65

stars

3

commits

Python

primary language

Mar 10, 2026

updated

README

Google Ads Analyzer for Claude Code

A Claude Code skill + MCP server setup for expert-level Google Ads campaign analysis. Includes GAQL query templates, Quality Score diagnostics, Smart Bidding evaluation, Performance Max deep dives, and 12 reference documents.

What It Does

When installed, Claude Code can:

Read & Analyze:

  • Query your Google Ads accounts directly using GAQL (Google Ads Query Language)
  • Analyze campaign, ad group, keyword, and search term performance
  • Diagnose Quality Score issues at the component level (expected CTR, ad relevance, landing page)
  • Evaluate Impression Share to identify budget vs rank opportunities
  • Assess Smart Bidding performance and learning status
  • Deep dive Performance Max campaigns (asset groups, ad strength, cannibalization)
  • Review search term reports and identify negative keyword gaps
  • Generate structured analysis reports with prioritized recommendations

Write & Manage:

  • Add negative keywords to campaigns (Broad, Phrase, or Exact match)
  • Pause or enable campaigns, ad groups, and individual ads
  • Update daily budgets
  • Change bidding strategies (Target CPA, Target ROAS, Maximize Conversions, Maximize Conversion Value)

Components

ComponentWhat it does
Skill (skill/)Analysis framework with 12 reference docs that Claude loads as context
MCP ServerFork of google-ads-mcp with 6 write tools — connects Claude Code to the Google Ads API for reading and managing campaigns
Scripts (scripts/)OAuth setup helper

Prerequisites

  • Claude Code installed
  • Python 3.8+
  • uv (Python package manager — the MCP server runs via uvx)
  • A Google Ads account (with a Developer Token)
  • A Google Cloud project with the Google Ads API enabled

Installation

Step 1: Install the Skill

Copy the skill/ folder into your Claude Code project:

# From your Claude Code project root
mkdir -p .claude/skills/google-ads-analyzer
cp -r skill/* .claude/skills/google-ads-analyzer/

The skill is now active. Claude will automatically use it when you ask about Google Ads analysis.

Step 2: Set Up a Google Cloud Project

  1. Go to Google Cloud Console
  2. Create a new project (or use an existing one)
  3. Enable the Google Ads API:
    • Go to APIs & Services → Library
    • Search for "Google Ads API"
    • Click Enable
  4. Create an OAuth 2.0 Client ID:
    • Go to APIs & Services → Credentials
    • Click "Create Credentials" → OAuth Client ID
    • Application type: Desktop app
    • Download the JSON file

Step 3: Get a Developer Token

This is required to access the Google Ads API. It's separate from OAuth credentials.

  1. Sign in to your Google Ads manager account (MCC)
  2. Go to Tools & Settings → Setup → API Center
  3. Your Developer Token is shown there
  4. If you don't have one, apply for access (test accounts get instant approval)

Token access levels:

  • Test Account: Instant approval, only works with test ad accounts
  • Basic Access: Requires application review, works with real accounts
  • Standard Access: Higher rate limits, requires additional review

For most use cases, Basic Access is sufficient. The review process takes a few business days.

Step 4: Run the Setup Script

cd scripts/

# Place your downloaded OAuth client JSON in this folder
# (or point to it when prompted)

python3 setup.py

The script will:

  1. Ask for your OAuth client JSON path
  2. Ask for your Developer Token
  3. Ask for your Login Customer ID (MCC ID, optional)
  4. Open a browser for Google OAuth authorization
  5. Generate credentials.json and .env.google-ads
  6. Configure .mcp.json for Claude Code
  7. Test the connection

Step 5: Verify

Restart Claude Code, then ask:

"List my Google Ads accounts"

Claude should connect to your account and show available accounts.

Usage Examples

Once installed, you can ask Claude things like:

Analysis:

  • "Analyze my Google Ads campaigns from the last 30 days"
  • "What's my Quality Score distribution across keywords?"
  • "Show me Impression Share breakdown — am I losing to budget or rank?"
  • "Review my search terms and suggest negative keywords"
  • "Is my Smart Bidding strategy performing within target?"
  • "Deep dive into my Performance Max campaign"
  • "Compare this month vs last month across all campaigns"
  • "Which campaigns have the highest wasted spend?"

Management:

  • "Pause campaign X"
  • "Add these negative keywords to my Search campaign: [list]"
  • "Increase the daily budget on campaign Y to $100"
  • "Switch campaign Z to Target ROAS at 4x"

You can also share screenshots or exported data from the Google Ads UI — the skill works with any data format.

What's in the Reference Docs

DocumentCovers
core_concepts.mdAd Rank, Quality Score, Smart Bidding, PMax, GAQL overview
gaql_queries.mdReady-to-use GAQL queries for each analysis step
quality_score.md3 components, diagnosis by component, prioritization
impression_share.mdIS lost by budget vs rank, auction insights
smart_bidding.mdtCPA, tROAS, learning period, when to intervene
performance_max.mdAsset groups, signals, feed quality, cannibalization
conversion_tracking.mdTypes, DDA, conversion lag, primary vs secondary
account_structure.mdMCC hierarchy, naming, brand vs non-brand
search_terms_negatives.mdSearch term report, match types, negative keywords
ad_copy_rsa.mdRSA headlines, descriptions, ad strength, asset labels
segmentation.mdGAQL segments: device, geo, day_of_week, audiences
performance_fluctuations.mdNormal vs concerning changes, conversion lag trap

Troubleshooting

ErrorCauseFix
UNAUTHENTICATEDRefresh token revoked or expiredRun python3 scripts/setup.py again
PERMISSION_DENIEDDeveloper token not approved or wrong accountCheck token status in API Center; verify Login Customer ID
DEVELOPER_TOKEN_NOT_APPROVEDToken still in test modeApply for Basic Access in API Center
INVALID_CUSTOMER_IDWrong customer ID formatUse 10-digit ID without dashes
MCP not connectingConfig or credentials issueVerify .mcp.json paths are correct; restart Claude Code
No data returnedWrong date range or no active campaignsCheck campaign.status = 'ENABLED'; adjust date range

License

MIT

Contributors

agenciaclica

3 commits

mathiaschu/google-ads-analyzer

A Claude Code skill + MCP server setup for expert-level Google Ads campaign analysis

65

stars

3

commits

Python

primary language

Mar 10, 2026

updated

README

Google Ads Analyzer for Claude Code

A Claude Code skill + MCP server setup for expert-level Google Ads campaign analysis. Includes GAQL query templates, Quality Score diagnostics, Smart Bidding evaluation, Performance Max deep dives, and 12 reference documents.

What It Does

When installed, Claude Code can:

Read & Analyze:

  • Query your Google Ads accounts directly using GAQL (Google Ads Query Language)
  • Analyze campaign, ad group, keyword, and search term performance
  • Diagnose Quality Score issues at the component level (expected CTR, ad relevance, landing page)
  • Evaluate Impression Share to identify budget vs rank opportunities
  • Assess Smart Bidding performance and learning status
  • Deep dive Performance Max campaigns (asset groups, ad strength, cannibalization)
  • Review search term reports and identify negative keyword gaps
  • Generate structured analysis reports with prioritized recommendations

Write & Manage:

  • Add negative keywords to campaigns (Broad, Phrase, or Exact match)
  • Pause or enable campaigns, ad groups, and individual ads
  • Update daily budgets
  • Change bidding strategies (Target CPA, Target ROAS, Maximize Conversions, Maximize Conversion Value)

Components

ComponentWhat it does
Skill (skill/)Analysis framework with 12 reference docs that Claude loads as context
MCP ServerFork of google-ads-mcp with 6 write tools — connects Claude Code to the Google Ads API for reading and managing campaigns
Scripts (scripts/)OAuth setup helper

Prerequisites

  • Claude Code installed
  • Python 3.8+
  • uv (Python package manager — the MCP server runs via uvx)
  • A Google Ads account (with a Developer Token)
  • A Google Cloud project with the Google Ads API enabled

Installation

Step 1: Install the Skill

Copy the skill/ folder into your Claude Code project:

# From your Claude Code project root
mkdir -p .claude/skills/google-ads-analyzer
cp -r skill/* .claude/skills/google-ads-analyzer/

The skill is now active. Claude will automatically use it when you ask about Google Ads analysis.

Step 2: Set Up a Google Cloud Project

  1. Go to Google Cloud Console
  2. Create a new project (or use an existing one)
  3. Enable the Google Ads API:
    • Go to APIs & Services → Library
    • Search for "Google Ads API"
    • Click Enable
  4. Create an OAuth 2.0 Client ID:
    • Go to APIs & Services → Credentials
    • Click "Create Credentials" → OAuth Client ID
    • Application type: Desktop app
    • Download the JSON file

Step 3: Get a Developer Token

This is required to access the Google Ads API. It's separate from OAuth credentials.

  1. Sign in to your Google Ads manager account (MCC)
  2. Go to Tools & Settings → Setup → API Center
  3. Your Developer Token is shown there
  4. If you don't have one, apply for access (test accounts get instant approval)

Token access levels:

  • Test Account: Instant approval, only works with test ad accounts
  • Basic Access: Requires application review, works with real accounts
  • Standard Access: Higher rate limits, requires additional review

For most use cases, Basic Access is sufficient. The review process takes a few business days.

Step 4: Run the Setup Script

cd scripts/

# Place your downloaded OAuth client JSON in this folder
# (or point to it when prompted)

python3 setup.py

The script will:

  1. Ask for your OAuth client JSON path
  2. Ask for your Developer Token
  3. Ask for your Login Customer ID (MCC ID, optional)
  4. Open a browser for Google OAuth authorization
  5. Generate credentials.json and .env.google-ads
  6. Configure .mcp.json for Claude Code
  7. Test the connection

Step 5: Verify

Restart Claude Code, then ask:

"List my Google Ads accounts"

Claude should connect to your account and show available accounts.

Usage Examples

Once installed, you can ask Claude things like:

Analysis:

  • "Analyze my Google Ads campaigns from the last 30 days"
  • "What's my Quality Score distribution across keywords?"
  • "Show me Impression Share breakdown — am I losing to budget or rank?"
  • "Review my search terms and suggest negative keywords"
  • "Is my Smart Bidding strategy performing within target?"
  • "Deep dive into my Performance Max campaign"
  • "Compare this month vs last month across all campaigns"
  • "Which campaigns have the highest wasted spend?"

Management:

  • "Pause campaign X"
  • "Add these negative keywords to my Search campaign: [list]"
  • "Increase the daily budget on campaign Y to $100"
  • "Switch campaign Z to Target ROAS at 4x"

You can also share screenshots or exported data from the Google Ads UI — the skill works with any data format.

What's in the Reference Docs

DocumentCovers
core_concepts.mdAd Rank, Quality Score, Smart Bidding, PMax, GAQL overview
gaql_queries.mdReady-to-use GAQL queries for each analysis step
quality_score.md3 components, diagnosis by component, prioritization
impression_share.mdIS lost by budget vs rank, auction insights
smart_bidding.mdtCPA, tROAS, learning period, when to intervene
performance_max.mdAsset groups, signals, feed quality, cannibalization
conversion_tracking.mdTypes, DDA, conversion lag, primary vs secondary
account_structure.mdMCC hierarchy, naming, brand vs non-brand
search_terms_negatives.mdSearch term report, match types, negative keywords
ad_copy_rsa.mdRSA headlines, descriptions, ad strength, asset labels
segmentation.mdGAQL segments: device, geo, day_of_week, audiences
performance_fluctuations.mdNormal vs concerning changes, conversion lag trap

Troubleshooting

ErrorCauseFix
UNAUTHENTICATEDRefresh token revoked or expiredRun python3 scripts/setup.py again
PERMISSION_DENIEDDeveloper token not approved or wrong accountCheck token status in API Center; verify Login Customer ID
DEVELOPER_TOKEN_NOT_APPROVEDToken still in test modeApply for Basic Access in API Center
INVALID_CUSTOMER_IDWrong customer ID formatUse 10-digit ID without dashes
MCP not connectingConfig or credentials issueVerify .mcp.json paths are correct; restart Claude Code
No data returnedWrong date range or no active campaignsCheck campaign.status = 'ENABLED'; adjust date range

License

MIT

Contributors

agenciaclica

3 commits

Languages

Python

100.0%