[ad_1]
I understand you can filter the results based on country or city, but is anyone aware of how to do this to filter by USA state? Or a workaround of some kind?
This is how I currently limit by country.
$query['dimensionFilterClauses'] = ['filters' => [
[
"dimension_name" => "ga:country",
"operator" => 'PARTIAL',
"expressions" => 'United States'
]
]
];
$body = new \Google_Service_AnalyticsReporting_GetReportsRequest();
$body->setReportRequests( array($query) );
$client = new \Google_Client();
$client->setApplicationName("Analytics Reporting");
$analytics = new \Google_Service_AnalyticsReporting($client);
$response = $analytics->reports->batchGet( $body );
[ad_2]