Google AnalyticsGoogle AnalyticsSEO/AEO

Run a custom GA4 report by property id

google-analytics.report

Run a traffic or behaviour report on your own Google Analytics property

Prix
freeAu prix catalogue
Taux de réussite
100 %30 derniers jours · 15 619 appels
Latence p50
545 msp95 2.3 s
Dernière vérification
28 juil. 2026Vérifié et opérationnel
POSThttps://toolswitch.dev/v1/tools/google-analytics.reportBeta
  • Utilise le quota de la plateforme
  • Réponse synchrone
  • Lit des données publiques

Paramètres

request shape previously live-verified via the registry entry's examples. An incompatible dimension/metric pair fails the whole call — check google.analytics.metadata for what combines. Sampling and thresholding are reported back in the response metadata, not as an error

ParamètreTypeObligatoireDescriptionExemple
Paramètres de chemin
property_idchaîneObligatoirenumeric GA4 property id (the digits only — the admin API returns it as 'properties/123456789')123456789
Corps (JSON)
limitentierFacultatifdefault 10000, max 250000100
offsetentierFacultatif0
metricstableauFacultatif[{name: …}] — e.g. screenPageViews, sessions, activeUsers, conversions, engagementRate[{"name":"screenPageViews"}]
orderBystableauFacultatife.g. [{"metric":{"metricName":"sessions"},"desc":true}]
dateRangestableauObligatoireup to 4 ranges. Use 'yesterday' or 'NdaysAgo', not 'today' — today is a partial day and always reads low[{"endDate":"yesterday","startDate":"28daysAgo"}]
dimensionstableauFacultatif[{name: …}] — e.g. pagePath, sessionSource, sessionDefaultChannelGroup, country, deviceCategory, date[{"name":"pagePath"}]
keepEmptyRowsbooléenFacultatif
dimensionFilterobjetFacultatife.g. {"filter":{"fieldName":"pagePath","stringFilter":{"matchType":"CONTAINS","value":"/blog/"}}}
  • Paramètres de chemin
  • property_idchaîneObligatoire

    numeric GA4 property id (the digits only — the admin API returns it as 'properties/123456789')

    Exemple : 123456789

  • Corps (JSON)
  • limitentierFacultatif

    default 10000, max 250000

    Exemple : 100

  • offsetentierFacultatif

    Exemple : 0

  • metricstableauFacultatif

    [{name: …}] — e.g. screenPageViews, sessions, activeUsers, conversions, engagementRate

    Exemple : [{"name":"screenPageViews"}]

  • orderBystableauFacultatif

    e.g. [{"metric":{"metricName":"sessions"},"desc":true}]

  • dateRangestableauObligatoire

    up to 4 ranges. Use 'yesterday' or 'NdaysAgo', not 'today' — today is a partial day and always reads low

    Exemple : [{"endDate":"yesterday","startDate":"28daysAgo"}]

  • dimensionstableauFacultatif

    [{name: …}] — e.g. pagePath, sessionSource, sessionDefaultChannelGroup, country, deviceCategory, date

    Exemple : [{"name":"pagePath"}]

  • keepEmptyRowsbooléenFacultatif
  • dimensionFilterobjetFacultatif

    e.g. {"filter":{"fieldName":"pagePath","stringFilter":{"matchType":"CONTAINS","value":"/blog/"}}}

Exemples de code

Remplacez $TOOLSWITCH_KEY par la clé créée dans la console.

Beta
curl -X POST 'https://toolswitch.dev/v1/tools/google-analytics.report' \
  -H "X-Toolswitch-Key: $TOOLSWITCH_KEY" \
  -H "Content-Type: application/json" \
  --data-raw '{"limit":3,"metrics":[{"name":"sessions"}],"dateRanges":[{"endDate":"yesterday","startDate":"28daysAgo"}],"dimensions":[{"name":"sessionDefaultChannelGroup"}]}'

Cette API de passerelle est en version Beta ; son URL et son authentification peuvent changer. Les paramètres de l’exemple sont des données fictives. Les appels sont facturés à free, frais de service inclus.