Skip to content
Marketing
Skill

/gaql-reference

Google Ads Query Language (GAQL) Reference — complete syntax, resource types, fields, operators, date macros, and ready-to-use query patterns

From plugin
claude-code-marketing-skills
11462 skills

Claude Code

$ npx -y skills add cognyai/claude-code-marketing-skills --skill gaql-reference --agent claude-code

SKILL.md

gaql-reference.SKILL.md
name: gaql-reference
description: Google Ads Query Language (GAQL) Reference — complete syntax, resource types, fields, operators, date macros, and ready-to-use query patterns
version: "1.1.1"
author: Cogny AI
platforms: []
user-invocable: true
argument-hint: "<query or topic>"
allowed-tools:
  - WebSearch
  - Read
  - Write
  - Bash
  # Google Ads tools (when connected via Cogny MCP)
  - mcp__cogny__list_integrations
  - mcp__cogny__refresh_mcp_discovery
  - mcp__cogny__mcp__Google_Ads__tool_execute_gaql
  - mcp__cogny__mcp__Google_Ads__tool_get_gaql_doc
  - mcp__cogny__mcp__Google_Ads__tool_get_reporting_view_doc
  - mcp__cogny__mcp__Google_Ads__tool_list_accessible_accounts
  - mcp__cogny__mcp__Bing_Ads__tool_get_report

Google Ads Query Language (GAQL) Reference

Complete reference for GAQL syntax, resource types, fields, operators, date macros, and common query patterns for Google Ads reporting and optimization.

Full docs: https://cogny.com/docs/gaql-reference

Usage

/gaql-reference                           # Show full syntax overview
/gaql-reference search terms              # Search terms report pattern
/gaql-reference quality score             # Quality Score analysis query
/gaql-reference impression share          # Budget & impression share query
/gaql-reference geographic                # Geographic performance query
/gaql-reference change history            # Change history audit query

Instructions

You are a Google Ads Query Language (GAQL) expert. Use this reference to help users write correct GAQL queries, understand resource types, choose the right fields, and avoid common pitfalls.

When the user asks a question, find the relevant section below and provide precise, actionable answers with ready-to-use GAQL examples.

If the user provides a specific topic as an argument, focus on that area. Otherwise, provide an overview of the GAQL syntax and available resources.

When the user has Cogny MCP tools available, prefer using `mcp__cogny__mcp__Google_Ads__tool_execute_gaql` to run queries directly and `mcp__cogny__mcp__Google_Ads__tool_get_gaql_doc` or `mcp__cogny__mcp__Google_Ads__tool_get_reporting_view_doc` for API documentation lookups.

Run it live

If Cogny isn't connected, skip this and note what connecting adds.

| Engine | How | Note | |--------|-----|------| | Google Ads | `mcp__cogny__mcp__Google_Ads__tool_execute_gaql` (after `tool_list_accessible_accounts`) | Free without an account: the reference still works, queries just aren't run | | Microsoft Ads | No GAQL. `mcp__cogny__mcp__Bing_Ads__tool_get_report` (`report_type`: campaign, ad_group, keyword, search_query, ad, geographic; optional `columns`) | Money in account-currency units, percents as percents |

---

Syntax

Formal Grammar

query         = SELECT field_list FROM resource_name
                [ WHERE condition_list ]
                [ ORDER BY ordering { , ordering } ]
                [ LIMIT positive_integer ]
                [ PARAMETERS param_list ]

field_list    = field_name { , field_name }
condition_list = condition { AND condition }
condition     = field_name operator value
ordering      = field_name [ ASC | DESC ]
param_list    = param_name = param_value { , param_name = param_value }

Clauses

| Clause | Required | Description | |--------|----------|-------------| | `SELECT` | Yes | Fields to return (resource fields, metrics, segments) | | `FROM` | Yes | Single resource type to query | | `WHERE` | No | Filter conditions joined by `AND` (no `OR` support) | | `ORDER BY` | No | Sort by one or more comma-separated fields, each `ASC` or `DESC` | | `LIMIT` | No | Maximum number of rows to return | | `PARAMETERS` | No | Query-level parameters (e.g., `include_drafts = true`) |

Example

SELECT
  campaign.name,
  metrics.impressions,
  metrics.clicks,
  metrics.cost_micros
FROM campaign
WHERE campaign.status = 'ENABLED'
  AND segments.date DURING LAST_30_DAYS
ORDER BY metrics.impressions DESC
LIMIT 50

Resource Types (FROM Clause)

Campaign Management

| Resource | Description | |----------|-------------| | `campaign` | Campaign settings, status, bidding, budget | | `campaign_budget` | Shared and campaign-level budgets | | `campaign_criterion` | Campaign-level targeting criteria | | `campaign_bid_modifier` | Bid adjustments at campaign level | | `bidding_strategy` | Portfolio bidding strategies |

Ad Groups & Ads

| Resource | Description | |----------|-------------| | `ad_group` | Ad group settings, status, targeting | | `ad_group_ad` | Ads within ad groups (RSA, ETA, etc.) | | `ad_group_ad_asset_view` | Asset-level performance for responsive ads | | `ad_group_criterion` | Keywords, audiences, and other criteria | | `ad_group_bid_modifier` | Bid adjustments at ad group level |

Performance Views

| Resource | Description | |----------|-------------| | `keyword_view` | Keyword-level performance metrics | | `search_term_view` | Actual search queries that triggered ads | | `landing_page_view` | Landing page performance | | `geographic_view` | Performance by geographic location | | `location_view` | Performance by targeted/excluded location | | `age_range_view` | Performance by age range demographic | | `gender_view` | Performance by gender demographic | | `user_location_view` | Performance by user's physical location | | `display_keyword_view` | Display network keyword performance | | `topic_view` | Display/video topic targeting performance | | `managed_placement_view` | Managed placement performance |

Conversion & Attribution

| Resource | Description | |----------|-------------| | `conversion_action` | Conversion action configuration | | `customer_conversion_goal` | Conversion goals and optimization settings |

Account & Extensions

| Resource | Description | |----------|-------------| | `customer` | Account-level settings | | `asset` | Account assets (sitelinks, callouts, images) | | `asset_group` | Performance M

Read more
@cognyai
Ships withclaude-code-marketing-skills

AI marketing skills for Claude Code, Cursor, Windsurf, and other AI coding tools. Audit SEO, analyze ads, research competitors, qualify leads — all from your terminal. Free skills need no account. Premium skills connect your real data for $9/mo.

Stars on GitHub

Momentum

stars in total
114
Star history of cognyai/claude-code-marketing-skills on GitHub, a chart by star-history.com

More skills from other plugins.

seo

seo

Comprehensive SEO analysis for any website or business type. Full site audits, single-page analysis, technical SEO (crawlability,…

@agricidaniel@agricidanielInstall Skill
brag

brag

Turn the current project website into a short, polished, shareable launch video using Hyperframes. Use when someone says "/brag",…

brag3w21k
@latent-spaces@latent-spacesInstall Skill
geo-audit

geo-audit

Full website GEO+SEO audit with parallel subagent delegation. Orchestrates a comprehensive Generative Engine Optimization audit…

Questions about gaql-reference.

Which coding agents can use gaql-reference?
gaql-reference installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.