2. AW Reports to DB
An introduction to the tool
by Gustavo Moreira
<SPEAKER>, Google, Inc.
AdWords API Workshops – All rights reserved
3. Agenda
● What is the tool
● Overview
● Why is it important?
● How to get started
● Next steps
AdWords API Workshops – All rights reserved
4. Defining AW Reports to DB
What the tool actually does
AdWords API Workshops – All rights reserved
5. The Problem
● Big number of accounts
● A lot of performance information
● Hard to scale
● Very useful information
AdWords API Workshops – All rights reserved
Defining AwReporting
6. The Solution
● Use the API
● Download overnight
● Persist locally
● Build on top of it
AdWords API Workshops – All rights reserved
Defining AwReporting
7. The Tool
● Multi-threaded download
● Persists to SQL DBs*
● Also persists to MongoDB
● Handles all the API access
● Expose Java objects
● * Uses Hibernate to do the persistence
AdWords API Workshops – All rights reserved
Defining AwReporting
8. The Tool
● It is open source!
● Designed to be extended
● Can run as a command line
● Can be part of your platform
AdWords API Workshops – All rights reserved
Defining AwReporting
10. How does it work?
In the cloud
Custom Java
code
AdWords
API
Java
AwReporting
Properties
file
Local file
AdWords API Workshops – All rights reserved
Downloaders
AwReporting
Model
Part of the tool
Internal to the tool
User-specific
DB
Custom
platform
Any language
11. Components
Local to the user
Database
● Report definitions
● Entity persisters
● AwReporting main
Map the reports to
entities
Report definitions
Handles the
persistence layer
Entity persisters
Executes the
download and
persistence
AdWords API Workshops – All rights reserved
AwReporting
main
A Quick Overview
12. Report Definitions
● Java Beans with annotations
Java
@Entity
@Table(name = "AW_ReportAd")
@CsvReport(value = AD_PERFORMANCE_REPORT) // CSV Report
public class ReportAd extends Report {
// Field annotations
@Column(name = "AD_ID")
@CsvField(value = "Ad ID", reportField = "Id")
public Long adId;
AdWords API Workshops – All rights reserved
A Quick Overview
13. Report Definitions
@CsvReport(value = AD_PERFORMANCE_REPORT)
● The name found in the documentation:
○ https://developers.google.com/adwords/api/docs/appendix/reports *
@CsvField(value = "Ad ID", reportField = "Id")
● The display name, and the report field name
* Resources will be available in the final slides
AdWords API Workshops – All rights reserved
A Quick Overview
15. Entity Persisters
● Interface to handle entities
● Contains methods to save, delete and get
● Use it to access the database!
● It talks Java Bean
AdWords API Workshops – All rights reserved
A Quick Overview
16. Entity Persisters
● Takes care of the transaction
● Handles the exceptions
● Type safe
AdWords API Workshops – All rights reserved
A Quick Overview
17. AwReporting Main
● Coordinates all the parts
● Handles parallelism
● Standalone command line program
● Flexible configuration
● Uses OAuth 2.0 to authenticate (ONLY)
AdWords API Workshops – All rights reserved
A Quick Overview
18. AwReporting Main
● Configuration in a properties file
Properties
mccAccountId=<MCC>
developerToken=<Developer Token>
...
aw.report.model.db.mysql.driver=com.mysql.jdbc.Driver
...
aw.report.downloader.num.threads=20
...
// Define the reports fields to be selected
KEYWORDS_PERFORMANCE_REPORT=ExternalCustomerId,Date,...
AdWords API Workshops – All rights reserved
A Quick Overview
19. AwReporting Main
● Command line standalone
$ java -Xmx512m -jar aw-report-tool.jar
-startDate <some date>
-endDate <some date>
-file <properties-location>/configuration.properties
● startDate, endDate: yyyyMMdd format
● file: the properties file
AdWords API Workshops – All rights reserved
A Quick Overview
21. Reducing API Adoption Time
● Out of the box solution to reports
● Very small work time required
● Latest API version
● Easy to extend
AdWords API Workshops – All rights reserved
Possible Applications
22. Follow the Example
● Best practices applied to the real world
● Very good executable examples
● The DAs invest time on it
● More features to come
AdWords API Workshops – All rights reserved
Possible Applications
23. Starting Point
● Remove reports out of the way
● Local data is easier to handle
● First step towards automation
● Automated report generation to clients?
AdWords API Workshops – All rights reserved
Possible Applications
25. Building the Tool
● Start by downloading the source code:
○
http://goo.gl/TQxIdN *
● Follow the guide to build the tool
● Everything is open source
* Resources will be available in the final slides
AdWords API Workshops – All rights reserved
Getting Started
27. Accessing the Source Code
● Default Maven project format
● $ mvn eclipse:eclipse
● You can edit, and build yourself!
● Two different modules/projects
AdWords API Workshops – All rights reserved
Getting Started
29. System Requirements
● AdWords developer token
● Database (MySQL)
● Java 6
AdWords API Workshops – All rights reserved
Getting Started
30. Knowledge Requirements (to code)
● Java 6 - Annotations, Generics, etc.
● Maven - build
● Spring framework, Hibernate - beans and database
AdWords API Workshops – All rights reserved
Getting Started
31. Customizing the Tool
● Add a new report by creating a new definition
● Manage the downloads via the properties file
● Database fields via annotations
● Entity persister to access the data
AdWords API Workshops – All rights reserved
Getting Started
33. Taking the Extra Step
Now what?
AdWords API Workshops – All rights reserved
34. The Data is Yours!
● Create your own reports
● Optimize for the report values
● Auto-generate PDF reports
● Integrate with internal systems
AdWords API Workshops – All rights reserved
Taking the Extra Step
35. Non Exclusive Application
● The tool goes well with other platforms
● Define your own database
● No need to use Java
● Follow the best practices, implement your own!
AdWords API Workshops – All rights reserved
Taking the Extra Step
36. Seeking Complete Automation
● You need data to automate
● Management of campaigns, ads, keywords, etc.
● Feedback for optimization
● Performance history
AdWords API Workshops – All rights reserved
Taking the Extra Step
37. Resources
AW Reports to DB - https://github.com/googleads/aw-reporting
Report documentation - https://developers.google.
com/adwords/api/docs/appendix/reports
AdWords API Workshops – All rights reserved