在googleads庫即時通訊新和IM谷歌廣告API接入面臨的一個問題如何使用代表您的客戶
我加入谷歌adswords API庫到一個新的laravel 5.3。
我撥打電話和使用INI文件中檢索數據,但是當我嘗試使用代表您的客戶端的訪問中 this wiki of the library
,但它不工作的最後一部分我不明白
4. You can now use the OAuth2 object to make calls using the client library.
use Google\AdsApi\AdWords\AdWordsServices;
use Google\AdsApi\AdWords\AdWordsSessionBuilder;
use Google\AdsApi\Common\OAuth2TokenBuilder;
$session = (new AdWordsSessionBuilder())
->fromFile()
->withOAuth2Credential($oauth2)
->build();
$adWordsServices = new AdWordsServices();
$campaignService =
$adWordsServices->get($session, 'CampaignService', 'v201603', 'cm');
// Make calls using $campaignService.
當我嘗試他們給它的例子中的代碼給我的錯誤Undefined variable: oauth2
我試圖把它從會話中的連接文件,並在示例文件中檢索它,但沒有工作
一個問題:
這裏我把提供ClientCustomerId在代表您的客戶?
謝謝
感謝你的努力,但我提到的問題中的維基,我知道它的工作,我得到了刷新令牌=>我沒有忘記它的第一部分。我的問題是如何在其他頁面使用它?我是否需要在每個頁面中編寫代碼? @cevizmx –