Skip to main content
Glama

Analytics conversion attribution

run_ga4_attribution
Read-only

Show which channels, campaigns or sources get the credit for conversions under GA4's attribution models, or compare data-driven with last click.

The view of GA4's Advertising workspace: conversions, revenue, ad cost and ROAS per channel (or campaign, source, country, device) attributed by the model, not by session. attribution_model COMPARE runs data-driven and last click side by side and returns each row's share of the credit under both and the shift in percentage points, with insights naming the channels that gain or lose most. Conversions can be named by key event name; empty means all. Uses the GA4 Data API v1alpha (runReport with a conversion spec), which Google is still rolling out: a property without it gets an explanation and the fallback. Ad cost and ROAS need Google Ads linked to the property.

Google Analytics Data API: https://developers.google.com/analytics/devguides/reporting/data/v1 and Admin API: https://developers.google.com/analytics/devguides/config/admin/v1

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "run_ga4_attribution"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoMaximum rows per model.
metricsNoAny of allConversionsByConversionDate, allConversionsByInteractionDate, totalRevenueByConversionDate, totalRevenueByInteractionDate, advertiserAdCost, advertiserAdClicks, advertiserAdImpressions, advertiserAdCostPerClick, advertiserAdCostPerAllConversionsByConversionDate, advertiserAdCostPerAllConversionsByInteractionDate, returnOnAdSpendByConversionDate, returnOnAdSpendByInteractionDate. Default: conversions, revenue, ad cost and ROAS by conversion date.
dimensionsNoAny of campaignName, continent, country, defaultChannelGroup (default), deviceCategory, medium, platform, primaryChannelGroup, source, sourceMedium, sourcePlatform, subcontinent.
conversionsNoKey event names (e.g. ["purchase"]) or GA4 conversion action IDs ("conversionActions/123"); empty for all.
property_idNoGA4 property as "properties/123456789" or the bare numeric ID. If empty, uses the default from config.
date_range_endNoSame formats.today
date_range_startNo"today", "yesterday", "NdaysAgo" or "YYYY-MM-DD".28daysAgo
attribution_modelNoDATA_DRIVEN (default), LAST_CLICK, or COMPARE.DATA_DRIVEN

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.2/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond the readOnly/openWorld annotations, it discloses that the call relies on the v1alpha Data API with a conversion spec that Google is still rolling out, and that unsupported properties return an explanation plus a fallback rather than failing silently. It also spells out that COMPARE returns per-row credit share under both models, the percentage-point shift, and insights naming the biggest gainers and losers — genuine output-shape information not carried by the annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The core capability is front-loaded in the first sentence, followed by scope, model behavior, and prerequisites in a logical order with no filler. The trailing Google API documentation links are boilerplate that does not help tool selection, costing a point.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an 8-parameter, all-optional read tool with a full output schema, the description covers purpose, model semantics, data-source prerequisites, limits of the alpha API, and fallback behavior — enough to call it correctly. The only gap is explicit disambiguation from closely related reporting and attribution-check siblings.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds real meaning for attribution_model: it explains what COMPARE actually produces (dual credit shares plus pp delta and insights) rather than just restating the enum. It also reinforces that an empty 'conversions' value means all key events, which the schema states but the prose emphasizes in context.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific verb and resource ('Show which channels, campaigns or sources get the credit for conversions under GA4's attribution models') and adds a scoping clause ('attributed by the model, not by session') that separates it from ordinary session-based GA4 reporting. It stops short of naming overlapping siblings like attribution_check, analyze_campaign_conversions, or run_ga4_report, so an agent must infer the boundary.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives a clear use case (attribution-modeled conversion/revenue/ad cost per channel or campaign, or comparing data-driven against last click) and states a real prerequisite: ad cost and ROAS require Google Ads linked to the property. It also explains what happens when the property lacks the conversion spec (explanation plus fallback). It does not explicitly say when to prefer a sibling tool instead.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.