Hallo, 

I'm sorry maybe this answer has already an answer on PhP but i couldn't 
translate is into Java AdWords API. Any way i'm trying to get all the 
finalUrls of SiteLinks if there is some.

As i understand,i have to user the AdGroupExtensionSettingService to get 
the siteLinks and then initialize a variable from Type SiteLinkFeed and get 
the finalUrls. But the problem is that i could initialize a variable of 
Type SiteLinkFeed 
from ExtensionFeedItem Type.

This is the code i've written and i don't know if i'm in the wrong or right 
way. Thank you very much for helping me.



AdGroupExtensionSettingServiceInterface adGroupExtentionService = 
adWordsServices.get(session,
 AdGroupExtensionSettingServiceInterface.class);

int offset4 = 0;
SelectorBuilder builder4 = new SelectorBuilder();
Selector selector4 = builder4
.fields(AdGroupExtensionSettingField.Extensions, 
AdGroupExtensionSettingField.AdGroupId)
.in(AdGroupExtensionSettingField.AdGroupId, splittedAdGroupIds.get(k))
.equals(AdGroupExtensionSettingField.ExtensionType, "SITELINK")
.orderAscBy(AdGroupExtensionSettingField.AdGroupId).offset(offset4).limit(PAGE_SIZE).build();

AdGroupExtensionSettingPage page4 = null;
do {
// Get all campaigns.
page4 = adGroupExtentionService.get(selector4);
if (page4.getEntries() != null) {
for (AdGroupExtensionSetting adGroupExtenstion : page4.getEntries()) {
try {
ExtensionFeedItem[] feedItemArray = 
adGroupExtenstion.getExtensionSetting().getExtensions();
for(ExtensionFeedItem feedItem : feedItemArray){
if(feedItem.getFeedType().getValue() == "SITELINK"){
System.out.println("Feed Item Found : " + feedItem);
}
}
} catch (NullPointerException e) {
System.out.println("No final urls from Extensions found");
}
}
} else {
System.out.println("No adGroupExtensionSetting were found.");
}
offset4 += PAGE_SIZE;
selector4 = builder4.increaseOffsetBy(PAGE_SIZE).build();
} while (offset4 < page4.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 [email protected]
To unsubscribe from this group, send email to
[email protected]
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 [email protected].
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/034709c5-d3c5-4066-9ec7-f5abf9d233f2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to