PHP code example of joelbutcher / googleads-client-oauth2-wrapper

1. Go to this page and download the library: Download joelbutcher/googleads-client-oauth2-wrapper library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

joelbutcher / googleads-client-oauth2-wrapper example snippets


  $config = [
      'client_id' => '<your-app-client-id>'
      'client_secret' => '<your-app-client-secret>'
      'developer_token' => '<your-developer-token>'
      'login_customer_id' => '<your-app-client-id>'
  ];

  $googleAds = new GoogleAds($config);

  // ...
  $googleAds->authorize($refreshToken);

  // ...
  $googleAds->authorize($refreshToken, '<child-account-id>');

  // ...
  $googleAds->getCampaignServiceClient();