5. What is a Feed?
Feed
● Account-level table
● Collection of mutable rows
● Data provider for ad extensions
○ Sitelink extensions
○ Call extensions
○ App extensions
AdWords API Workshops – All rights reserved
Attr1
Attr2
Attr3
Item1
Val1
Val2
Val3
Item2
Val4
Val5
Val6
12. Creating New Feeds
1. Create
2. Populate
3. Map
AdWords API Workshops – All rights reserved
13. Creating New Feeds
To do this...
…call this...
...with these!
Create
FeedService
Feed
FeedAttribute
Populate
FeedItemService
FeedItem
FeedItemAttribute
Map
FeedMappingService
FeedMapping
AdWords API Workshops – All rights reserved
14. Create
● Adds new named collection of data
● Defines columns names & types
AdWords API Workshops – All rights reserved
15. Create
1. Create Feed
a. Set name
2. Add FeedAttributes
a. Set names
b. Set types
3. Call FeedService.ADD
AdWords API Workshops – All rights reserved
16. Populate
● Inserts actual row items into the Feed
● Indicates per-item device preference
(optional)
● Configures per-item time period (optional)
AdWords API Workshops – All rights reserved
17. Populate
1. Create FeedItem
a. Set feedId
2. Add FeedItemAttributeValues
a. Set feedAttributeId
b. Set value
3. Call FeedItemService.ADD
AdWords API Workshops – All rights reserved
18. Map
● Declares which ad extensions can use
Feed
● Defines which Feed columns are used in
extension
AdWords API Workshops – All rights reserved
19. Map
1. Create FeedMapping
a. set feedId
b. set placeholderType
2. Add AttributeFieldMappings
a. set feedAttributeId
b. set fieldId
3. Call FeedMappingService.ADD
AdWords API Workshops – All rights reserved
21. Using Feed Data in Ad Extensions
Feed
FeedItem
FeedItem
FeedItem
FeedItem
FeedItem
FeedItem
FeedItem
FeedItem
FeedItem
AdWords API Workshops – All rights reserved
22. Using Feed Data in Ad Extensions
Feed
FeedItem
matchingFunction
FeedItem
CampaignFeed
Campaign
AdGroupFeed
AdGroup
FeedItem
FeedItem
FeedItem
FeedItem
FeedItem
FeedItem
FeedItem
AdWords API Workshops – All rights reserved
matchingFunction
23. Associate with Campaigns & AdGroups
● Adds ad extensions to Campaigns or
AdGroups
● Defines how to pick FeedItems via a
matching function
AdWords API Workshops – All rights reserved
24. Associating to Campaigns & AdGroups
1. Create CampaignFeed
a. set feedId
b. set campaignId
c. set placeholderTypes
2. Add a matching Function
a. set operator
b. set operands
3. Call CampaignFeed.ADD
AdWords API Workshops – All rights reserved
31. Using Built-in ADWORDS Feeds
● Each ad extension type has a default Feed pre-built
● Main sitelink feed
● Main phone number feed
● Main app feed
● Feed.origin = “ADWORDS”
● FeedAttributes (schema) are immutable
AdWords API Workshops – All rights reserved
32. Using User Defined Feeds
● Displayed in a dropdown alongside built-in Feeds
● Feed.origin = “USER”
● FeedAttributes (schema) are appendable
AdWords API Workshops – All rights reserved
33. Deleting Things
Feed Entries
● Delete FeedItem
AdWords API Workshops – All rights reserved
VS
Ad Extensions
● Remove Id from matching
function
34. Feed Trivia
● One CampaignFeed / AdGroupFeed per
PlaceholderType
● Don’t send existing FeedAttributes in Feed.SET
operations
● No validation on FeedItemIds in matchingFunctions
● Maximum of 20 Feeds per account
● Including built-in ADWORDS Feeds
● Can only delete Feeds & FeedItems via API (not UI)
AdWords API Workshops – All rights reserved
35. Reusing Our Example Code
How to change our code to your bidding
AdWords API Workshops – All rights reserved
36. Use The Code, Luke!
● Examples available for each Client Library
○ https://developers.google.com/adwords/api/docs/clientlibraries
● Don’t do the hard work yourself
● Start with the Sitelinks examples
● Convert that to Calls or other Extensions
AdWords API Workshops – All rights reserved
37. PLACEHOLDERs - what are they for?
What kind of Feed or Field you’re using is set by the
PLACEHOLDERs you assign, for example:
PLACEHOLDER_SITELINKS = 1;
PLACEHOLDER_CALL = 2;
...
PLACEHOLDER_FIELD_CALL_ONLY = 4;
See:
https://developers.google.com/adwords/api/docs/appendix/placeholders
AdWords API Workshops – All rights reserved
38. Fields
Add the required Fields for that Extension:
● Sitelink:
Text, URL (up to 6 pairs)
● Call or : Phone Number, Country Code, isCallTracking,
Mobile : isCallOnly, Conversion Duration Threshold
● App
: Store, Id, Link Text, URL
AdWords API Workshops – All rights reserved
39. Then just tidy up
● Rename stuff to make sense
The example code will have method and parameter
names that say SiteLink in them. Change these to
Call or App or whatever, to match what you’re doing.
AdWords API Workshops – All rights reserved
40. Then just tidy up
● Ensure you include all the Attributes you’re using:
FeedAttribute textAttribute = new FeedAttribute();
textAttribute.setType(FeedAttributeType.STRING);
textAttribute.setName("Link Text");
Becomes:
FeedAttribute numberAttribute = new FeedAttribute();
numberAttribute.setType(FeedAttributeType.STRING);
numberAttribute.setName("Phone Number");
:
AdWords API Workshops – All rights reserved
41. Then just tidy up
● Get the right FeedAttributeType:
FeedAttribute iCOAttribute = new FeedAttribute();
iCOAttribute.setType(FeedAttributeType.BOOLEAN);
iCOAttribute.setName("Is Call Only");
AdWords API Workshops – All rights reserved
42. Then just tidy up
● Get the right AttributeId in the right place:
Feed savedFeed = result.getValue()[0]; // a new FeedReturnValue
callData.callFeedId = savedFeed.getId(); // a data holder object
FeedAttribute[] savedAttributes = savedFeed.getAttributes();
callData.numberFeedAttributeId = savedAttributes[0].getId();
callData.ccFeedAttributeId = savedAttributes[1].getId();
callData.iCTFeedAttributeId = savedAttributes[2].getId();
...
// other Attribute lines
AdWords API Workshops – All rights reserved