SlideShare ist ein Scribd-Unternehmen logo
1 von 27
Downloaden Sie, um offline zu lesen
AdWords API Workshops – All rights reserved
AdWords Scripts
Automate AdWords activities using JavaScript

Anash P. Oommen, Google, Inc.

AdWords API Workshops – All rights reserved
Table of contents
● Introduction
● Your first script + demo
● Getting help
● Questions
● Resources

AdWords API Workshops – All rights reserved
Introduction

AdWords API Workshops – All rights reserved
Introduction
● Way to programmatically access AdWords data
● Write your code in JavaScript
● Embedded IDE in AdWords UI

AdWords API Workshops – All rights reserved
Common use cases
● Quick one-time tools
● Highly customized reporting
● Account alerts
● External feed-based triggers

AdWords API Workshops – All rights reserved
Requirements
● Entry-level familiarity with JavaScript
● An AdWords account to start writing your script!

AdWords API Workshops – All rights reserved
Capabilities
● Can access important AdWords types
○ Campaigns, Ad groups, Keywords, Ads, ad
extensions, reports…
● API-specific types
○ Ad Params

● Types not yet available in AdWords API
○ Labels

● No beta restriction

AdWords API Workshops – All rights reserved
Capabilities (cont’d)
● IDE with autocomplete and syntax highlighting
● Run normally or in preview mode
○ Preview mode won’t make any changes to your accounts
○ Will perform actions like sending email, updating
spreadsheets, etc.

● Uses OAuth 2.0 for authentication
○ Up to 250 scripts per login email.

AdWords API Workshops – All rights reserved
Capabilities (cont’d)
● Scripts can be automated
○ Can be scheduled to execute periodically on your behalf
○ As frequently as every hour.

● Can talk to external data sources
○
○
○
○

Fetch arbitrary URLs
Interact with Google Drive
Interact with Google Spreadsheets
Send emails

AdWords API Workshops – All rights reserved
Capabilities (cont’d)
● Simplified APIs
● Requires lesser amount of code than AdWords API.
● E.g. simplified feed services…

AdWords API Workshops – All rights reserved
Demo

AdWords API Workshops – All rights reserved
Creating your first script

AdWords API Workshops – All rights reserved
Creating your first script (cont’d)

AdWords API Workshops – All rights reserved
First script - retrieve all campaigns
function main() {
// Get all campaigns.
var campaignIterator = AdWordsApp.campaigns().get();
// iterate the list and print names to logger window.
while (campaignIterator.hasNext()) {
var campaign = campaignIterator.next();
Logger.log(campaign.getName());
}
}

AdWords API Workshops – All rights reserved

AW SCRIPT
Retrieving and updating objects
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);
}
AdWords API Workshops – All rights reserved

AW SCRIPT
Reporting
function main() {

AW SCRIPT

// Run an account performance report
var report = AdWordsApp.report("SELECT Clicks, Impressions, " +
"Cost, AverageCpc, Date FROM ACCOUNT_PERFORMANCE_REPORT " +
"DURING LAST_WEEK");
// Retrieve the spreadsheet to export values to.
var SPREADSHEET_URL = "xxx";
var spreadsheet = SpreadsheetApp.openByUrl(SPREADSHEET_URL);
var sheet = spreadsheet.getSheetByName(
"Account performance report");

AdWords API Workshops – All rights reserved
Reporting - cont’d
// Export the report to spreadsheet
report.exportToSheet(sheet);
// Send out an email with the spreadsheet link
MailApp.sendEmail("john_hancock@google.com",
"Account performance report is ready!",
"Access it at " + SPREADSHEET_URL);
}

AdWords API Workshops – All rights reserved

AW SCRIPT
Getting help

AdWords API Workshops – All rights reserved
Documentation and code snippets
● Refer to the documentation
○ https://developers.google.com/adwords/scripts/

● Refer to our code snippets
○ Accessible from the IDE
○ Also available on documentation site

AdWords API Workshops – All rights reserved
Ask on our forum!
● Ask on our forum
○ https://groups.google.com/forum/#!forum/adwords-scripts
○ Ask for general questions, code snippets, complete solutions,
feature requests…
○ Lots of helpful developers and Scripts team members!

AdWords API Workshops – All rights reserved
Complete solutions
● Ready-to-use complete solutions
○
○
○
○

https://developers.google.com/adwords/scripts/docs/solutions/
Ready-to-use as provided
Customize if required
Multiple categories - customized reporting, bidding tools…

● Scripts from third party developers
○ http://www.freeadwordsscripts.com/

AdWords API Workshops – All rights reserved
Questions?

AdWords API Workshops – All rights reserved
Resources
Documentation: http://goo.gl/77ACP
Forum: http://goo.gl/QsxCz5

AdWords API Workshops – All rights reserved
AdWords API Workshops – All rights reserved
Appendix 1 - Create sitelinks
var sitelink = AdWordsApp.extensions()
.newSitelinkBuilder()
.withLinkText("Hello world")
.withLinkUrl("http://www.example.com")
.create();
AdWordsApp.campaigns()
.withIds(['178532656'])
.get().next()
.addSitelink(sitelink);

AdWords API Workshops – All rights reserved

AW SCRIPT
Appendix 2 - Read AdParams
//interator on keywords
var kwIter = AdWordsApp.keywords().get(); //this is long, select campaign first
while (kwIter.hasNext()) {
//iterator on parameter of the current keyword
var adParamIter = kwIter.next().adParams().get();
while (adParamIter.hasNext()) {
var adParam = adParamIter.next();
Logger.log("campaign="+ adParam.getAdGroup().getCampaign().getName()+
" AdGroup="+ adParam.getAdGroup().getName()+
" KW=" + adParam.getKeyword().getText() +
" idx=" + adParam.getIndex() +
" value=" + adParam.getInsertionText());
}
}

AdWords API Workshops – All rights reserved

AW SCRIPT

Weitere ähnliche Inhalte

Ähnlich wie AdWords Scripts

Reporting tips & tricks
Reporting tips & tricksReporting tips & tricks
Reporting tips & tricksmarcwan
 
AdWords API Feed Services
AdWords API Feed ServicesAdWords API Feed Services
AdWords API Feed Servicesmarcwan
 
AdWords API - How to build a platform
AdWords API - How to build a platformAdWords API - How to build a platform
AdWords API - How to build a platformTimoBoz
 
Why use ad words api
Why use ad words apiWhy use ad words api
Why use ad words apisupergigas
 
OAuth 2.0 refresher Talk
OAuth 2.0 refresher TalkOAuth 2.0 refresher Talk
OAuth 2.0 refresher Talkmarcwan
 
Mobile landing pages
Mobile landing pagesMobile landing pages
Mobile landing pagesmarcwan
 
Mobile Landing Pages Talk
Mobile Landing Pages TalkMobile Landing Pages Talk
Mobile Landing Pages Talkmarcwan
 
Powerful Google developer tools for immediate impact! (2023-24 A)
Powerful Google developer tools for immediate impact! (2023-24 A)Powerful Google developer tools for immediate impact! (2023-24 A)
Powerful Google developer tools for immediate impact! (2023-24 A)wesley chun
 
Reporting tips & tricks
Reporting tips & tricks  Reporting tips & tricks
Reporting tips & tricks marcwan
 
Exploring Google APIs 102: Cloud vs. non-GCP Google APIs
Exploring Google APIs 102: Cloud vs. non-GCP Google APIsExploring Google APIs 102: Cloud vs. non-GCP Google APIs
Exploring Google APIs 102: Cloud vs. non-GCP Google APIswesley chun
 
Introduction to Google Cloud Endpoints: Speed Up Your API Development
Introduction to Google Cloud Endpoints: Speed Up Your API DevelopmentIntroduction to Google Cloud Endpoints: Speed Up Your API Development
Introduction to Google Cloud Endpoints: Speed Up Your API DevelopmentColin Su
 
Rate limits and performance Talk
Rate limits and performance TalkRate limits and performance Talk
Rate limits and performance Talkmarcwan
 
Write an API for Almost Anything: The Amazing Power and Flexibility of Django...
Write an API for Almost Anything: The Amazing Power and Flexibility of Django...Write an API for Almost Anything: The Amazing Power and Flexibility of Django...
Write an API for Almost Anything: The Amazing Power and Flexibility of Django...Caktus Group
 
Exploring Google APIs with Python
Exploring Google APIs with PythonExploring Google APIs with Python
Exploring Google APIs with Pythonwesley chun
 
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
 
IDE and Toolset For Magento Development
IDE and Toolset For Magento DevelopmentIDE and Toolset For Magento Development
IDE and Toolset For Magento DevelopmentAbid Malik
 
Google Apps Script for Beginners- Amazing Things with Code
Google Apps Script for Beginners- Amazing Things with CodeGoogle Apps Script for Beginners- Amazing Things with Code
Google Apps Script for Beginners- Amazing Things with CodeLaurence Svekis ✔
 
Accessing Google Cloud APIs
Accessing Google Cloud APIsAccessing Google Cloud APIs
Accessing Google Cloud APIswesley chun
 
Exploring Google (Cloud) APIs & Cloud Computing overview
Exploring Google (Cloud) APIs & Cloud Computing overviewExploring Google (Cloud) APIs & Cloud Computing overview
Exploring Google (Cloud) APIs & Cloud Computing overviewwesley chun
 
Programming for non tech entrepreneurs
Programming for non tech entrepreneursProgramming for non tech entrepreneurs
Programming for non tech entrepreneursRodrigo Gil
 

Ähnlich wie AdWords Scripts (20)

Reporting tips & tricks
Reporting tips & tricksReporting tips & tricks
Reporting tips & tricks
 
AdWords API Feed Services
AdWords API Feed ServicesAdWords API Feed Services
AdWords API Feed Services
 
AdWords API - How to build a platform
AdWords API - How to build a platformAdWords API - How to build a platform
AdWords API - How to build a platform
 
Why use ad words api
Why use ad words apiWhy use ad words api
Why use ad words api
 
OAuth 2.0 refresher Talk
OAuth 2.0 refresher TalkOAuth 2.0 refresher Talk
OAuth 2.0 refresher Talk
 
Mobile landing pages
Mobile landing pagesMobile landing pages
Mobile landing pages
 
Mobile Landing Pages Talk
Mobile Landing Pages TalkMobile Landing Pages Talk
Mobile Landing Pages Talk
 
Powerful Google developer tools for immediate impact! (2023-24 A)
Powerful Google developer tools for immediate impact! (2023-24 A)Powerful Google developer tools for immediate impact! (2023-24 A)
Powerful Google developer tools for immediate impact! (2023-24 A)
 
Reporting tips & tricks
Reporting tips & tricks  Reporting tips & tricks
Reporting tips & tricks
 
Exploring Google APIs 102: Cloud vs. non-GCP Google APIs
Exploring Google APIs 102: Cloud vs. non-GCP Google APIsExploring Google APIs 102: Cloud vs. non-GCP Google APIs
Exploring Google APIs 102: Cloud vs. non-GCP Google APIs
 
Introduction to Google Cloud Endpoints: Speed Up Your API Development
Introduction to Google Cloud Endpoints: Speed Up Your API DevelopmentIntroduction to Google Cloud Endpoints: Speed Up Your API Development
Introduction to Google Cloud Endpoints: Speed Up Your API Development
 
Rate limits and performance Talk
Rate limits and performance TalkRate limits and performance Talk
Rate limits and performance Talk
 
Write an API for Almost Anything: The Amazing Power and Flexibility of Django...
Write an API for Almost Anything: The Amazing Power and Flexibility of Django...Write an API for Almost Anything: The Amazing Power and Flexibility of Django...
Write an API for Almost Anything: The Amazing Power and Flexibility of Django...
 
Exploring Google APIs with Python
Exploring Google APIs with PythonExploring Google APIs with Python
Exploring Google APIs with Python
 
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
 
IDE and Toolset For Magento Development
IDE and Toolset For Magento DevelopmentIDE and Toolset For Magento Development
IDE and Toolset For Magento Development
 
Google Apps Script for Beginners- Amazing Things with Code
Google Apps Script for Beginners- Amazing Things with CodeGoogle Apps Script for Beginners- Amazing Things with Code
Google Apps Script for Beginners- Amazing Things with Code
 
Accessing Google Cloud APIs
Accessing Google Cloud APIsAccessing Google Cloud APIs
Accessing Google Cloud APIs
 
Exploring Google (Cloud) APIs & Cloud Computing overview
Exploring Google (Cloud) APIs & Cloud Computing overviewExploring Google (Cloud) APIs & Cloud Computing overview
Exploring Google (Cloud) APIs & Cloud Computing overview
 
Programming for non tech entrepreneurs
Programming for non tech entrepreneursProgramming for non tech entrepreneurs
Programming for non tech entrepreneurs
 

Mehr von marcwan

Mcc scripts deck (日本語)
Mcc scripts deck (日本語)Mcc scripts deck (日本語)
Mcc scripts deck (日本語)marcwan
 
Getting started with Google Analytics and the AdWords API
Getting started with Google Analytics and the AdWords APIGetting started with Google Analytics and the AdWords API
Getting started with Google Analytics and the AdWords APImarcwan
 
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
 
Opportunity Analysis with Kratu (v2)
Opportunity Analysis with Kratu (v2)Opportunity Analysis with Kratu (v2)
Opportunity Analysis with Kratu (v2)marcwan
 
07. feeds update
07. feeds update07. feeds update
07. feeds updatemarcwan
 
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
 
AdWords Scripts and MCC Scripting
AdWords Scripts and MCC ScriptingAdWords Scripts and MCC Scripting
AdWords Scripts and MCC Scriptingmarcwan
 
AwReporting Update
AwReporting UpdateAwReporting Update
AwReporting Updatemarcwan
 
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
 
Reporting Tips and Tricks (Spanish)
Reporting Tips and Tricks (Spanish)Reporting Tips and Tricks (Spanish)
Reporting Tips and Tricks (Spanish)marcwan
 
Rate limits and performance (Spanish)
Rate limits and performance (Spanish)Rate limits and performance (Spanish)
Rate limits and performance (Spanish)marcwan
 
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
 
AwReporting tool introduction (Spanish)
AwReporting tool introduction (Spanish)AwReporting tool introduction (Spanish)
AwReporting tool introduction (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
 

Mehr von marcwan (20)

Mcc scripts deck (日本語)
Mcc scripts deck (日本語)Mcc scripts deck (日本語)
Mcc scripts deck (日本語)
 
Getting started with Google Analytics and the AdWords API
Getting started with Google Analytics and the AdWords APIGetting started with Google Analytics and the AdWords API
Getting started with Google Analytics and the AdWords API
 
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)
 
Opportunity Analysis with Kratu (v2)
Opportunity Analysis with Kratu (v2)Opportunity Analysis with Kratu (v2)
Opportunity Analysis with Kratu (v2)
 
07. feeds update
07. feeds update07. feeds update
07. feeds update
 
AdWords API & OAuth 2.0, Advanced
AdWords API & OAuth 2.0, Advanced AdWords API & OAuth 2.0, Advanced
AdWords API & OAuth 2.0, Advanced
 
AdWords Scripts and MCC Scripting
AdWords Scripts and MCC ScriptingAdWords Scripts and MCC Scripting
AdWords Scripts and MCC Scripting
 
AwReporting Update
AwReporting UpdateAwReporting Update
AwReporting Update
 
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
 
Reporting Tips and Tricks (Spanish)
Reporting Tips and Tricks (Spanish)Reporting Tips and Tricks (Spanish)
Reporting Tips and Tricks (Spanish)
 
Rate limits and performance (Spanish)
Rate limits and performance (Spanish)Rate limits and performance (Spanish)
Rate limits and performance (Spanish)
 
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)
 
AwReporting tool introduction (Spanish)
AwReporting tool introduction (Spanish)AwReporting tool introduction (Spanish)
AwReporting tool introduction (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
 

Kürzlich hochgeladen

Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
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
 
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 Takeoffsammart93
 
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
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - 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
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
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
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
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 ModelDeepika Singh
 
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
 
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
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 

Kürzlich hochgeladen (20)

Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
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
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
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
 
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
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - 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
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
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, ...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
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
 
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
 
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
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 

AdWords Scripts

  • 1. AdWords API Workshops – All rights reserved
  • 2. AdWords Scripts Automate AdWords activities using JavaScript Anash P. Oommen, Google, Inc. AdWords API Workshops – All rights reserved
  • 3. Table of contents ● Introduction ● Your first script + demo ● Getting help ● Questions ● Resources AdWords API Workshops – All rights reserved
  • 4. Introduction AdWords API Workshops – All rights reserved
  • 5. Introduction ● Way to programmatically access AdWords data ● Write your code in JavaScript ● Embedded IDE in AdWords UI AdWords API Workshops – All rights reserved
  • 6. Common use cases ● Quick one-time tools ● Highly customized reporting ● Account alerts ● External feed-based triggers AdWords API Workshops – All rights reserved
  • 7. Requirements ● Entry-level familiarity with JavaScript ● An AdWords account to start writing your script! AdWords API Workshops – All rights reserved
  • 8. Capabilities ● Can access important AdWords types ○ Campaigns, Ad groups, Keywords, Ads, ad extensions, reports… ● API-specific types ○ Ad Params ● Types not yet available in AdWords API ○ Labels ● No beta restriction AdWords API Workshops – All rights reserved
  • 9. Capabilities (cont’d) ● IDE with autocomplete and syntax highlighting ● Run normally or in preview mode ○ Preview mode won’t make any changes to your accounts ○ Will perform actions like sending email, updating spreadsheets, etc. ● Uses OAuth 2.0 for authentication ○ Up to 250 scripts per login email. AdWords API Workshops – All rights reserved
  • 10. Capabilities (cont’d) ● Scripts can be automated ○ Can be scheduled to execute periodically on your behalf ○ As frequently as every hour. ● Can talk to external data sources ○ ○ ○ ○ Fetch arbitrary URLs Interact with Google Drive Interact with Google Spreadsheets Send emails AdWords API Workshops – All rights reserved
  • 11. Capabilities (cont’d) ● Simplified APIs ● Requires lesser amount of code than AdWords API. ● E.g. simplified feed services… AdWords API Workshops – All rights reserved
  • 12. Demo AdWords API Workshops – All rights reserved
  • 13. Creating your first script AdWords API Workshops – All rights reserved
  • 14. Creating your first script (cont’d) AdWords API Workshops – All rights reserved
  • 15. First script - retrieve all campaigns function main() { // Get all campaigns. var campaignIterator = AdWordsApp.campaigns().get(); // iterate the list and print names to logger window. while (campaignIterator.hasNext()) { var campaign = campaignIterator.next(); Logger.log(campaign.getName()); } } AdWords API Workshops – All rights reserved AW SCRIPT
  • 16. Retrieving and updating objects 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); } AdWords API Workshops – All rights reserved AW SCRIPT
  • 17. Reporting function main() { AW SCRIPT // Run an account performance report var report = AdWordsApp.report("SELECT Clicks, Impressions, " + "Cost, AverageCpc, Date FROM ACCOUNT_PERFORMANCE_REPORT " + "DURING LAST_WEEK"); // Retrieve the spreadsheet to export values to. var SPREADSHEET_URL = "xxx"; var spreadsheet = SpreadsheetApp.openByUrl(SPREADSHEET_URL); var sheet = spreadsheet.getSheetByName( "Account performance report"); AdWords API Workshops – All rights reserved
  • 18. Reporting - cont’d // Export the report to spreadsheet report.exportToSheet(sheet); // Send out an email with the spreadsheet link MailApp.sendEmail("john_hancock@google.com", "Account performance report is ready!", "Access it at " + SPREADSHEET_URL); } AdWords API Workshops – All rights reserved AW SCRIPT
  • 19. Getting help AdWords API Workshops – All rights reserved
  • 20. Documentation and code snippets ● Refer to the documentation ○ https://developers.google.com/adwords/scripts/ ● Refer to our code snippets ○ Accessible from the IDE ○ Also available on documentation site AdWords API Workshops – All rights reserved
  • 21. Ask on our forum! ● Ask on our forum ○ https://groups.google.com/forum/#!forum/adwords-scripts ○ Ask for general questions, code snippets, complete solutions, feature requests… ○ Lots of helpful developers and Scripts team members! AdWords API Workshops – All rights reserved
  • 22. Complete solutions ● Ready-to-use complete solutions ○ ○ ○ ○ https://developers.google.com/adwords/scripts/docs/solutions/ Ready-to-use as provided Customize if required Multiple categories - customized reporting, bidding tools… ● Scripts from third party developers ○ http://www.freeadwordsscripts.com/ AdWords API Workshops – All rights reserved
  • 23. Questions? AdWords API Workshops – All rights reserved
  • 25. AdWords API Workshops – All rights reserved
  • 26. Appendix 1 - Create sitelinks var sitelink = AdWordsApp.extensions() .newSitelinkBuilder() .withLinkText("Hello world") .withLinkUrl("http://www.example.com") .create(); AdWordsApp.campaigns() .withIds(['178532656']) .get().next() .addSitelink(sitelink); AdWords API Workshops – All rights reserved AW SCRIPT
  • 27. Appendix 2 - Read AdParams //interator on keywords var kwIter = AdWordsApp.keywords().get(); //this is long, select campaign first while (kwIter.hasNext()) { //iterator on parameter of the current keyword var adParamIter = kwIter.next().adParams().get(); while (adParamIter.hasNext()) { var adParam = adParamIter.next(); Logger.log("campaign="+ adParam.getAdGroup().getCampaign().getName()+ " AdGroup="+ adParam.getAdGroup().getName()+ " KW=" + adParam.getKeyword().getText() + " idx=" + adParam.getIndex() + " value=" + adParam.getInsertionText()); } } AdWords API Workshops – All rights reserved AW SCRIPT