Obtener agregación en Fathom Analytics, con una API

Arma un informe personalizado sobre los pageviews de un sitio o sobre un evento: totales, o agrupados por período y por campos como pathname, referrer_source o utm_campaign. Los números vuelven como texto y no hay paginación: los informes agrupados devuelven hasta 500 filas, salvo que limit indique otro valor.

Identificador
fathom_get_aggregation

La llamada

POST https://connect.reportei.com/api/tools/fathom_get_aggregation/execute
Authorization: Bearer <merchant token>
x-customer-token: <customer token>
Content-Type: application/json
Accept: application/json

{
  "customer_toolkit": "<connection UUID>",
  "arguments": {
    "entity": "pageview",
    "aggregates": "<aggregates>"
  }
}

Tu sistema envía el id de la conexión de tu cliente y los argumentos de la tool. Los headers son los mismos de toda la API de Connect: el token de tu producto y el token de tu cliente.

Parámetros

Las descripciones de los parámetros siguen la documentación oficial de la app, en inglés.

ParámetroTipoObligatorioDescripción
entitystringSípageview reports on the visits of a site, event on one event.Valores: pageview, event
entity_idstringNoWith entity pageview, required: the id of the site, from List sites.
site_idstringNoWith entity event, required: the id of the site, from List sites.
entity_namestringNoWith entity event, required: the name of the event, from List events.
aggregatesstringSíComma-separated aggregates. For pageview: visits, uniques, pageviews, avg_duration and bounce_rate. For event: conversions, unique_conversions and value, which comes in cents.
date_groupingstringNoGroups the numbers by period. Omit it for totals. hour only works for ranges of up to 7 days.Valores: hour, day, month, year
field_groupingstringNoComma-separated fields to group by: hostname, pathname, entry_page, exit_page, referrer_hostname, referrer_pathname, referrer_source, ai_source, browser, country_code, city, state, region, device_type, operating_system, utm_campaign, utm_content, utm_medium, utm_source, utm_term, keyword or ref.
sort_bystringNoA field of aggregates or field_grouping with asc or desc, for example pageviews:desc. With date_grouping, timestamp:asc and timestamp:desc also work.
date_fromstringNoStart as YYYY-MM-DD HH:MM:SS in the timezone of the site, for example 2026-10-01 00:00:00. The default is the first recorded data.
date_tostringNoEnd as YYYY-MM-DD HH:MM:SS in the timezone of the site. The default is now.
limitintegerNoMaximum rows, up to 1000. With field_grouping, the default is 500.
filtersstringNoJSON array of filters, as text. Each filter has property, operator (is, is not, is like, is not like, matching or not matching) and a text value, for example [{"property":"pathname","operator":"is","value":"/pricing"}].

Conexiones posibles

Tu cliente conecta su cuenta de Fathom Analytics una sola vez, con uno de los modos de abajo. La misma conexión sirve para todas las tools del toolkit.

Clave de API

Tu cliente pega la clave de la app en una pantalla de Connect, o tu sistema envía la clave con POST /api/customer-toolkits, sin pantalla.

La respuesta

Si la llamada tiene éxito, Connect conserva el status y el cuerpo de la respuesta de la app. Los errores HTTP devueltos por la app usan el objeto {error, api_error}; la autenticación o validación pueden fallar antes de la ejecución. El header X-Toolkit-Execution-Id identifica la ejecución registrada, disponible en GET /api/tools/executions/{uuid}.

Lista para agentes de IA

El input de esta tool es un JSON Schema, disponible en GET /api/tools/fathom_get_aggregation. Se convierte en la definición de tool de tu agente sin conversión.

Mira Connect aplicado a tu producto.

Pruébalo durante 15 días sin tarjeta, o cuéntale tu caso a nuestro equipo.