我試圖通過Adwords API檢索升級版網址,但是我得到的所有內容都是NULL。我使用的是最新版本的客戶端庫(v201502)的 下面是我使用PHP Adwords API獲得升級網址
$adGroupAdService = $this->oGAW->GetService('AdGroupAdService', ADWORDS_VERSION);
$selector = new Selector();
$selector->fields = array('AdGroupId');
// Create predicates.
$selector->predicates[] =
new Predicate('AdGroupId', 'IN', array($adGroupId));
$selector->predicates[] =
new Predicate('AdType', 'IN', array('TEXT_AD', 'DYNAMIC_SEARCH_AD'));
// Create paging controls.
$selector->paging = new Paging(0, AdWordsConstants::RECOMMENDED_PAGE_SIZE);
$page = $adGroupAdService->get($selector);
的代碼,並將其返回此
object(TextAd)[107]
public 'headline' => string 'headline'
public 'description1' => string 'description1'
public 'description2' => string 'description2'
public 'id' => string '76813511440' (length=11)
public 'url' => null
public 'displayUrl' => string 'test.nl/test'
public 'finalUrls' => null
public 'finalMobileUrls' => null
public 'finalAppUrls' => null
public 'trackingUrlTemplate' => null
public 'urlCustomParameters' => null
public 'devicePreference' => null
public 'AdType' => string 'TextAd' (length=6)
private '_parameterMap' (Ad) =>
array (size=1)
'Ad.Type' => string 'AdType' (length=6)
我在做什麼錯?
謝謝!
可能是一個愚蠢的問題,而是你是拉低使用升級後的網址或者是使用包含目標仍然是廣告嗎? –
它使用最終的網址,但它在使用最終網址的所有廣告上返回null。使用目標網址的廣告工作正常。 客戶端庫中有一個關於如何添加最終網址的示例,但我無法找到任何有關如何將其拉回的方法。 –
要檢查的另一件事是,最終的url將作爲一個字符串數組而不是一個字符串返回。你的代碼設置是否可以處理這個問題https://developers.google.com/adwords/api/docs/reference/v201502/AdGroupAdService.TextAd –