Obter agregação no Fathom Analytics, por uma API

Monta um relatório personalizado sobre os pageviews de um site ou sobre um evento: totais, ou agrupados por período e por campos como pathname, referrer_source ou utm_campaign. Os números voltam como texto e não há paginação: relatórios agrupados retornam até 500 linhas, a menos que limit diga outro valor.

Identificador
fathom_get_aggregation

A chamada

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>"
  }
}

Seu sistema envia o id da conexão do cliente e os argumentos da tool. Os headers são os mesmos de toda a API do Connect: o token do seu produto e o token do cliente.

Parâmetros

As descrições dos parâmetros seguem a documentação oficial do app, em inglês.

ParâmetroTipoObrigatórioDescrição
entitystringSimpageview reports on the visits of a site, event on one event.Valores: pageview, event
entity_idstringNãoWith entity pageview, required: the id of the site, from List sites.
site_idstringNãoWith entity event, required: the id of the site, from List sites.
entity_namestringNãoWith entity event, required: the name of the event, from List events.
aggregatesstringSimComma-separated aggregates. For pageview: visits, uniques, pageviews, avg_duration and bounce_rate. For event: conversions, unique_conversions and value, which comes in cents.
date_groupingstringNãoGroups the numbers by period. Omit it for totals. hour only works for ranges of up to 7 days.Valores: hour, day, month, year
field_groupingstringNãoComma-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_bystringNãoA 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_fromstringNãoStart 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_tostringNãoEnd as YYYY-MM-DD HH:MM:SS in the timezone of the site. The default is now.
limitintegerNãoMaximum rows, up to 1000. With field_grouping, the default is 500.
filtersstringNãoJSON 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"}].

Conexões possíveis

O seu cliente conecta a conta do Fathom Analytics uma vez, por um dos modos abaixo. A mesma conexão serve para todas as tools do toolkit.

Chave de API

O cliente cola a chave do app numa tela do Connect, ou o seu sistema envia a chave por POST /api/customer-toolkits, sem tela.

A resposta

Em caso de sucesso, o Connect preserva o status e o corpo da resposta do app. Erros HTTP retornados pelo app usam o envelope {error, api_error}; falhas de autenticação ou validação podem ocorrer antes da execução. O header X-Toolkit-Execution-Id identifica a execução registrada, consultável em GET /api/tools/executions/{uuid}.

Pronta para agentes de IA

O input desta tool é um JSON Schema, disponível em GET /api/tools/fathom_get_aggregation. Ele vira a definição de tool do seu agente sem conversão.

Veja o Connect aplicado ao seu produto.

Teste por 15 dias sem cartão, ou mostre seu cenário ao nosso time.