Skip to content
Agentmart
Submit a tool

gmp-bq

BigQuery: Query GMP export data (GA4, Ads, GSC) with pre-built templates and custom SQL.

Skill by lucianfialho

IndexedApache-2.0★ 33
Write a review

Chalk Labs

Need help deploying gmp-bq?

Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.

Book a call

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/lucianfialho-gmp-bq

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

BigQuery: Query GMP export data (GA4, Ads, GSC) with pre-built templates and custom SQL.

Use cases: backend, data, marketing

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/gmp-bq

What's inside

Skill name
gmp-bq
Description
BigQuery: Query GMP export data (GA4, Ads, GSC) with pre-built templates and custom SQL.
License
Apache-2.0
Instructions
103 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

# bq (BigQuery API v2)

> **PREREQUISITE:** Read `../gmp-shared/SKILL.md` for auth, global flags, and output formats.
>
> **EXTRA AUTH:** BigQuery requires the `bigquery.readonly` scope. If you authenticated before this feature was added, run `gmp auth login` again to grant the new scope.

```bash
gmp bq <command> [flags]
```

## Commands

| Command | Description |
|---------|-------------|
| [`templates`](#templates) | List available pre-built query templates |
| [`query`](../gmp-bq-query/SKILL.md) | Run a pre-built query template |
| `explore` | List tables and schema in a BigQuery dataset |
| `custom` | Run a custom SQL query |

## Quick Reference

### List all templates

```bash
gmp bq templates
gmp bq templates --service ga4 -f table
gmp bq templates --service ads -f json
gmp bq templates --service gsc
```

### Run a template

```bash
gmp bq query -t ga4-events-flat --project my-project --dataset analytics_123456789 -r 30d
gmp bq query -t ads-wasted-spend --project my-project --dataset my_ads_dataset -r 90d -f table
gmp bq query -t gsc-top-pages --project my-project --dataset searchconsole -r 2024-01-01..2024-03-31
```

### Explore a dataset

```bash
# List tables
gmp bq explore --project my-project --dataset analytics_123456789

# Show schema for a specific table
gmp bq explore --project my-project --dataset analytics_123456789 --table events_20240101
```

### Run custom SQL

```bash
gmp bq custom --project my-project -q "SELECT event_date, COUNT(*) FROM \`my-project.analytics_123456789.events_20240101\` GROUP BY event_date"

# Mask PII fields (user_pseudo_id, user_id, email, phone, address) before output
gmp bq custom --project my-project -q "SELECT user_pseudo_id, event_name FROM ..." --privacy-filter
```

`query` and `custom` both accept `--privacy-filter`: redacts known GA4 PII fields by default, or pseudonymizes them (stable hash, not reversible) if `GMP_PII_SALT` is set in the environment.

## Available Templates

### GA4 (6 templates)

| Template | Description |
|----------|-------------|
| `ga4-events-flat` | Flatten nested `event_params` into columns |
| `ga4-funnel` | Funnel analysis from event sequences |
| `ga4-attribution` | Multi-touch attribution (source/medium per session) |
| `ga4-user-journey` | Session-level page paths |
| `ga4-ecommerce` | Purchase/revenue with product-level detail |
| `ga4-retention` | Weekly cohort retention from first visit |

### Google Ads (3 templates)

| Template | Description |
|----------|-------------|
| `ads-wasted-spend` | Search terms with spend and zero conversions |
| `ads-quality-trend` | Keyword quality score over time |
| `ads-cross-campaign` | Cross-campaign performance comparison |

### GSC (3 templates)

| Template | Description |
|----------|-------------|
| `gsc-top-pages` | Top pages by clicks with CTR/position |
| `gsc-query-clusters` | Top queries by volume (excludes anonymized) |
| `gsc-cannibalization` | Queries with multiple competing pages |

## Date Range Formats

| Format | Example | Description |
|--------|---------|-------------|
| Relative | `30d`, `7d`, `90d` | Last N days |
| Keywords | `today`, `yesterday` | Single day |
| Absolute | `2024-01-01..2024-03-31` | Custom range |

Dates are converted to `YYYYMMDD` format for GA4 `_TABLE_SUFFIX` and to `YYYY-MM-DD` for GSC/Ads `_DATA_DATE` partitions.

## Tips

- Use `gmp bq explore` first to discover what tables/datasets are available.
- GA4 datasets are typically named `analytics_<PROPERTY_ID>`.
- GSC bulk export datasets contain `searchdata_site_impression` and `searchdata_url_impression` tables.
- Google Ads transfer datasets contain tables like `ads_Campaign_<CUSTOMER_ID>`, `ads_CampaignBasicStats_<CUSTOMER_ID>`, etc.
- Default output is JSON -- use `-f table` for human-readable output.
- BigQuery queries have processing costs -- use `LIMIT` and date ranges to control scan size.

From lucianfialho/gmp-cli, Apache-2.0.

More from lucianfialho/gmp-cli

Signals

Stars
33
Forks
3
Open issues
5
Last commit (this folder)
Apr 13, 2026 (6 months ago)
Last release
Apr 27, 2026 (6 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
Apache-2.0
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from lucianfialho

Done for you

Rather not set it up yourself?

Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.

See how we build AI agents →Read the case studies

Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.

launches shipped
50+
launches shipped
media placements
500+
media placements
founders on every account
2
founders on every account

Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block

Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.

Get gmp-bq running in your business

Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.

Goes to the Chalk Labs founders, not the newsletter. Privacy

Need help deploying gmp-bq?

CallGet help
Cite this page

gmp-bq skill. Agent Mart. https://agentmart.dev/skills/lucianfialho-gmp-bq (last updated 2026-10-24)