SlideShare a Scribd company logo
1 of 30
Download to read offline
AdWords UI vs. API
How AdWords UI maps into
AdWords API
Timo
Agenda
● Introduction - The AdWords API
● The Basics - Campaigns, Ads, …
● Reporting - Programmatic Data Insights
Introduction
The AdWords API
UI vs. API
● UI = User Interface
○ Interface for humans interacting with a service
○ Interaction: Clicks, text input, …
○ Delivery: Browser / HTML, Native UI, …
● API = Application Programming Interface
○ Interface for applications interacting with a service
○ Interaction: Method calls, SOAP messages, …
○ Delivery: Client library, web services, …
How does this apply to AdWords?
AdWords AdWords UI
API
AdWords API
AdWords
Application User
AdWords Editor
?3rd Party
Application
The Basics
Campaigns, Ads, ...
U
I
Authentication
● Authentication done
via Google Account
Manager
● Single Sign On using
browser cookies
A
PI
api.adwords.refreshToken=INSERT_REFERSH_TOKEN_HERE
api.adwords.clientId=INSERT_CLIENT_ID_HERE
api.adwords.clientSecret=INSERT_CLIENT_SECRET_HERE
api.adwords.developerToken=INSERT_DEVELOPER_TOKEN_HERE
Authentication cont.
● Authentication Mechanism: OAuth 2
○ Generate RefreshToken using client
credentials GetRefreshToken.java
○ Store all in properties / ini / config file
○ Client library will take care of the rest
A
PI
U
I
AdWords Objects
● AdWords consists of several logical objects
(Campaigns, Ad Groups, Ads, …)
● Basic objects represented by tabs in UI
U
I
Main AdWords Objects
● Account: AdWords Customer
● Campaign: Ad Groups that logically
belong together (defines budget)
● Ad Groups: Contains similar ads, all
triggered by the same set of keywords
● Ad (a.k.a. AdGroupAd): Content shown
when ad is displayed (Text, Image, …)
U
I
Main AdWords Objects cont.
Account
Campaign Campaign
Ad Group Ad Group
Ad
Online Electronics Store
TVs Cameras
Plasma TVs TFT TVs
Buy test best Plasme
TVs at our store!Out now: The 2015
Plasma TV series!
Ad
Keyword
buy plasma TVKeyword
lastest plasma TVsKeyword
plasma tv store
Campaign
Phones
A
PI
Objects, Services & Operations
● General Rule: One service for each object
○ get Retrieve object, specified by Selector
○ query Like get, but specified by AWQL
○ mutate Alter objects, depending on operator
■ ADD Creates a new object
■ SET Updates an object
■ REMOVE Deletes an object
A
PI
Generic Example
AdWordsSession session = [...]
AdWordsServices services = [...]
XYServiceInterface service =
services.get(session, XYServiceInterface.class);
Selector selector = new Selector();
selector.setFields(new String[] {"Id", "Name"});
XYPage page = service.get(selector);
for (XY object : page.getEntries()) {
System.out.println(object.getId() +
" - " + object.getName());
} A
PI
“Root” objects for
API interaction
Create the service
Specify what you want:
- Fields
- Conditions
- Limits
- ...
Retrieve the data
Browse through the data
Note: Only selected fields
will return values!
A
PI
Generic Example
AdWordsSession session = [...]
AdWordsServices services = [...]
CampaignServiceInterface service =
services.get(session, CampaignServiceInterface.class);
Selector selector = new Selector();
selector.setFields(new String[] {"Id", "Name"});
CampaignPage page = service.get(selector);
for (Campaign object : page.getEntries()) {
System.out.println(object.getId() +
" - " + object.getName());
} A
PI
Selector selector = new SelectorBuilder()
.fields("Id", "Name").build()
Syntactic Sugar
A
PI
Some Campaign Data Services
A
PI
CampaignService
AdGroupService AdGroupAdService
CampaignCriterionService
Ad Extensions
● UI: All extensions bundled in
one tab (GMB for locations)
● V201409: Feed Services Old :(
○ Define generic feed, add items,
map structure, associate with campaign
● V201502: Dedicated Services New!
○ Create extension feed items and add to ad group
/ campaign / customer
A
PI
Ad Extensions Example
AdWordsSession session = [...]
AdWordsServices services = [...]
CampaignExtensionSettingServiceInterface service = [...]
SitelinkFeedItem sitelink = new SitelinkFeedItem();
sitelink.setSitelinkText("Store Hours");
sitelink.setSitelinkFinalUrls(new UrlList(new String[]
{"http://www.example.com/storehours"}));
CampaignExtensionSetting campaignExtSetting = new
CampaignExtensionSetting();
campaignExtSetting.setCampaignId(campaignId);
campaignExtSetting.setExtensionType(FeedType.SITELINK);
A
PI
A
PI
Ad Extensions Example cont.
ExtensionSetting extSetting = new ExtensionSetting();
extSetting.setExtensions(
new ExtensionFeedItem[] {sitelink});
campaignExtSetting.setExtensionSetting(extSetting);
CampaignExtensionSettingOperation op = new
CampaignExtensionSettingOperation();
op.setOperand(campaignExtSetting);
op.setOperator(Operator.ADD);
CampaignExtensionSettingReturnValue returnValue =
service.mutate(
new CampaignExtensionSettingOperation[] {op});
A
PI
Reporting
Programmatic Data Insights
U
I
AdWords Dashboard
U
I
U
I
Embedded Reports
U
I
● UI integrates reporting & management
● Chart shows metrics over time
○ Customizable metrics
○ Filters for date ranges, object attributes…
● Table shows metrics grouped by objects
○ Customizable columns
○ Filters from charts
○ Download as CSV, XML, PDF, ... file
U
I
Reporting vs. Management
U
I
Download
Customization
A
PI
Reporting with the API
● Reports through ReportDownloader*
○ Download as stream / file, same as through UI
○ Define report type, columns, filters, format, etc.
using ReportDefinition
○ Alternative: AWQL
* Slightly different in other languages
A
PI
Reporting Example
Selector selector = new Selector();
selector.getFields().addAll(Lists.newArrayList(
"CampaignId", "Impressions", "Clicks"));
ReportDefinition rd = new ReportDefinition();
rd.setSelector(selector);
rd.setReportName("Test Report");
rd.setDateRangeType(ReportDefinitionDateRangeType.LAST_30_DAYS);
rd.setReportType(ReportDefinitionReportType.CAMPAIGN_PERFORMANCE_REPORT);
rd.setDownloadFormat(DownloadFormat.CSV);
rd.setIncludeZeroImpressions(false);
ReportDownloadResponse response =
new ReportDownloader(session).downloadReport(rd);
Streams.copy(response.getInputStream(), System.out);
A
PI
A
PI
A
PI
Reporting Example cont.
"Test (Feb 2, 2015-Mar 3, 2015)"
Campaign ID,Impressions,Clicks
225151578,120310,869
225381138,2284,10
Total,122594,879
A
PI
A
PI
A
PI
Reporting Example / AWQL
String query = "SELECT CampaignId, Impressions, Clicks"
+ " FROM CAMPAIGN_PERFORMANCE_REPORT" +
+ " WHERE Impressions > 0"
+ " DURING LAST_30_DAYS";
ReportDownloadResponse response =
new ReportDownloader(session).downloadReport(query, DownloadFormat.CSV);
Streams.copy(response.getInputStream(), System.out);
A
PI
A
PI
A
PI
API Reporting Mappings
A
PI
A
PI
UI API Example
Columns fields selector.getFields().add("Name");
Date Range dateRange reportDefinition.setDateRangeType(
ReportDefinitionDateRangeType.LAST_30_DAYS);
Filters predicates Predicate p = new Predicate();
p.setField("Impressions");
p.setOperator(PredicateOperator.GREATER_THAN);
p.getValues().add("3000");
Download Formats downloadFormat reportDefinition.setDownloadFormat(
DownloadFormat.CSV);
A
PI
API Reporting Mappings cont.
A
PI
UI API Example
Segmentation (defined by fields)
Ordering Not supported
Pagination Not supported
Schedule Reports Not supported
Email Reports Not supported
A
PI
A
PI
Reports Types
A
PI
CAMPAIGN_PERFORMANCE_REPORT
ADGROUP_PERFORMANCE_REPORT
Full list @ http://goo.gl/HlGePj
Resources
● AdWords Help http://goo.gl/1pxGGu
● API Developers Guide http://goo.gl/Q8rgGL
● UI Report Mapping http://goo.gl/vEvULv

More Related Content

Viewers also liked

Viewers also liked (10)

Why use ad words api
Why use ad words apiWhy use ad words api
Why use ad words api
 
Location aware ad customizers
Location aware ad customizersLocation aware ad customizers
Location aware ad customizers
 
Remarketing using customer match
Remarketing using customer matchRemarketing using customer match
Remarketing using customer match
 
Move Fast;Stay Safe:Developing & Deploying the Netflix API
Move Fast;Stay Safe:Developing & Deploying the Netflix APIMove Fast;Stay Safe:Developing & Deploying the Netflix API
Move Fast;Stay Safe:Developing & Deploying the Netflix API
 
What's new in reporting
What's new in reporting What's new in reporting
What's new in reporting
 
NEW Google AdWords Features Released
NEW Google AdWords Features ReleasedNEW Google AdWords Features Released
NEW Google AdWords Features Released
 
GMB API (Google My Business)
GMB API (Google My Business)GMB API (Google My Business)
GMB API (Google My Business)
 
BatchJobService
BatchJobServiceBatchJobService
BatchJobService
 
Google Adwords Ppt
Google Adwords PptGoogle Adwords Ppt
Google Adwords Ppt
 
AD Extension in ADWORDS
AD Extension in ADWORDSAD Extension in ADWORDS
AD Extension in ADWORDS
 

Similar to How AdWords UI maps into adwords api

07. feeds update
07. feeds update07. feeds update
07. feeds update
marcwan
 
ASP.NET Web API
ASP.NET Web APIASP.NET Web API
ASP.NET Web API
habib_786
 
Bid Estimation with the AdWords API (v2)
Bid Estimation with the AdWords API (v2)Bid Estimation with the AdWords API (v2)
Bid Estimation with the AdWords API (v2)
marcwan
 
How Netflix Is Solving Authorization Across Their Cloud
How Netflix Is Solving Authorization Across Their CloudHow Netflix Is Solving Authorization Across Their Cloud
How Netflix Is Solving Authorization Across Their Cloud
Torin Sandall
 

Similar to How AdWords UI maps into adwords api (20)

MCC Scripts update
MCC Scripts updateMCC Scripts update
MCC Scripts update
 
07. feeds update
07. feeds update07. feeds update
07. feeds update
 
Agados-based Application Design Demo
Agados-based Application Design Demo Agados-based Application Design Demo
Agados-based Application Design Demo
 
Opticon 2015 - Getting Started with the Optimizely Developer Platform
Opticon 2015 - Getting Started with the Optimizely Developer PlatformOpticon 2015 - Getting Started with the Optimizely Developer Platform
Opticon 2015 - Getting Started with the Optimizely Developer Platform
 
Reporting tips & tricks
Reporting tips & tricks  Reporting tips & tricks
Reporting tips & tricks
 
"Auth for React.js APP", Nikita Galkin
"Auth for React.js APP", Nikita Galkin"Auth for React.js APP", Nikita Galkin
"Auth for React.js APP", Nikita Galkin
 
ASP.NET Web API
ASP.NET Web APIASP.NET Web API
ASP.NET Web API
 
Refatorando com a API funcional do Java
Refatorando com a API funcional do JavaRefatorando com a API funcional do Java
Refatorando com a API funcional do Java
 
實戰Facebook Marketing API
實戰Facebook Marketing API實戰Facebook Marketing API
實戰Facebook Marketing API
 
Policy Injection in ASP.NET using Enterprise Library 3.0
Policy Injection in ASP.NET using Enterprise Library 3.0Policy Injection in ASP.NET using Enterprise Library 3.0
Policy Injection in ASP.NET using Enterprise Library 3.0
 
Bid Estimation with the AdWords API (v2)
Bid Estimation with the AdWords API (v2)Bid Estimation with the AdWords API (v2)
Bid Estimation with the AdWords API (v2)
 
Mobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on Android
Mobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on AndroidMobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on Android
Mobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on Android
 
Dependency injection - the right way
Dependency injection - the right wayDependency injection - the right way
Dependency injection - the right way
 
Building a Windows Store App for SharePoint 2013
Building a Windows Store App for SharePoint 2013Building a Windows Store App for SharePoint 2013
Building a Windows Store App for SharePoint 2013
 
Boxcars and Cabooses: When one more XHR is too much - Peter Chittum - Codemot...
Boxcars and Cabooses: When one more XHR is too much - Peter Chittum - Codemot...Boxcars and Cabooses: When one more XHR is too much - Peter Chittum - Codemot...
Boxcars and Cabooses: When one more XHR is too much - Peter Chittum - Codemot...
 
How Netflix Is Solving Authorization Across Their Cloud
How Netflix Is Solving Authorization Across Their CloudHow Netflix Is Solving Authorization Across Their Cloud
How Netflix Is Solving Authorization Across Their Cloud
 
Cómo usar google analytics
Cómo usar google analyticsCómo usar google analytics
Cómo usar google analytics
 
Data Science using Google Cloud BigQuery, Python and Power BI
Data Science using Google Cloud BigQuery, Python and Power BIData Science using Google Cloud BigQuery, Python and Power BI
Data Science using Google Cloud BigQuery, Python and Power BI
 
Selling Physical GoodsThrough Apps & Other Monetization Strategies (MBL306) |...
Selling Physical GoodsThrough Apps & Other Monetization Strategies (MBL306) |...Selling Physical GoodsThrough Apps & Other Monetization Strategies (MBL306) |...
Selling Physical GoodsThrough Apps & Other Monetization Strategies (MBL306) |...
 
Building and deploying microservices with event sourcing, CQRS and Docker (Be...
Building and deploying microservices with event sourcing, CQRS and Docker (Be...Building and deploying microservices with event sourcing, CQRS and Docker (Be...
Building and deploying microservices with event sourcing, CQRS and Docker (Be...
 

More from supergigas (10)

How to build a platform
How to build a platformHow to build a platform
How to build a platform
 
Upgraded URLs
Upgraded URLsUpgraded URLs
Upgraded URLs
 
The AdWords api and mobile
The AdWords api and mobileThe AdWords api and mobile
The AdWords api and mobile
 
Shopping Campaigns
Shopping CampaignsShopping Campaigns
Shopping Campaigns
 
Rate limits and Performance
Rate limits and PerformanceRate limits and Performance
Rate limits and Performance
 
Extension Setting Services
Extension Setting ServicesExtension Setting Services
Extension Setting Services
 
Effective Reporting
Effective ReportingEffective Reporting
Effective Reporting
 
Display Network criteria bidding
Display Network criteria biddingDisplay Network criteria bidding
Display Network criteria bidding
 
Dev Token tips
Dev Token tipsDev Token tips
Dev Token tips
 
Ad Customizers
Ad CustomizersAd Customizers
Ad Customizers
 

Recently uploaded

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Recently uploaded (20)

Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 

How AdWords UI maps into adwords api

  • 1. AdWords UI vs. API How AdWords UI maps into AdWords API Timo
  • 2. Agenda ● Introduction - The AdWords API ● The Basics - Campaigns, Ads, … ● Reporting - Programmatic Data Insights
  • 4. UI vs. API ● UI = User Interface ○ Interface for humans interacting with a service ○ Interaction: Clicks, text input, … ○ Delivery: Browser / HTML, Native UI, … ● API = Application Programming Interface ○ Interface for applications interacting with a service ○ Interaction: Method calls, SOAP messages, … ○ Delivery: Client library, web services, …
  • 5. How does this apply to AdWords? AdWords AdWords UI API AdWords API AdWords Application User AdWords Editor ?3rd Party Application
  • 7. U I Authentication ● Authentication done via Google Account Manager ● Single Sign On using browser cookies
  • 8. A PI api.adwords.refreshToken=INSERT_REFERSH_TOKEN_HERE api.adwords.clientId=INSERT_CLIENT_ID_HERE api.adwords.clientSecret=INSERT_CLIENT_SECRET_HERE api.adwords.developerToken=INSERT_DEVELOPER_TOKEN_HERE Authentication cont. ● Authentication Mechanism: OAuth 2 ○ Generate RefreshToken using client credentials GetRefreshToken.java ○ Store all in properties / ini / config file ○ Client library will take care of the rest A PI
  • 9. U I AdWords Objects ● AdWords consists of several logical objects (Campaigns, Ad Groups, Ads, …) ● Basic objects represented by tabs in UI
  • 10. U I Main AdWords Objects ● Account: AdWords Customer ● Campaign: Ad Groups that logically belong together (defines budget) ● Ad Groups: Contains similar ads, all triggered by the same set of keywords ● Ad (a.k.a. AdGroupAd): Content shown when ad is displayed (Text, Image, …)
  • 11. U I Main AdWords Objects cont. Account Campaign Campaign Ad Group Ad Group Ad Online Electronics Store TVs Cameras Plasma TVs TFT TVs Buy test best Plasme TVs at our store!Out now: The 2015 Plasma TV series! Ad Keyword buy plasma TVKeyword lastest plasma TVsKeyword plasma tv store Campaign Phones
  • 12. A PI Objects, Services & Operations ● General Rule: One service for each object ○ get Retrieve object, specified by Selector ○ query Like get, but specified by AWQL ○ mutate Alter objects, depending on operator ■ ADD Creates a new object ■ SET Updates an object ■ REMOVE Deletes an object
  • 13. A PI Generic Example AdWordsSession session = [...] AdWordsServices services = [...] XYServiceInterface service = services.get(session, XYServiceInterface.class); Selector selector = new Selector(); selector.setFields(new String[] {"Id", "Name"}); XYPage page = service.get(selector); for (XY object : page.getEntries()) { System.out.println(object.getId() + " - " + object.getName()); } A PI “Root” objects for API interaction Create the service Specify what you want: - Fields - Conditions - Limits - ... Retrieve the data Browse through the data Note: Only selected fields will return values!
  • 14. A PI Generic Example AdWordsSession session = [...] AdWordsServices services = [...] CampaignServiceInterface service = services.get(session, CampaignServiceInterface.class); Selector selector = new Selector(); selector.setFields(new String[] {"Id", "Name"}); CampaignPage page = service.get(selector); for (Campaign object : page.getEntries()) { System.out.println(object.getId() + " - " + object.getName()); } A PI Selector selector = new SelectorBuilder() .fields("Id", "Name").build() Syntactic Sugar
  • 15. A PI Some Campaign Data Services A PI CampaignService AdGroupService AdGroupAdService CampaignCriterionService
  • 16. Ad Extensions ● UI: All extensions bundled in one tab (GMB for locations) ● V201409: Feed Services Old :( ○ Define generic feed, add items, map structure, associate with campaign ● V201502: Dedicated Services New! ○ Create extension feed items and add to ad group / campaign / customer
  • 17. A PI Ad Extensions Example AdWordsSession session = [...] AdWordsServices services = [...] CampaignExtensionSettingServiceInterface service = [...] SitelinkFeedItem sitelink = new SitelinkFeedItem(); sitelink.setSitelinkText("Store Hours"); sitelink.setSitelinkFinalUrls(new UrlList(new String[] {"http://www.example.com/storehours"})); CampaignExtensionSetting campaignExtSetting = new CampaignExtensionSetting(); campaignExtSetting.setCampaignId(campaignId); campaignExtSetting.setExtensionType(FeedType.SITELINK); A PI
  • 18. A PI Ad Extensions Example cont. ExtensionSetting extSetting = new ExtensionSetting(); extSetting.setExtensions( new ExtensionFeedItem[] {sitelink}); campaignExtSetting.setExtensionSetting(extSetting); CampaignExtensionSettingOperation op = new CampaignExtensionSettingOperation(); op.setOperand(campaignExtSetting); op.setOperator(Operator.ADD); CampaignExtensionSettingReturnValue returnValue = service.mutate( new CampaignExtensionSettingOperation[] {op}); A PI
  • 21. U I Embedded Reports U I ● UI integrates reporting & management ● Chart shows metrics over time ○ Customizable metrics ○ Filters for date ranges, object attributes… ● Table shows metrics grouped by objects ○ Customizable columns ○ Filters from charts ○ Download as CSV, XML, PDF, ... file
  • 23. A PI Reporting with the API ● Reports through ReportDownloader* ○ Download as stream / file, same as through UI ○ Define report type, columns, filters, format, etc. using ReportDefinition ○ Alternative: AWQL * Slightly different in other languages
  • 24. A PI Reporting Example Selector selector = new Selector(); selector.getFields().addAll(Lists.newArrayList( "CampaignId", "Impressions", "Clicks")); ReportDefinition rd = new ReportDefinition(); rd.setSelector(selector); rd.setReportName("Test Report"); rd.setDateRangeType(ReportDefinitionDateRangeType.LAST_30_DAYS); rd.setReportType(ReportDefinitionReportType.CAMPAIGN_PERFORMANCE_REPORT); rd.setDownloadFormat(DownloadFormat.CSV); rd.setIncludeZeroImpressions(false); ReportDownloadResponse response = new ReportDownloader(session).downloadReport(rd); Streams.copy(response.getInputStream(), System.out); A PI A PI
  • 25. A PI Reporting Example cont. "Test (Feb 2, 2015-Mar 3, 2015)" Campaign ID,Impressions,Clicks 225151578,120310,869 225381138,2284,10 Total,122594,879 A PI A PI
  • 26. A PI Reporting Example / AWQL String query = "SELECT CampaignId, Impressions, Clicks" + " FROM CAMPAIGN_PERFORMANCE_REPORT" + + " WHERE Impressions > 0" + " DURING LAST_30_DAYS"; ReportDownloadResponse response = new ReportDownloader(session).downloadReport(query, DownloadFormat.CSV); Streams.copy(response.getInputStream(), System.out); A PI A PI
  • 27. A PI API Reporting Mappings A PI A PI UI API Example Columns fields selector.getFields().add("Name"); Date Range dateRange reportDefinition.setDateRangeType( ReportDefinitionDateRangeType.LAST_30_DAYS); Filters predicates Predicate p = new Predicate(); p.setField("Impressions"); p.setOperator(PredicateOperator.GREATER_THAN); p.getValues().add("3000"); Download Formats downloadFormat reportDefinition.setDownloadFormat( DownloadFormat.CSV);
  • 28. A PI API Reporting Mappings cont. A PI UI API Example Segmentation (defined by fields) Ordering Not supported Pagination Not supported Schedule Reports Not supported Email Reports Not supported A PI
  • 30. Resources ● AdWords Help http://goo.gl/1pxGGu ● API Developers Guide http://goo.gl/Q8rgGL ● UI Report Mapping http://goo.gl/vEvULv