Hey Juergen -
FWIW, after digging around some more, it looks like I might need to use the
CustomerExtensionSettingService to read all the sitelinks for an account.
Haven't had time to confirm yet.
Perhaps I misspoke slightly when I said I was reading the sitelinks for a
feed. I am looking at the mappings, and if a feed has a valid Sitelink
mapping, then I am reading all the feeditems for that feed via
FeedItemService.
I am sure there are already some code samples out there for that, but in
case it is useful for you, my code reading the feeditems looks like this:
FeedItemServiceInterface feedService = getFeedItemService(acctId);
Selector selector = new Selector();
selector.setFields(new String[] { "FeedId", "FeedItemId", "StartTime",
"EndTime", "AttributeValues", "PolicyData", "DevicePreference", "Status",
"UrlCustomParameters" });
Predicate pred = new Predicate();
pred.setField("FeedId");
pred.setOperator(PredicateOperator.EQUALS);
pred.setValues(new String[]{<feedid>});
selector.setPredicates(new Predicate[] { pred });
int start = 0;
int pageSize = 5000;
Paging paging = new Paging();
paging.setNumberResults(pageSize);
paging.setStartIndex(start);
selector.setPaging(paging);
FeedItemPage page = feedService.get(selector);
List<com.adlucent.domain.Sitelink> allAdlSitelinks = new ArrayList<>();
if (page.getEntries() == null) {
return allAdlSitelinks;
}
System.out.println("Found "+page.getTotalNumEntries()+" sitelinks");
while (page.getEntries() != null) {
allAdlSitelinks.addAll(asAdlucentSitelinks(acctId, mapping,
page.getEntries()));
start = start+pageSize;
paging.setStartIndex(start);
page = feedService.get(selector);
}
return allAdlSitelinks;
HTH -
mm
On Monday, June 29, 2015 at 9:21:30 AM UTC-5, Juergen Henning wrote:
>
> Hi Magaret,
>
> I don't know how to read all existing sitelinks with
> the CampaignExtensionSettingService. But I want to know, how I can filter
> all sitelinks with the FeedItemService. Do you have a code example?
>
> Thanks in advance and - sorry for the offtopic question...
> Juergen
>
> Am Samstag, 27. Juni 2015 01:03:18 UTC+2 schrieb mm:
>>
>> Hey guys -
>> I was looking at moving all of my current feed-based sitelink management
>> code to the CampaignExtensionSettingService. Right now, with Feed services
>> I can retrieve all sitelinks for an account regardless of whether they have
>> been associated with a Campaign or AdGroup. When using these new(ish)
>> Extension services, is there a way to achieve the same end? I tried a
>> retrieval with the CampaignExtensionSettingService where I only specified
>> the extension type in the selector, but none of the sitelinks were returned
>> (I assume because they weren't associated with a campaign).
>>
>> Thanks for your help!
>> mm
>>
>
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 http://groups.google.com/group/adwords-api.
To view this discussion on the web visit
https://groups.google.com/d/msgid/adwords-api/72e796d9-e2e0-469d-a01e-48fc4bc799d5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.