I am working on an application where my clients can connect their google 
account and see the google ad reports and listing. For this I have create 
credentials with required API and configured the auth page too. From the 
page clients is able to authorize the app to read/write the ads however 
this is only provide me the access token but not the ads account list.

To get the ads account listing I am trying to integration google ads php 
api where I am passing the access token to fetch the ad account id of 
connected user. 

following is sample of code I am writing but not sure how to proceed to get 
the ads account id.





















*require 'google-ads-php/vendor/autoload.php'; // Assuming you have the 
necessary dependencies installed// Set up your credentials$client = new 
Google_Client();$client->setAuthConfig('google-credential.json'); // 
Replace with the path to your credentials JSON 
file$client->setAccessType('offline');use 
Google\Ads\GoogleAds\GoogleAdsClient;// Set the access token$accessToken = 
'Token Here';// Initialize the Google Ads client.$googleAdsClient = 
GoogleAdsClient::loadFromStorage();// Set the access 
token.$googleAdsClient->setDeveloperToken($accessToken);// Make a request 
to get details about the authenticated customer.$customerDetails = 
$googleAdsClient->getCustomer();// Print or use the client ID as 
needed.$clientID = $customerDetails->getResourceName();echo "Client ID: 
$clientID";*

It is not working and returns following error "Uncaught Error: Class 
"Google\\Ads\\GoogleAds\\GoogleAdsClient" not found"

Please help.

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Google Ads API and AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/d043788a-135e-4b41-a0b8-6fa4a6b93531n%40googlegroups.com.
  • Ge... Vikram singh
    • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum
      • ... Vikram singh
        • ... Vikram singh

Reply via email to