Hi, You could see on this guide <https://developers.google.com/adwords/api/docs/reference/v201806/AdGroupAdService.ExpandedTextAd> all the available fields that you could retrieve to ExpandedTextAd object. Please take note that some URL fields are not supported as seen in the link. However, it appears on your second reply that you are receiving an error, thus, to further investigate this, could you provide the complete SOAP request and response logs when you encountered the error? Please reply via *Reply privately to author*.
Thanks and regards, Luis AdWords API Team On Tuesday, September 11, 2018 at 10:59:10 AM UTC+8, Евгений Морозов wrote: > > > > вторник, 11 сентября 2018 г., 2:59:43 UTC+3 пользователь Евгений Морозов > написал: >> >> I found an example >> get-expanded-text-ads-in-an-ad-group.php >> <https://developers.google.com/adwords/api/docs/samples/php/basic-operations#get-expanded-text-ads-in-an-ad-group> >> >> how to modify it to return a link to site page? >> >> example >> >> >> class GetExpandedTextAds >> { >> >> const AD_GROUP_ID = 'INSERT_AD_GROUP_ID_HERE'; >> const PAGE_LIMIT = 500; >> >> public static function runExample( >> AdWordsServices $adWordsServices, >> AdWordsSession $session, >> $adGroupId >> ) { >> $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] >> ) >> ] >> ); >> $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) { >> printf( >> "Expanded text ad with ID %d, status '%s', and >> headline '%s - %s' was found.\n", >> $adGroupAd->getAd()->getId(), >> $adGroupAd->getStatus(), >> $adGroupAd->getAd()->getHeadlinePart1(), >> $adGroupAd->getAd()->getHeadlinePart2() >> ); >> } >> } >> >> $selector->getPaging()->setStartIndex( >> $selector->getPaging()->getStartIndex() + self::PAGE_LIMIT >> ); >> } while ($selector->getPaging()->getStartIndex() < $totalNumEntries); >> >> printf("Number of results found: %d\n", $totalNumEntries); >> } >> >> >> public static function main() >> { >> // Generate a refreshable OAuth2 credential for authentication. >> $oAuth2Credential = (new OAuth2TokenBuilder())->fromFile()->build(); >> >> // Construct an API session configured from a properties file and the >> // OAuth2 credentials above. >> $session = (new >> AdWordsSessionBuilder())->fromFile()->withOAuth2Credential($oAuth2Credential)->build(); >> self::runExample( >> new AdWordsServices(), >> $session, >> intval(self::AD_GROUP_ID) >> ); >> } >> } >> >> GetExpandedTextAds::main(); >> >> >> im add selectors >> > > $selector->setFields( > ['Id', 'Status', 'HeadlinePart1', 'HeadlinePart2', > 'Description', 'path1', 'path2', 'url', 'displayUrl', 'finalUrls', > 'finalMobileUrls', 'finalAppUrls', 'urlData'] > ); > > result: error > -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ 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 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 and Google Ads 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/7b230846-0671-4fe2-937a-1dbec4e059e6%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.