Skip to content

ToolsGoogle Analytics

Docs

Tools

Google Analytics

The site's GA4 traffic, once Google is connected. Free.

Things to ask#

Ask your agent in plain words. It picks the tool.

  • How many sessions and users did acme.com get last month, by landing page?
  • Which traffic sources convert best on acme.com this quarter?
  • Which GA4 metrics and dimensions can I use in a report for acme.com?

Tools in Google Analytics#

3 tools. Prices are in credits; 1,000 credits are $1.

ToolUse it whenCost
analytics_list_propertiesBefore any other analytics_ tool, to find the GA4 property for a site.Free
analytics_get_fieldsYou are unsure which dimension or metric names a GA4 report takes.Free
analytics_get_reportYou need a site's GA4 traffic: sessions, users, conversions or revenue, by page, source, country, device or date.Free

Connect Google first#

These tools read your own Google data, so each brand connects its Google account with Search Console and Analytics access, on the Connect page. Then a call can leave out site_url or property_id and use the ones chosen for the brand; pass brand to pick another site from list_brands. Until Google is connected a call answers 403 forbidden, and the error says where to connect. The tools are free.

List Google Analytics properties#

Toolanalytics_list_properties
Reads
Good for
Before any other analytics_ tool, to find the GA4 property for a site.
Not the tool for
Universal Analytics, which Google shut down. Each brand connects its own Google account with Search Console and Analytics access; the error says where the user does that.
What you get
Every GA4 property the brand's Google account can read, with its account, and which one the brand uses.
Cost
Free

Parameters

NameTypeRequiredDescription
brandstringNoWhich brand: its id or domain from list_brands. Default: the brand this connection is set to, or the organization's only brand.
Example
{
  "name": "analytics_list_properties",
  "arguments": {}
}

List Analytics fields#

Toolanalytics_get_fields
Reads
Good for
You are unsure which dimension or metric names a GA4 report takes.
Not the tool for
Running the report (use analytics_get_report). Each brand connects its own Google account with Search Console and Analytics access; the error says where the user does that.
What you get
The property's dimensions and metrics, each with its API name and display name.
Cost
Free

Parameters

NameTypeRequiredDescription
brandstringNoWhich brand: its id or domain from list_brands. Default: the brand this connection is set to, or the organization's only brand.
property_idstringNoThe GA4 property id from analytics_list_properties. Default: the one chosen for the brand.
Example
{
  "name": "analytics_get_fields",
  "arguments": {
    "property_id": "348201957"
  }
}

Run an Analytics report#

Toolanalytics_get_report
Reads
Good for
You need a site's GA4 traffic: sessions, users, conversions or revenue, by page, source, country, device or date.
Not the tool for
Google Search data (use console_get_search_analytics). Each brand connects its own Google account with Search Console and Analytics access; the error says where the user does that.
What you get
Rows of the metrics asked for, by the dimensions asked for, with totals.
Cost
Free

Parameters

NameTypeRequiredDescription
brandstringNoWhich brand: its id or domain from list_brands. Default: the brand this connection is set to, or the organization's only brand.
property_idstringNoThe GA4 property id from analytics_list_properties. Default: the one chosen for the brand.
metricsstring[]YesGA4 metric names, e.g. sessions, totalUsers, conversions.
dimensionsstring[]NoGA4 dimension names, e.g. pagePath, sessionSource, country, date.
start_datestringNoFirst day, YYYY-MM-DD. Default: the last 28 days.
end_datestringNoLast day, YYYY-MM-DD. Default: the last 28 days.
order_bystringNoA metric or dimension to sort by, descending. Default the first metric.
filter{ dimension, match, value }No-
limitintegerNoDefault 100.
Example
{
  "name": "analytics_get_report",
  "arguments": {
    "property_id": "348201957",
    "metrics": [
      "sessions",
      "totalUsers"
    ],
    "dimensions": [
      "pagePath"
    ],
    "limit": 25
  }
}