Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

jinsonjose's avatar

How to access google analytics admin api

how to integrate google analytics admin api in php

https://github.com/googleapis/php-analytics-admin#installation

any idea??

0 likes
6 replies
jinsonjose's avatar

@Sinnbeck now i want list all the property details data

i checked the mentioned package but it not return ga4 property list that why i ask for help in integrate analytic admin api

jinsonjose's avatar

@Sinnbeck i am stuck on, how to call the admin api function

in doc they give one sample


use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;

$client = new AnalyticsAdminServiceClient();

$accounts = $client->listAccounts();

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


but its not mentioned about the oauth and api key authentication

if possible may i know how to add authentication code on sample code


can you help?
jinsonjose's avatar

@Sinnbeck yes sir i created auth credential but i dont know how to pass this with api thats my issue

Please or to participate in this conversation.