Skip to content

Commit 0756721

Browse files
authored
docs: update analytics samples in README (#8012)
1 parent dda4b4c commit 0756721

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

AnalyticsAdmin/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,13 @@ on authenticating your client. Once authenticated, you'll be ready to start maki
3333
```php
3434
require 'vendor/autoload.php';
3535

36-
use Google\Analytics\Admin\V1beta\AnalyticsAdminServiceClient;
36+
use Google\Analytics\Admin\V1beta\Client\AnalyticsAdminServiceClient;
37+
use Google\Analytics\Admin\V1beta\ListAccountsRequest;
3738

3839
$client = new AnalyticsAdminServiceClient();
3940

40-
$accounts = $client->listAccounts();
41+
$request = new ListAccountsRequest();
42+
$accounts = $client->listAccounts($request);
4143

4244
foreach ($accounts as $account) {
4345
print 'Found account: ' . $account->getName() . PHP_EOL;

AnalyticsData/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,15 @@ on authenticating your client. Once authenticated, you'll be ready to start maki
3333
```php
3434
require 'vendor/autoload.php';
3535

36-
use Google\Analytics\Data\V1beta\BetaAnalyticsDataClient;
36+
use Google\Analytics\Data\V1beta\Client\BetaAnalyticsDataClient;
37+
use Google\Analytics\Data\V1beta\RunReportRequest;
3738

3839
$client = new BetaAnalyticsDataClient();
3940

40-
$response = $client->runReport([
41+
$request = new RunReportRequest([
4142
'property' => 'properties/[YOUR_PROPERTY_ID]'
4243
]);
44+
$response = $client->runReport($request);
4345

4446
foreach ($response->getRows() as $row) {
4547
foreach ($row->getDimensionValues() as $dimensionValue) {

0 commit comments

Comments
 (0)