We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Environment details
OS: Ubuntu-22.04LTS (WSL) PHP version: 7.4.33 Package name and version: google/analytics-data: 0.16.1
Hello I am working with the analytics data api to get some required data.
I have built up ~8 Google\Analytics\Data\V1beta\RunReportRequest objects that give me the required data.
But for my use case I need to make compare data from 2 date ranges. So I decided to look into cohort reports and see if they fit my use case.
(new RunReportRequest()) ->setProperty('properties/' . $property_id) ->setDimensions([ new Dimension([ 'name' => 'cohort', ]), new Dimension([ 'name' => 'cohortNthDay', ]) ]) ->setMetrics([ new Metric([ 'name' => 'cohortActiveUsers', ]), ]) ->setCohortSpec( (new CohortSpec()) ->setCohorts([ (new Cohort()) ->setDimension( 'firstSessionDate' ) ->setDateRange( new DateRange([ // format YYYY-MM-DD 'start_date' => '2023-12-01', 'end_date' => '2023-12-01', ]) ) ]) ->setCohortsRange( (new CohortsRange()) ->setGranularity(1) ->setStartOffset(0) ->setEndOffset(5) ) ),
This is how my request is currently being built.
this is the output for $response->serializeToJsonString()
{ "dimensionHeaders": [ { "name": "cohort" }, { "name": "cohortNthDay" } ], "metricHeaders": [ { "name": "cohortActiveUsers", "type": "TYPE_INTEGER" } ], "rows": [ { "dimensionValues": [ { "value": "cohort_0" }, { "value": "0000" } ], "metricValues": [ { "value": "13" } ] } ], "rowCount": 1, "metadata": { "currencyCode": "EUR", "timeZone": "Europe\/Amsterdam" }, "kind": "analyticsData#runReport" }
When I am expecting more values similair to https://developers.google.com/analytics/devguides/reporting/data/v1/advanced#cohort_report_examples
I have tried these options to try and get a different output:
But I keep getting similair response data. Does anyone know why?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Environment details
Hello I am working with the analytics data api to get some required data.
I have built up ~8 Google\Analytics\Data\V1beta\RunReportRequest objects that give me the required data.
But for my use case I need to make compare data from 2 date ranges. So I decided to look into cohort reports and see if they fit my use case.
This is how my request is currently being built.
this is the output for $response->serializeToJsonString()
When I am expecting more values similair to
https://developers.google.com/analytics/devguides/reporting/data/v1/advanced#cohort_report_examples
I have tried these options to try and get a different output:
But I keep getting similair response data. Does anyone know why?
The text was updated successfully, but these errors were encountered: