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ámetro | Tipo | Obligatorio | Descripción |
|---|---|---|---|
| entity | string | Sí | pageview reports on the visits of a site, event on one event.Valores: pageview, event |
| entity_id | string | No | With entity pageview, required: the id of the site, from List sites. |
| site_id | string | No | With entity event, required: the id of the site, from List sites. |
| entity_name | string | No | With entity event, required: the name of the event, from List events. |
| aggregates | string | Sí | 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_grouping | string | No | Groups the numbers by period. Omit it for totals. hour only works for ranges of up to 7 days.Valores: hour, day, month, year |
| field_grouping | string | No | Comma-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_by | string | No | A 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_from | string | No | Start 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_to | string | No | End as YYYY-MM-DD HH:MM:SS in the timezone of the site. The default is now. |
| limit | integer | No | Maximum rows, up to 1000. With field_grouping, the default is 500. |
| filters | string | No | JSON 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.
Otras tools de Fathom Analytics
- Listar sitiosGETLista los sitios de la cuenta con id, name, sharing y timezone, del más antiguo al más nuevo. El id es el código del script de seguimiento que piden las demás herramientas. Mientras has_more sea true, envía el id del último sitio como starting_after.
- Obtener sitioGETDevuelve un sitio con su nombre, sharing, zona horaria y fecha de creación.
- Crear sitioPOSTCrea un sitio y lo devuelve con el id para poner en el script de seguimiento. Necesita un token con el permiso Admin.
- Actualizar sitioPOSTModifica un sitio. Solo cambian los campos enviados.
- Listar eventosGETLista todos los nombres de evento que el sitio ha rastreado, con su moneda, ordenados por nombre. Los informes de un evento usan el nombre; el id solo sirve como cursor de página. Mientras has_more sea true, envía el id del último evento como starting_after.
- Obtener visitantes actualesGETDevuelve cuántas personas están en el sitio ahora mismo. Con detailed, también las 150 páginas y los 150 referidos principales.
- Listar hitosGETLista los hitos del sitio, las fechas marcadas en sus informes, del más antiguo al más nuevo. Mientras has_more sea true, envía el id del último hito como starting_after.
- Crear hitoPOSTMarca una fecha en los informes del sitio, como el lanzamiento de una campaña.
Toolkits de la misma categoría
Ver los 100 toolkitsMira Connect aplicado a tu producto.
Pruébalo durante 15 días sin tarjeta, o cuéntale tu caso a nuestro equipo.
