Solved using $adGroupCriterion->finalUrls->urls[0]

Il giorno mercoledì 2 marzo 2016 11:20:32 UTC+1, giorgio...@gmail.com ha 
scritto:
>
> I didnt understand the BiddableAdGroupCriterion to get the finalUrls from 
> the keywords on PHP.
> Im running the GetKeywords script in this way:
>
> $adGroupCriterionService = $user->GetService('AdGroupCriterionService', 
> ADWORDS_VERSION);
> $adGroupCriterion = new BiddableAdGroupCriterion();
>
> Then I get the fields: text, matchtype, id, type, criteriontype but if I 
> try to add the field
>
> $adGroupCriterion->criterion->finalUrls;
>
> I dont get anything.
>
>
>
> Il giorno mercoledì 17 febbraio 2016 10:59:11 UTC+1, Karim Benna ha 
> scritto:
>>
>> Hi everyone,
>>
>> I have a small issue, i'm trying to call the final Urls  related to the 
>> keywords in Java and i don't find the way. I could make it for the ads this 
>> is the code :
>>
>> I need to do the same thing but for keywords! PLEASE HELP
>>
>>
>>
>>
>> AdGroupAdServiceInterface adService =
>>        adWordsServices.get(session, AdGroupAdServiceInterface.class);
>>
>> SelectorBuilder builder = new SelectorBuilder();
>>    Selector selector = builder
>>        .fields(AdGroupAdField.CreativeFinalUrls, AdGroupAdField.AdGroupId
>> )
>>        .orderAscBy(AdGroupAdField.AdGroupId)
>>        .offset(offset)
>>        .limit(PAGE_SIZE)
>>        .build();
>>
>>
>> AdGroupAdPage page = null;
>>    do {
>>      page = adService.get(selector);
>>
>>       if (page.getEntries() != null) {
>>        for (AdGroupAd ad: page.getEntries()) {
>>        try{
>>          System.out.println("Ad with url \"" + ad.getAd().getFinalUrls()[
>> 0] + "\" and id \""
>>              + ad.getAd().getId() + "\" was found. And Status: " + ad.
>> getStatus());
>>          
>>        }
>>        catch(NullPointerException e){ 
>>             System.out.println("A campaign of this GroupAd: " + campaign.
>> getAdGroupId() + " is :" + campaign.getStatus());
>>        }
>>          
>>        }
>>      } else {
>>        System.out.println("No ads were found.");
>>      }
>>      offset += PAGE_SIZE;
>>      selector = builder.increaseOffsetBy(PAGE_SIZE).build();
>>    } while (offset < page.getTotalNumEntries());
>>  }
>>
>>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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/f5fe4c51-bb93-4638-b862-9631f3f5c78c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to