AdWords API Feed Services

Preview:

DESCRIPTION

AdWords API Workshops Q4 2013 Feed Services talk

Citation preview

AdWords API Workshops – All rights reserved

AdWords API Workshops – All rights reserved

Feed ServicesManaging Feeds with the AdWords API

Adam Ohren, Google, Inc.

AdWords API Workshops – All rights reserved

● Feed Concepts● Creating New Feeds● Populating Ad Extensions● Reporting● Best Practices● Reuse of our Example Code

Agenda

AdWords API Workshops – All rights reserved

Feed Concepts

AdWords API Workshops – All rights reserved

● Account-level table● Collection of mutable rows● Data provider for ad extensions

○ Sitelink extensions○ Call extensions○ App extensions

What is a Feed?Feed

Attr1 Attr2 Attr3

Item1 Val1 Val2 Val3

Item2 Val4 Val5 Val6

AdWords API Workshops – All rights reserved

● Dynamically update extensions● Modify extensions in-place● Retain reporting stats● FeedItem-level device preference

Feed BenefitsFeed

Attr1 Attr2 Attr3

Item1 Val1 Val2 Val3

Item2 Val4 Val5 Val6

AdWords API Workshops – All rights reserved

A Database Analogy

Table

Column

Row

Field

Feed

FeedAttribute

FeedItem

FeedItemAttributeValue

AdWords API Workshops – All rights reserved

A Database AnalogyAd Extension

AdWords API Workshops – All rights reserved

All the PiecesData Extension Type Ad Extensions

AdWords API Workshops – All rights reserved

● Feed● FeedItem● FeedMapping● CampaignFeed● AdGroupFeed

Feed Services API

ServiceService

ServiceService

Service

AdWords API Workshops – All rights reserved

Creating New Feeds

AdWords API Workshops – All rights reserved

1. Create2. Populate3. Map

Creating New Feeds

AdWords API Workshops – All rights reserved

Creating New Feeds

To do this... …call this... ...with these!

Create FeedService FeedFeedAttribute

Populate FeedItemService FeedItemFeedItemAttribute

Map FeedMappingService FeedMapping

AdWords API Workshops – All rights reserved

● Adds new named collection of data● Defines columns names & types

Create

AdWords API Workshops – All rights reserved

1. Create Feeda. Set name

2. Add FeedAttributesa. Set namesb. Set types

3. Call FeedService.ADD

Create

AdWords API Workshops – All rights reserved

● Inserts actual row items into the Feed● Indicates per-item device preference (optional)

● Configures per-item time period (optional)

Populate

AdWords API Workshops – All rights reserved

1. Create FeedItema. Set feedId

2. Add FeedItemAttributeValuesa. Set feedAttributeIdb. Set value

3. Call FeedItemService.ADD

Populate

AdWords API Workshops – All rights reserved

● Declares which ad extensions can use Feed

● Defines which Feed columns are used in extension

Map

AdWords API Workshops – All rights reserved

1. Create FeedMappinga. set feedIdb. set placeholderType

2. Add AttributeFieldMappingsa. set feedAttributeIdb. set fieldId

3. Call FeedMappingService.ADD

Map

AdWords API Workshops – All rights reserved

Populating Ad Extensions

AdWords API Workshops – All rights reserved

Using Feed Data in Ad ExtensionsFeed

FeedItem

FeedItem

FeedItem

FeedItem

FeedItem

FeedItem

FeedItem

FeedItem

FeedItem

AdWords API Workshops – All rights reserved

Using Feed Data in Ad ExtensionsFeed

Campaign

AdGroup

CampaignFeed

AdGroupFeed

matchingFunction

matchingFunction

FeedItem

FeedItem

FeedItem

FeedItem

FeedItem

FeedItem

FeedItem

FeedItem

FeedItem

AdWords API Workshops – All rights reserved

● Adds ad extensions to Campaigns or AdGroups

● Defines how to pick FeedItems via a matching function

Associate with Campaigns & AdGroups

AdWords API Workshops – All rights reserved

1. Create CampaignFeeda. set feedIdb. set campaignIdc. set placeholderTypes

2. Add a matching Functiona. set operatorb. set operands

3. Call CampaignFeed.ADD

Associating to Campaigns & AdGroups

AdWords API Workshops – All rights reserved

Matching FunctionsFeed

Campaign

AdGroup

CampaignFeed

AdGroupFeed

matchingFunction

matchingFunction

FeedItemId IN (id1, id2, …)

FeedItemId IN (idA, idB, …)

FeedItem

FeedItem

FeedItem

FeedItem

FeedItem

FeedItem

FeedItem

FeedItem

FeedItem

AdWords API Workshops – All rights reserved

Matching FunctionsFeed Campaign / AdGroup

FeedItemId IN (6435602, 6436202)

AdWords API Workshops – All rights reserved

Reporting

AdWords API Workshops – All rights reserved

Ad Extensions Performance Report● DomainInfo● Location● LocationSync● Sitelinks● Mobile● InAppLink

Feed-based Reporting

Placeholder Feed Item Report● Sitelinks● Mobile● InAppLink

AdWords API Workshops – All rights reserved

● FeedItem-level statistics● PlaceholderType ⇔ Ad extension type

● Sitelink● Call● App

Placeholder Feed Item Report

AdWords API Workshops – All rights reserved

Best Practices

AdWords API Workshops – All rights reserved

● 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

Using Built-in ADWORDS Feeds

AdWords API Workshops – All rights reserved

● Displayed in a dropdown alongside built-in Feeds● Feed.origin = “USER”● FeedAttributes (schema) are appendable

Using User Defined Feeds

AdWords API Workshops – All rights reserved

Deleting Things

Feed Entries● Delete FeedItem

Ad Extensions● Remove Id from matching

functionVS

AdWords API Workshops – All rights reserved

● 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)

Feed Trivia

AdWords API Workshops – All rights reserved

Reusing Our Example CodeHow to change our code to your bidding

AdWords API Workshops – All rights reserved

AdWords API Workshops – All rights reserved

● 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

Use The Code, Luke!

AdWords API Workshops – All rights reserved

AdWords API Workshops – All rights reserved

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

PLACEHOLDERs - what are they for?

AdWords API Workshops – All rights reserved

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

Fields

AdWords API Workshops – All rights reserved

● Rename stuff to make sense

The example code will have method and parameternames that say SiteLink in them. Change these toCall or App or whatever, to match what you’re doing.

Then just tidy up

AdWords API Workshops – All rights reserved

● 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");

:

Then just tidy up

AdWords API Workshops – All rights reserved

● Get the right FeedAttributeType:

FeedAttribute iCOAttribute = new FeedAttribute();

iCOAttribute.setType(FeedAttributeType.BOOLEAN); iCOAttribute.setName("Is Call Only");

Then just tidy up

AdWords API Workshops – All rights reserved

● 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

Then just tidy up

AdWords API Workshops – All rights reserved

ResourcesGuide & Reference

https://developers.google.com/adwords/api/docs/guides/feed-serviceshttps://developers.google.com/adwords/api/docs/appendix/placeholdershttps://developers.google.com/adwords/api/docs/appendix/feed-errorshttps://developers.google.com/adwords/api/docs/clientlibraries

AdWords API Workshops – All rights reserved

Questions?

AdWords API Workshops – All rights reserved

Recommended