I've been migrating API version from old v201609 to the newest v201710.

I'm PHP developer.


Below is a code that get Expanded Text Ads information.

=============================================================================================

$adGroupAdService = $adWordsServices->get($session, 
AdGroupAdService::class);

// Create a selector to select all ads for the specified ad group.
$selector = new Selector();
$selector->setFields(['Id', 'Status', 'HeadlinePart1', 'HeadlinePart2', 
'Description']);
$selector->setOrdering([new OrderBy('Id', SortOrder::ASCENDING)]);
$selector->setPredicates([
new Predicate('AdGroupId', PredicateOperator::IN, [$AdGroupId]),
new Predicate('AdType', PredicateOperator::IN, [AdType::EXPANDED_TEXT_AD]),
new Predicate('Status', PredicateOperator::IN, [AdGroupAdStatus::ENABLED, 
AdGroupAdStatus::PAUSED, AdGroupAdStatus::DISABLED])
]);

$selector->setPaging(new Paging(0, self::PAGE_LIMIT));


$totalNumEntries = 0;

do {

  // Retrieve ad group ads one page at a time, continuing to request pages
  // until all ad group ads have been retrieved.
  $page = $adGroupAdService->get($selector);

  // Print out some information for each ad group ad.
  if ($page->getEntries() !== null) {

$totalNumEntries = $page->getTotalNumEntries();

foreach ($page->getEntries() as $adGroupAd) {


$AdId = $adGroupAd->getAd()->getId();

echo "AdId : ".$AdId."\n";


$status = $adGroupAd->getStatus();

echo "status : ".$status."\n"; //ENABLED, PAUSED, DISABLED



//The approvalStatus, trademarks, disapprovalReasons, and 
trademarkDisapproved fields of AdGroupAd have been removed. Use 
AdGroupAd.policySummary instead.
//https://developers.google.com/adwords/api/docs/guides/migration/v201705


$PolicySummary = $adGroupAd->getPolicySummary();

var_dump($PolicySummary);   //return NULL



/*
$approvalStatus = $adGroupAd->getApprovalStatus();
echo "approvalStatus : ".$approvalStatus."\n"; //APPROVED, DISAPPROVED, 
FAMILY_SAFE, NON_FAMILY_SAFE, PORN, UNCHECKED, UNKNOWN

$disapprovalReasons = $adGroupAd->getDisapprovalReasons();
$disapprovalReasons = $disapprovalReasons[0];
echo "disapprovalReasons : ".$disapprovalReasons."\n"; //Array
*/



$headline1 = $adGroupAd->getAd()->getHeadlinePart1();

echo "headline1 : ".$headline1."\n";

$headline2 = $adGroupAd->getAd()->getHeadlinePart2();

echo "headline2 : ".$headline2."\n";

$description = $adGroupAd->getAd()->getDescription();

echo "description : ".$description."\n";


$path1 = $adGroupAd->getAd()->getPath1();

echo "path1 : ".$path1."\n";

$path2 = $adGroupAd->getAd()->getPath2();

echo "path2 : ".$path2."\n";


  }

  
$selector->getPaging()->setStartIndex($selector->getPaging()->getStartIndex() 
+ self::PAGE_LIMIT);


} while ($selector->getPaging()->getStartIndex() < $totalNumEntries);


=============================================================================================



[Problem 1]

-----------------------------------------------------------------------------------------------------------------------------------------------------------------
https://developers.google.com/adwords/api/docs/guides/migration/v201705

AdGroupAd.approvalStatus

The approvalStatus, trademarks, disapprovalReasons, and 
trademarkDisapprovedfields 
of AdGroupAd have been removed. Use AdGroupAd.policySummary 
<https://developers.google.com/adwords/api/docs/reference/latest/AdGroupAdService.AdGroupAd#policysummary>
 instead.

-------------------------------------------------------------------------------------------------------------------------


Before migration to v201710, I successfully retrieved approvalStatus, 
disapprovalReasons. 
As described in migration guide, I try to use AdGroupAd.policySummary API, 
which returns only null value.


                 $PolicySummary = $adGroupAd->getPolicySummary();


                 var_dump($PolicySummary);   //return NULL



How should I write code for combinedApprovalStatus.



https://developers.google.com/adwords/api/docs/reference/v201710/AdGroupAdService.AdGroupAdPolicySummary



[Problem 2]

After migrating from v201609 to v201710, retrieving path1 & path2 of 
displayurl returns null.

As below code, headline1, headline2, description work well. But only path1 
& path2 return null. what's the problem in my code


$headline1 = $adGroupAd->getAd()->getHeadlinePart1();

echo "headline1 : ".$headline1."\n";

$headline2 = $adGroupAd->getAd()->getHeadlinePart2();

echo "headline2 : ".$headline2."\n";

$description = $adGroupAd->getAd()->getDescription();

echo "description : ".$description."\n";

$path1 = $adGroupAd->getAd()->getPath1();

echo "path1 : ".$path1."\n";

$path2 = $adGroupAd->getAd()->getPath2();

echo "path2 : ".$path2."\n";




Thanks, in advance!!


-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
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 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/f51a6fe8-2fbb-45fb-8a54-6ddd450ccc1f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • In migra... Sang Jin Kim
    • Re:... 'Sreelakshmi Sasidharan (AdWords API Team)' via AdWords API Forum
      • ... Sang Jin Kim

Reply via email to