SlideShare a Scribd company logo
1 of 32
Download to read offline
Google Inc. - All Rights Reserved
AdWords Scripts for MCC
Manage AdWords accounts using JavaScript
Mark Bowyer, Google, Inc.
Agenda
● Introduction
● Getting started
● Resources
● Questions
Google Inc. - All Rights Reserved
Introduction
Google Inc. - All Rights Reserved
● Way to programmatically access AdWords data
● Write your code in JavaScript
● Embedded IDE in AdWords UI
Recap - AdWords Scripts
Script
Google Inc. - All Rights Reserved
function main() {
// Retrieve campaign by name using AWQL.
var demoCampaign = AdWordsApp.campaigns().
withCondition("Name='Demo campaign'").get().next();
// Retrieve child adgroup using AWQL.
var demoAdGroup = demoCampaign.adGroups().
withCondition("Name='Demo adgroup'").get().next();
// Modify the adgroup properties.
demoAdGroup.setKeywordMaxCpc(1.2);
}
Recap - AdWords Scripts
Google Inc. - All Rights Reserved
● AdWords Scripts at MCC level
● Allows managing accounts at scale
What are MCC Scripts?
Google Inc. - All Rights Reserved
● Currently open for beta signup
● Whitelisting usually takes a few business days.
● Request whitelist at top-level MCC account
Availability
Google Inc. - All Rights Reserved
● Manage multiple client accounts from a single script
● No more copy-pasting a script into multiple accounts!
● Process multiple accounts in parallel
Benefits
Google Inc. - All Rights Reserved
● Bid management in all your child accounts
● Cross-account reporting
Common use cases
Google Inc. - All Rights Reserved
Accessing MCC Scripts
1
2
Google Inc. - All Rights Reserved
Get started!
Script
Google Inc. - All Rights Reserved
Your first script
function main() {
// Retrieve all the child accounts.
var accountIterator = MccApp.accounts().get();
// Iterate through the account list.
while (accountIterator.hasNext()) {
var account = accountIterator.next();
// Get stats for the child account.
var stats = account.getStatsFor("THIS_MONTH");
// And log it.
Logger.log("%s,%s,%s", account.getCustomerId(), stats.getClicks(),
stats.getImpressions(), stats.getCost());
}
}
Google Inc. - All Rights Reserved
● Provides account management functionality
● Retrieve child accounts
● Select a child account for further operations
● Process multiple child accounts in parallel
MccApp class
Google Inc. - All Rights Reserved
var accountIterator = MccApp.accounts().get();
● Use MccApp.accounts method
● By default, returns all client accounts (excluding sub-
MCCs)
Selecting child accounts
Script
Google Inc. - All Rights Reserved
● Can optionally filter by an account label
Selecting child accounts (cont’d)
var accountIterator = MccApp.accounts()
.withCondition('LabelName = "xxx"')
.get();
Script
Google Inc. - All Rights Reserved
● Can optionally take a list of client ids
Selecting child accounts (cont’d)
var accountIterator = MccApp.accounts()
.withIds(['123-456-7890', '345-678-9000'])
.get();
Script
Google Inc. - All Rights Reserved
● By default, this is the account where script resides
● Switch context using MccApp.select method
● Then use AdWordsApp class to process account
● Remember to switch back to your MCC account!
What account am I operating on?
Script
Google Inc. - All Rights Reserved
var childAccount = MccApp.accounts().withIds(["918-501-8835"])
.get().next();
// Save the MCC account.
var mccAccount = AdWordsApp.currentAccount();
// Select the child account
MccApp.select(childAccount);
// Process the account.
...
// Switch back to MCC account.
MccApp.select(mccAccount);
Operating on a specific child account (cont’d)
Google Inc. - All Rights Reserved
Processing accounts in parallel
Google Inc. - All Rights Reserved
● Use AccountSelector.executeInParallel
method
● Operate on upto 50 accounts in parallel
● Optional callback method after processing accounts
Operating on accounts in parallel
Script
Google Inc. - All Rights Reserved
function main() {
MccApp.accounts().executeInParallel("processAccount");
}
function processAccount() {
Logger.log("Operating on %s",
AdWordsApp.currentAccount().getCustomerId());
// Process the account.
// ...
return;
}
Operating on accounts in parallel (cont’d)
Script
Google Inc. - All Rights Reserved
function main() {
MccApp.accounts().executeInParallel("processAccount",
"allFinished");
}
function processAccount() {
...
}
function allFinished(results) {
...
}
Specifying a callback
Google Inc. - All Rights Reserved
● Use results argument of callback method
● Array of ExecutionResult objects
● One ExecutionResult per account processed
Analyzing the outcome...
Google Inc. - All Rights Reserved
● Contains
● CustomerId
● Status (Success, Error, Timeout)
● Error (if any)
● Return values from processAccount
Analyzing the outcome (cont’d)
Script
Google Inc. - All Rights Reserved
function processAccount() {
return AdWordsApp.campaigns().get().totalNumEntities().toString();
}
function allFinished(results) {
var totalCampaigns = 0;
for (var i = 0; i < results.length; i++) {
totalCampaigns += parseInt(results[i].getReturnValue());
}
Logger.log("There are %s campaigns under MCC ID: %s.",
totalCampaigns,
AdWordsApp.currentAccount().getCustomerId());
}
Returning processing results (cont’d)
Google Inc. - All Rights Reserved
● Processing method can return a string value
● Use JSON.stringify / JSON.parse to serialize / deserialize
complex objects
● Use datastore to return large values
● E.g. SpreadSheetApp, DriveApp...
Returning processing results (cont’d)
Google Inc. - All Rights Reserved
Execution time limits
30-Xmin
processAccount(A)
30
minutes
30minutes
30-Xmin
processAccount(C)
30-Xmin
processAccount(B)
main() method
calls executeInParallel() for
accounts A, B, C
allFinished()
Xminutes
1hour
Google Inc. - All Rights Reserved
● Signup form: https://services.google.
com/fb/forms/mccscripts
Beta signup
Google Inc. - All Rights Reserved
Resources
MccApp Documentation: http://goo.gl/r0pGJO
Feature guide: http://goo.gl/u65RAF
Code snippets: http://goo.gl/2BXrfo
Complete solutions: http://goo.gl/JSjYyf
Forum: http://goo.gl/sc95Q8
Google Inc. - All Rights Reserved
Questions?
Google Inc. - All Rights Reserved

More Related Content

Viewers also liked

AwReporting tool introduction (Spanish)
AwReporting tool introduction (Spanish)AwReporting tool introduction (Spanish)
AwReporting tool introduction (Spanish)marcwan
 
AdWords API & OAuth 2.0, Advanced
AdWords API & OAuth 2.0, Advanced AdWords API & OAuth 2.0, Advanced
AdWords API & OAuth 2.0, Advanced marcwan
 
AwReporting Tool
AwReporting ToolAwReporting Tool
AwReporting Toolmarcwan
 
Getting Started with AdWords API and Google Analytics
Getting Started with AdWords API and Google AnalyticsGetting Started with AdWords API and Google Analytics
Getting Started with AdWords API and Google Analyticsmarcwan
 
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
 
Google Data Studio 360 Tutorial
Google Data Studio 360 TutorialGoogle Data Studio 360 Tutorial
Google Data Studio 360 TutorialVeeranjaneyulu CH
 

Viewers also liked (6)

AwReporting tool introduction (Spanish)
AwReporting tool introduction (Spanish)AwReporting tool introduction (Spanish)
AwReporting tool introduction (Spanish)
 
AdWords API & OAuth 2.0, Advanced
AdWords API & OAuth 2.0, Advanced AdWords API & OAuth 2.0, Advanced
AdWords API & OAuth 2.0, Advanced
 
AwReporting Tool
AwReporting ToolAwReporting Tool
AwReporting Tool
 
Getting Started with AdWords API and Google Analytics
Getting Started with AdWords API and Google AnalyticsGetting Started with AdWords API and Google Analytics
Getting Started with AdWords API and Google Analytics
 
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)
 
Google Data Studio 360 Tutorial
Google Data Studio 360 TutorialGoogle Data Studio 360 Tutorial
Google Data Studio 360 Tutorial
 

Similar to AdWords Scripts and MCC Scripting

MCC Scripts update
MCC Scripts updateMCC Scripts update
MCC Scripts updatesupergigas
 
Google Cloud Platform 2014Q1 - Starter Guide
Google Cloud Platform   2014Q1 - Starter GuideGoogle Cloud Platform   2014Q1 - Starter Guide
Google Cloud Platform 2014Q1 - Starter GuideSimon Su
 
OpenCms Days 2014 - User Generated Content in OpenCms 9.5
OpenCms Days 2014 - User Generated Content in OpenCms 9.5OpenCms Days 2014 - User Generated Content in OpenCms 9.5
OpenCms Days 2014 - User Generated Content in OpenCms 9.5Alkacon Software GmbH & Co. KG
 
Benefits of Google Tag Manager
Benefits of Google Tag ManagerBenefits of Google Tag Manager
Benefits of Google Tag ManagerPhil Pearce
 
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 JavaGiovane Liberato
 
Google Optimize for testing and personalization
Google Optimize for testing and personalizationGoogle Optimize for testing and personalization
Google Optimize for testing and personalizationOWOX BI
 
Dependency injection - the right way
Dependency injection - the right wayDependency injection - the right way
Dependency injection - the right wayThibaud Desodt
 
BatchJobService
BatchJobServiceBatchJobService
BatchJobServicesupergigas
 
Get Ready to Become Google Associate Cloud Engineer
Get Ready to Become Google Associate Cloud EngineerGet Ready to Become Google Associate Cloud Engineer
Get Ready to Become Google Associate Cloud EngineerAmaaira Johns
 
Java: Class Design Examples
Java: Class Design ExamplesJava: Class Design Examples
Java: Class Design ExamplesTareq Hasan
 
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...Dan Wahlin
 
Windows Store app using XAML and C#: Enterprise Product Development
Windows Store app using XAML and C#: Enterprise Product Development Windows Store app using XAML and C#: Enterprise Product Development
Windows Store app using XAML and C#: Enterprise Product Development Mahmoud Hamed Mahmoud
 
Image archive, analysis & report generation with Google Cloud
Image archive, analysis & report generation with Google CloudImage archive, analysis & report generation with Google Cloud
Image archive, analysis & report generation with Google Cloudwesley chun
 
Week 8
Week 8Week 8
Week 8A VD
 
Let's your users share your App with Friends: App Invites for Android
 Let's your users share your App with Friends: App Invites for Android Let's your users share your App with Friends: App Invites for Android
Let's your users share your App with Friends: App Invites for AndroidWilfried Mbouenda Mbogne
 
CGI::Prototype (NPW 2006)
CGI::Prototype (NPW 2006)CGI::Prototype (NPW 2006)
CGI::Prototype (NPW 2006)brian d foy
 
How to Pass the Google Analytics Individual Qualification Test by Slingshot SEO
How to Pass the  Google Analytics Individual Qualification Test by Slingshot SEOHow to Pass the  Google Analytics Individual Qualification Test by Slingshot SEO
How to Pass the Google Analytics Individual Qualification Test by Slingshot SEOAarif Nazir
 

Similar to AdWords Scripts and MCC Scripting (20)

MCC Scripts update
MCC Scripts updateMCC Scripts update
MCC Scripts update
 
Gae
GaeGae
Gae
 
Google Cloud Platform 2014Q1 - Starter Guide
Google Cloud Platform   2014Q1 - Starter GuideGoogle Cloud Platform   2014Q1 - Starter Guide
Google Cloud Platform 2014Q1 - Starter Guide
 
OpenCms Days 2014 - User Generated Content in OpenCms 9.5
OpenCms Days 2014 - User Generated Content in OpenCms 9.5OpenCms Days 2014 - User Generated Content in OpenCms 9.5
OpenCms Days 2014 - User Generated Content in OpenCms 9.5
 
Benefits of Google Tag Manager
Benefits of Google Tag ManagerBenefits of Google Tag Manager
Benefits of Google Tag Manager
 
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
 
Google Optimize for testing and personalization
Google Optimize for testing and personalizationGoogle Optimize for testing and personalization
Google Optimize for testing and personalization
 
Dependency injection - the right way
Dependency injection - the right wayDependency injection - the right way
Dependency injection - the right way
 
Cómo usar google analytics
Cómo usar google analyticsCómo usar google analytics
Cómo usar google analytics
 
BatchJobService
BatchJobServiceBatchJobService
BatchJobService
 
Get Ready to Become Google Associate Cloud Engineer
Get Ready to Become Google Associate Cloud EngineerGet Ready to Become Google Associate Cloud Engineer
Get Ready to Become Google Associate Cloud Engineer
 
Java: Class Design Examples
Java: Class Design ExamplesJava: Class Design Examples
Java: Class Design Examples
 
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...
 
Windows Store app using XAML and C#: Enterprise Product Development
Windows Store app using XAML and C#: Enterprise Product Development Windows Store app using XAML and C#: Enterprise Product Development
Windows Store app using XAML and C#: Enterprise Product Development
 
Image archive, analysis & report generation with Google Cloud
Image archive, analysis & report generation with Google CloudImage archive, analysis & report generation with Google Cloud
Image archive, analysis & report generation with Google Cloud
 
Week 8
Week 8Week 8
Week 8
 
Let's your users share your App with Friends: App Invites for Android
 Let's your users share your App with Friends: App Invites for Android Let's your users share your App with Friends: App Invites for Android
Let's your users share your App with Friends: App Invites for Android
 
From SF with Love
From SF with LoveFrom SF with Love
From SF with Love
 
CGI::Prototype (NPW 2006)
CGI::Prototype (NPW 2006)CGI::Prototype (NPW 2006)
CGI::Prototype (NPW 2006)
 
How to Pass the Google Analytics Individual Qualification Test by Slingshot SEO
How to Pass the  Google Analytics Individual Qualification Test by Slingshot SEOHow to Pass the  Google Analytics Individual Qualification Test by Slingshot SEO
How to Pass the Google Analytics Individual Qualification Test by Slingshot SEO
 

More from marcwan

Mcc scripts deck (日本語)
Mcc scripts deck (日本語)Mcc scripts deck (日本語)
Mcc scripts deck (日本語)marcwan
 
Shopping Campaigns and AdWords API
Shopping Campaigns and AdWords APIShopping Campaigns and AdWords API
Shopping Campaigns and AdWords APImarcwan
 
API Updates for v201402
API Updates for v201402API Updates for v201402
API Updates for v201402marcwan
 
AdWords API Targeting Options
AdWords API Targeting OptionsAdWords API Targeting Options
AdWords API Targeting Optionsmarcwan
 
OAuth 2.0 (Spanish)
OAuth 2.0 (Spanish)OAuth 2.0 (Spanish)
OAuth 2.0 (Spanish)marcwan
 
End to-end how to build a platform (Spanish)
End to-end how to build a platform (Spanish)End to-end how to build a platform (Spanish)
End to-end how to build a platform (Spanish)marcwan
 
Api update rundown (Spanish)
Api update rundown (Spanish)Api update rundown (Spanish)
Api update rundown (Spanish)marcwan
 
AdWords Scripts (Spanish)
AdWords Scripts (Spanish)AdWords Scripts (Spanish)
AdWords Scripts (Spanish)marcwan
 
Mobile landing pages (Spanish)
Mobile landing pages (Spanish)Mobile landing pages (Spanish)
Mobile landing pages (Spanish)marcwan
 
Rate limits and performance
Rate limits and performanceRate limits and performance
Rate limits and performancemarcwan
 
OAuth 2.0 refresher
OAuth 2.0 refresherOAuth 2.0 refresher
OAuth 2.0 refreshermarcwan
 
Mobile landing pages
Mobile landing pagesMobile landing pages
Mobile landing pagesmarcwan
 
End to-end how to build a platform
End to-end how to build a platformEnd to-end how to build a platform
End to-end how to build a platformmarcwan
 
AwReporting Tool
AwReporting ToolAwReporting Tool
AwReporting Toolmarcwan
 
Api update rundown
Api update rundownApi update rundown
Api update rundownmarcwan
 
AdWords Scripts
AdWords ScriptsAdWords Scripts
AdWords Scriptsmarcwan
 
Reporting tips & tricks
Reporting tips & tricksReporting tips & tricks
Reporting tips & tricksmarcwan
 
Reporting tips & tricks (russian)
Reporting tips & tricks (russian)Reporting tips & tricks (russian)
Reporting tips & tricks (russian)marcwan
 
Rate limits and performance (russian)
Rate limits and performance (russian)Rate limits and performance (russian)
Rate limits and performance (russian)marcwan
 

More from marcwan (19)

Mcc scripts deck (日本語)
Mcc scripts deck (日本語)Mcc scripts deck (日本語)
Mcc scripts deck (日本語)
 
Shopping Campaigns and AdWords API
Shopping Campaigns and AdWords APIShopping Campaigns and AdWords API
Shopping Campaigns and AdWords API
 
API Updates for v201402
API Updates for v201402API Updates for v201402
API Updates for v201402
 
AdWords API Targeting Options
AdWords API Targeting OptionsAdWords API Targeting Options
AdWords API Targeting Options
 
OAuth 2.0 (Spanish)
OAuth 2.0 (Spanish)OAuth 2.0 (Spanish)
OAuth 2.0 (Spanish)
 
End to-end how to build a platform (Spanish)
End to-end how to build a platform (Spanish)End to-end how to build a platform (Spanish)
End to-end how to build a platform (Spanish)
 
Api update rundown (Spanish)
Api update rundown (Spanish)Api update rundown (Spanish)
Api update rundown (Spanish)
 
AdWords Scripts (Spanish)
AdWords Scripts (Spanish)AdWords Scripts (Spanish)
AdWords Scripts (Spanish)
 
Mobile landing pages (Spanish)
Mobile landing pages (Spanish)Mobile landing pages (Spanish)
Mobile landing pages (Spanish)
 
Rate limits and performance
Rate limits and performanceRate limits and performance
Rate limits and performance
 
OAuth 2.0 refresher
OAuth 2.0 refresherOAuth 2.0 refresher
OAuth 2.0 refresher
 
Mobile landing pages
Mobile landing pagesMobile landing pages
Mobile landing pages
 
End to-end how to build a platform
End to-end how to build a platformEnd to-end how to build a platform
End to-end how to build a platform
 
AwReporting Tool
AwReporting ToolAwReporting Tool
AwReporting Tool
 
Api update rundown
Api update rundownApi update rundown
Api update rundown
 
AdWords Scripts
AdWords ScriptsAdWords Scripts
AdWords Scripts
 
Reporting tips & tricks
Reporting tips & tricksReporting tips & tricks
Reporting tips & tricks
 
Reporting tips & tricks (russian)
Reporting tips & tricks (russian)Reporting tips & tricks (russian)
Reporting tips & tricks (russian)
 
Rate limits and performance (russian)
Rate limits and performance (russian)Rate limits and performance (russian)
Rate limits and performance (russian)
 

Recently uploaded

MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
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 educationjfdjdjcjdnsjd
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
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.pptxRustici Software
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKJago de Vreede
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
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 FresherRemote DBA Services
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
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 AmsterdamUiPathCommunity
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
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 TerraformAndrey Devyatkin
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 

Recently uploaded (20)

MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 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
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
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
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
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
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
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
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
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
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 

AdWords Scripts and MCC Scripting

  • 1. Google Inc. - All Rights Reserved
  • 2. AdWords Scripts for MCC Manage AdWords accounts using JavaScript Mark Bowyer, Google, Inc.
  • 3. Agenda ● Introduction ● Getting started ● Resources ● Questions
  • 4. Google Inc. - All Rights Reserved Introduction
  • 5. Google Inc. - All Rights Reserved ● Way to programmatically access AdWords data ● Write your code in JavaScript ● Embedded IDE in AdWords UI Recap - AdWords Scripts
  • 6. Script Google Inc. - All Rights Reserved function main() { // Retrieve campaign by name using AWQL. var demoCampaign = AdWordsApp.campaigns(). withCondition("Name='Demo campaign'").get().next(); // Retrieve child adgroup using AWQL. var demoAdGroup = demoCampaign.adGroups(). withCondition("Name='Demo adgroup'").get().next(); // Modify the adgroup properties. demoAdGroup.setKeywordMaxCpc(1.2); } Recap - AdWords Scripts
  • 7. Google Inc. - All Rights Reserved ● AdWords Scripts at MCC level ● Allows managing accounts at scale What are MCC Scripts?
  • 8. Google Inc. - All Rights Reserved ● Currently open for beta signup ● Whitelisting usually takes a few business days. ● Request whitelist at top-level MCC account Availability
  • 9. Google Inc. - All Rights Reserved ● Manage multiple client accounts from a single script ● No more copy-pasting a script into multiple accounts! ● Process multiple accounts in parallel Benefits
  • 10. Google Inc. - All Rights Reserved ● Bid management in all your child accounts ● Cross-account reporting Common use cases
  • 11. Google Inc. - All Rights Reserved Accessing MCC Scripts 1 2
  • 12. Google Inc. - All Rights Reserved Get started!
  • 13. Script Google Inc. - All Rights Reserved Your first script function main() { // Retrieve all the child accounts. var accountIterator = MccApp.accounts().get(); // Iterate through the account list. while (accountIterator.hasNext()) { var account = accountIterator.next(); // Get stats for the child account. var stats = account.getStatsFor("THIS_MONTH"); // And log it. Logger.log("%s,%s,%s", account.getCustomerId(), stats.getClicks(), stats.getImpressions(), stats.getCost()); } }
  • 14. Google Inc. - All Rights Reserved ● Provides account management functionality ● Retrieve child accounts ● Select a child account for further operations ● Process multiple child accounts in parallel MccApp class
  • 15. Google Inc. - All Rights Reserved var accountIterator = MccApp.accounts().get(); ● Use MccApp.accounts method ● By default, returns all client accounts (excluding sub- MCCs) Selecting child accounts Script
  • 16. Google Inc. - All Rights Reserved ● Can optionally filter by an account label Selecting child accounts (cont’d) var accountIterator = MccApp.accounts() .withCondition('LabelName = "xxx"') .get(); Script
  • 17. Google Inc. - All Rights Reserved ● Can optionally take a list of client ids Selecting child accounts (cont’d) var accountIterator = MccApp.accounts() .withIds(['123-456-7890', '345-678-9000']) .get(); Script
  • 18. Google Inc. - All Rights Reserved ● By default, this is the account where script resides ● Switch context using MccApp.select method ● Then use AdWordsApp class to process account ● Remember to switch back to your MCC account! What account am I operating on?
  • 19. Script Google Inc. - All Rights Reserved var childAccount = MccApp.accounts().withIds(["918-501-8835"]) .get().next(); // Save the MCC account. var mccAccount = AdWordsApp.currentAccount(); // Select the child account MccApp.select(childAccount); // Process the account. ... // Switch back to MCC account. MccApp.select(mccAccount); Operating on a specific child account (cont’d)
  • 20. Google Inc. - All Rights Reserved Processing accounts in parallel
  • 21. Google Inc. - All Rights Reserved ● Use AccountSelector.executeInParallel method ● Operate on upto 50 accounts in parallel ● Optional callback method after processing accounts Operating on accounts in parallel
  • 22. Script Google Inc. - All Rights Reserved function main() { MccApp.accounts().executeInParallel("processAccount"); } function processAccount() { Logger.log("Operating on %s", AdWordsApp.currentAccount().getCustomerId()); // Process the account. // ... return; } Operating on accounts in parallel (cont’d)
  • 23. Script Google Inc. - All Rights Reserved function main() { MccApp.accounts().executeInParallel("processAccount", "allFinished"); } function processAccount() { ... } function allFinished(results) { ... } Specifying a callback
  • 24. Google Inc. - All Rights Reserved ● Use results argument of callback method ● Array of ExecutionResult objects ● One ExecutionResult per account processed Analyzing the outcome...
  • 25. Google Inc. - All Rights Reserved ● Contains ● CustomerId ● Status (Success, Error, Timeout) ● Error (if any) ● Return values from processAccount Analyzing the outcome (cont’d)
  • 26. Script Google Inc. - All Rights Reserved function processAccount() { return AdWordsApp.campaigns().get().totalNumEntities().toString(); } function allFinished(results) { var totalCampaigns = 0; for (var i = 0; i < results.length; i++) { totalCampaigns += parseInt(results[i].getReturnValue()); } Logger.log("There are %s campaigns under MCC ID: %s.", totalCampaigns, AdWordsApp.currentAccount().getCustomerId()); } Returning processing results (cont’d)
  • 27. Google Inc. - All Rights Reserved ● Processing method can return a string value ● Use JSON.stringify / JSON.parse to serialize / deserialize complex objects ● Use datastore to return large values ● E.g. SpreadSheetApp, DriveApp... Returning processing results (cont’d)
  • 28. Google Inc. - All Rights Reserved Execution time limits 30-Xmin processAccount(A) 30 minutes 30minutes 30-Xmin processAccount(C) 30-Xmin processAccount(B) main() method calls executeInParallel() for accounts A, B, C allFinished() Xminutes 1hour
  • 29. Google Inc. - All Rights Reserved ● Signup form: https://services.google. com/fb/forms/mccscripts Beta signup
  • 30. Google Inc. - All Rights Reserved Resources MccApp Documentation: http://goo.gl/r0pGJO Feature guide: http://goo.gl/u65RAF Code snippets: http://goo.gl/2BXrfo Complete solutions: http://goo.gl/JSjYyf Forum: http://goo.gl/sc95Q8
  • 31. Google Inc. - All Rights Reserved Questions?
  • 32. Google Inc. - All Rights Reserved