schulzefelix / laravel-search-console

A Laravel package to retrieve data from Google Search Console
MIT License
47 stars 24 forks source link

Is it possible to set the aggregationType for the analytics query? #26

Closed prageeth-peiris closed 3 years ago

prageeth-peiris commented 3 years ago

Hi,

I want to fetch Search Console API data aggregated by Page. So I am looking for a way to set "aggregationType" to "byPage" in the request body.

API Doc : https://developers.google.com/webmaster-tools/search-console-api-original/v3/searchanalytics/query

Can someone guide me how to do this with Laravel?

schulzefelix commented 3 years ago

Hi, it was never included in this package, I added it to the query function:

public function searchAnalyticsQuery(string $siteUrl, Period $period, array $dimensions = [], array $filters = [], int $rows = 1000, string $searchType = 'web', string $dataState = 'final', string $aggregationType = 'auto')