SlideShare a Scribd company logo
Scripts Update
Lightweight solution for account
management
Zhuo Chen
Agenda
● Brief recap
● New features
● Demo
● Resources
● Q&A
Recap
(from last workshop)
Capabilities
● No need for dev token
● Simple JavaScript Code
● Integrated IDE
● Preview mode
● Scheduled run
● External data source
Sample AdWords Script
Print all campaign names under current account
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());
}
}
Sample MCC Script
Print stats of all accounts under current MCC
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());
}
}
Limits
● Execution time
● Entities
● Quota of underlying Google services
● More details: doc
New features
New Features
● Bulk upload
● Display criteria
● Shopping campaigns
● Google services integration
● Upgraded URLs
New Features (Cont.)
● Many more:
○ Account label
○ Ad customizer
○ Ad extension - review, callout
○ Entity builder
○ Bidding
○ ...
Bulk Upload
● Make bulk changes by uploading data in CSV format
○ can be from many data sources
● Benefits:
○ Utilize new features
○ Easy to transform report data or change entities
○ Higher limits, both for quantities and time
● Support campaign management and offline
conversions
● References: doc, example
Bulk upload from Google Drive
function bulkUploadFromGoogleDrive() {
// Check document for the list of supported bulk upload templates.
// You can upload a CSV file, or an EXCEL sheet.
var SPREADSHEET_URL = 'INSERT_SPREADSHEET_URL_HERE';
var spreadSheet = SpreadsheetApp.openByUrl(SPREADSHEET_URL);
var sheet = spreadSheet.getActiveSheet();
var upload = AdWordsApp.bulkUploads().newFileUpload(sheet);
upload.forCampaignManagement();
// Use upload.apply() to make changes without previewing.
upload.preview();
}
Display criteria
● Manage the following display criteria:
○ keywords
○ placements
○ topics
○ audiences
● Both positive and negative (exclude)
● References: doc, example
Add a placement in a campaign
function addPlacementToCampaign() {
var campaign = AdWordsApp.campaigns()
.withCondition("Name = 'INSERT_CAMPAIGN_NAME_HERE'")
.get().next();
// Other display criteria can be built in a similar manner using the
// corresponding builder method in the AdWordsApp.Display,
// AdWordsApp.CampaignDisplay or AdWordsApp.AdGroupDisplay class.
var placementOperation = campaign.display()
.newPlacementBuilder()
.withUrl('http://www.site.com') // required
.withCpc(0.50) // optional
.build();
var placement = placementOperation.getResult();
Logger.log('Placement with id = %s and url = %s was created.',
placement.getId(), placement.getUrl());
}
Shopping
● Work with existing shopping campaigns
● Create and manage product group hierarchies
● Run shopping reports
● Cannot:
○ Create shopping campaigns
○ Set shopping properties at the campaign level (e.g.
campaign priority, inventory filters, etc.)
○ Link Merchant Center accounts
● References: doc
Retrieve shopping entities
var campaignName = "My first shopping campaign";
var adGroupName = "My first shopping adgroup";
var adGroupIterator = AdWordsApp.shoppingAdGroups()
.withCondition("CampaignName = '" + campaignName + "'")
.withCondition("AdGroupName = '" + adGroupName + "'")
.get();
while (adGroupIterator.hasNext()) {
var adGroup = adGroupIterator.next();
...
}
Select specific product group
function main() {
var productGroups = AdWordsApp.productGroups()
.withCondition("Clicks > 5")
.withCondition("Ctr > 0.01")
.forDateRange("LAST_MONTH")
.get();
while (productGroups.hasNext()) {
var productGroup = productGroups.next();
productGroup.setMaxCpc(productGroup.getMaxCpc() + 0.01);
}
}
Google Services Integration
● External Data:
○ Spreadsheet, Drive, Charts, Email, URL fetching
● Advanced APIs:
○ Google Analytics
○ Google BigQuery
○ YouTube and YouTube Analytics
○ Fusion Tables
○ Google Calendar
○ Google Tasks
○ Google Prediction
Advanced APIs
● Enablement:
○ Advanced APIs button -> Google Developers Console link
● Considerations:
○ Authorization
○ Permission
○ Quota
○ Billing
● References: doc, examples
Get stats for an Analytics profile
function getStatsForProfileId() {
var profileId = 'INSERT_PROFILE_ID_HERE';
// Dates should be in yyyy-mm-dd format.
var startDate = 'INSERT_START_DATE_HERE';
var endDate = 'INSERT_END_DATE_HERE';
var results = Analytics.Data.Ga.get('ga:' + profileId, startDate,
endDate, 'ga:sessions');
Logger.log('Profile Name: %s', results.profileInfo.profileName);
Logger.log('Total Sessions: %s', results.rows[0][0]);
}
Create event on a calendar
function createEvent() {
// You can find a Google Calendar's ID from its settings page.
var calendarId = 'INSERT_CALENDAR_ID_HERE' ;
// Apr 1, 2015 10:00:00 AM - Apr 1, 2015 11:00:00 AM
var start = new Date(2015, 3, 1, 10, 0, 0);
var end = new Date(2015, 3, 1, 11, 0, 0);
var calendarEvent = {
summary: 'Run account performance report' ,
description : 'Run account performance report for March.' ,
start: {dateTime: start.toISOString()},
end: {dateTime: end.toISOString()},
attendees: [{email: 'alice@example.com '}, {email: 'bob@example.com' }],
// Red background. Use Calendar.Colors.get() for the full list.
colorId: 11
};
calendarEvent = Calendar.Events.insert(calendarEvent, calendarId);
Logger.log('New event with ID = %s was created.' + calendarEvent .getId());
}
Upgraded URLs
● Separate landing URL and tracking URL
○ Less time to manage URL tracking updates
○ Reduce crawl and load time of website
○ New ValueTrack and custom tracking parameters
● Migration deadline: 1 July, 2015 (guide)
● References:
○ API: guide, migration guide
○ Scripts: blog post
Create a new text ad
var adOperation = adGroup.newTextAdBuilder()
.withHeadline("headline of ad")
.withDescription1("first line of ad description")
.withDescription2("second line of ad description")
.withDisplayUrl("www.example.com")
.withFinalUrl("http://www.example.com")
.build();
var ad = adOperation.getResult();
Resources
Documentation
Code snippets
Code snippets
Solutions
Forum
https://groups.google.com/forum/#!forum/adwords-scripts
Resources
● Documentation
● Code samples
● Solutions
● Forum
● 3rd Party Solution

More Related Content

PDF
Slides That Rock
PDF
How to Determine the ROI of Anything
PDF
6 Questions to Lead You to a Social Media Strategy
PDF
Work Rules!
PPTX
All About Beer
PDF
SlideShare 101
PDF
Getting Started with AdWords API and Google Analytics
PDF
Download full ebook of Google Analytics Justin Cutroni instant download pdf
Slides That Rock
How to Determine the ROI of Anything
6 Questions to Lead You to a Social Media Strategy
Work Rules!
All About Beer
SlideShare 101
Getting Started with AdWords API and Google Analytics
Download full ebook of Google Analytics Justin Cutroni instant download pdf

Similar to MCC Scripts update (20)

PDF
Ongoing_Management_Guide
PDF
Getting started with Google Analytics and the AdWords API
PDF
AdWords Scripts and MCC Scripting
PDF
Complete Ga Power User Web
PPTX
Webinar discover acquisio campaign automation algorithms
PPTX
Google Analytics for Store Owners - Intermediate
PDF
AdWords Scripts
PDF
Google Ad Manager Reports – A Beginner’s Guide
PDF
Tech4Africa Google Workshop 1
PDF
API Update Rundown
PDF
Google Analytics 1st Edition Justin Cutroni
PPTX
Florian Pertynski session at Google Partner Summit Review
PPT
Powerful Flexible Intelligent
PPTX
EIA2016Nice - Jevgenijs Kazanins. Deploying and Configuring Google Analytics ...
PPT
Google Analytics - Basic Installation
PDF
MMG GA4 – Using Analytics to Make Better Business Decisions 20230407.pdf
PPTX
Bi social vet_ga_day_1
PDF
Google analytics reporting using api
Ongoing_Management_Guide
Getting started with Google Analytics and the AdWords API
AdWords Scripts and MCC Scripting
Complete Ga Power User Web
Webinar discover acquisio campaign automation algorithms
Google Analytics for Store Owners - Intermediate
AdWords Scripts
Google Ad Manager Reports – A Beginner’s Guide
Tech4Africa Google Workshop 1
API Update Rundown
Google Analytics 1st Edition Justin Cutroni
Florian Pertynski session at Google Partner Summit Review
Powerful Flexible Intelligent
EIA2016Nice - Jevgenijs Kazanins. Deploying and Configuring Google Analytics ...
Google Analytics - Basic Installation
MMG GA4 – Using Analytics to Make Better Business Decisions 20230407.pdf
Bi social vet_ga_day_1
Google analytics reporting using api
Ad

More from supergigas (18)

PDF
Remarketing using customer match
PDF
What's new in reporting
PDF
Location aware ad customizers
PDF
GMB API (Google My Business)
PDF
Uploading HTML5 ads
PDF
BatchJobService
PDF
Why use ad words api
PDF
How to build a platform
PDF
Upgraded URLs
PDF
The AdWords api and mobile
PDF
Shopping Campaigns
PDF
Rate limits and Performance
PDF
How AdWords UI maps into adwords api
PDF
Extension Setting Services
PDF
Effective Reporting
PDF
Display Network criteria bidding
PDF
Dev Token tips
PDF
Ad Customizers
Remarketing using customer match
What's new in reporting
Location aware ad customizers
GMB API (Google My Business)
Uploading HTML5 ads
BatchJobService
Why use ad words api
How to build a platform
Upgraded URLs
The AdWords api and mobile
Shopping Campaigns
Rate limits and Performance
How AdWords UI maps into adwords api
Extension Setting Services
Effective Reporting
Display Network criteria bidding
Dev Token tips
Ad Customizers
Ad

Recently uploaded (20)

PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Network Security Unit 5.pdf for BCA BBA.
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPTX
Cloud computing and distributed systems.
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Approach and Philosophy of On baking technology
PDF
Encapsulation theory and applications.pdf
PDF
cuic standard and advanced reporting.pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
sap open course for s4hana steps from ECC to s4
Reach Out and Touch Someone: Haptics and Empathic Computing
Understanding_Digital_Forensics_Presentation.pptx
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Network Security Unit 5.pdf for BCA BBA.
“AI and Expert System Decision Support & Business Intelligence Systems”
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Cloud computing and distributed systems.
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Advanced methodologies resolving dimensionality complications for autism neur...
Building Integrated photovoltaic BIPV_UPV.pdf
Approach and Philosophy of On baking technology
Encapsulation theory and applications.pdf
cuic standard and advanced reporting.pdf
The AUB Centre for AI in Media Proposal.docx
NewMind AI Weekly Chronicles - August'25 Week I
sap open course for s4hana steps from ECC to s4

MCC Scripts update

  • 1. Scripts Update Lightweight solution for account management Zhuo Chen
  • 2. Agenda ● Brief recap ● New features ● Demo ● Resources ● Q&A
  • 4. Capabilities ● No need for dev token ● Simple JavaScript Code ● Integrated IDE ● Preview mode ● Scheduled run ● External data source
  • 5. Sample AdWords Script Print all campaign names under current account 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()); } }
  • 6. Sample MCC Script Print stats of all accounts under current MCC 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()); } }
  • 7. Limits ● Execution time ● Entities ● Quota of underlying Google services ● More details: doc
  • 9. New Features ● Bulk upload ● Display criteria ● Shopping campaigns ● Google services integration ● Upgraded URLs
  • 10. New Features (Cont.) ● Many more: ○ Account label ○ Ad customizer ○ Ad extension - review, callout ○ Entity builder ○ Bidding ○ ...
  • 11. Bulk Upload ● Make bulk changes by uploading data in CSV format ○ can be from many data sources ● Benefits: ○ Utilize new features ○ Easy to transform report data or change entities ○ Higher limits, both for quantities and time ● Support campaign management and offline conversions ● References: doc, example
  • 12. Bulk upload from Google Drive function bulkUploadFromGoogleDrive() { // Check document for the list of supported bulk upload templates. // You can upload a CSV file, or an EXCEL sheet. var SPREADSHEET_URL = 'INSERT_SPREADSHEET_URL_HERE'; var spreadSheet = SpreadsheetApp.openByUrl(SPREADSHEET_URL); var sheet = spreadSheet.getActiveSheet(); var upload = AdWordsApp.bulkUploads().newFileUpload(sheet); upload.forCampaignManagement(); // Use upload.apply() to make changes without previewing. upload.preview(); }
  • 13. Display criteria ● Manage the following display criteria: ○ keywords ○ placements ○ topics ○ audiences ● Both positive and negative (exclude) ● References: doc, example
  • 14. Add a placement in a campaign function addPlacementToCampaign() { var campaign = AdWordsApp.campaigns() .withCondition("Name = 'INSERT_CAMPAIGN_NAME_HERE'") .get().next(); // Other display criteria can be built in a similar manner using the // corresponding builder method in the AdWordsApp.Display, // AdWordsApp.CampaignDisplay or AdWordsApp.AdGroupDisplay class. var placementOperation = campaign.display() .newPlacementBuilder() .withUrl('http://www.site.com') // required .withCpc(0.50) // optional .build(); var placement = placementOperation.getResult(); Logger.log('Placement with id = %s and url = %s was created.', placement.getId(), placement.getUrl()); }
  • 15. Shopping ● Work with existing shopping campaigns ● Create and manage product group hierarchies ● Run shopping reports ● Cannot: ○ Create shopping campaigns ○ Set shopping properties at the campaign level (e.g. campaign priority, inventory filters, etc.) ○ Link Merchant Center accounts ● References: doc
  • 16. Retrieve shopping entities var campaignName = "My first shopping campaign"; var adGroupName = "My first shopping adgroup"; var adGroupIterator = AdWordsApp.shoppingAdGroups() .withCondition("CampaignName = '" + campaignName + "'") .withCondition("AdGroupName = '" + adGroupName + "'") .get(); while (adGroupIterator.hasNext()) { var adGroup = adGroupIterator.next(); ... }
  • 17. Select specific product group function main() { var productGroups = AdWordsApp.productGroups() .withCondition("Clicks > 5") .withCondition("Ctr > 0.01") .forDateRange("LAST_MONTH") .get(); while (productGroups.hasNext()) { var productGroup = productGroups.next(); productGroup.setMaxCpc(productGroup.getMaxCpc() + 0.01); } }
  • 18. Google Services Integration ● External Data: ○ Spreadsheet, Drive, Charts, Email, URL fetching ● Advanced APIs: ○ Google Analytics ○ Google BigQuery ○ YouTube and YouTube Analytics ○ Fusion Tables ○ Google Calendar ○ Google Tasks ○ Google Prediction
  • 19. Advanced APIs ● Enablement: ○ Advanced APIs button -> Google Developers Console link ● Considerations: ○ Authorization ○ Permission ○ Quota ○ Billing ● References: doc, examples
  • 20. Get stats for an Analytics profile function getStatsForProfileId() { var profileId = 'INSERT_PROFILE_ID_HERE'; // Dates should be in yyyy-mm-dd format. var startDate = 'INSERT_START_DATE_HERE'; var endDate = 'INSERT_END_DATE_HERE'; var results = Analytics.Data.Ga.get('ga:' + profileId, startDate, endDate, 'ga:sessions'); Logger.log('Profile Name: %s', results.profileInfo.profileName); Logger.log('Total Sessions: %s', results.rows[0][0]); }
  • 21. Create event on a calendar function createEvent() { // You can find a Google Calendar's ID from its settings page. var calendarId = 'INSERT_CALENDAR_ID_HERE' ; // Apr 1, 2015 10:00:00 AM - Apr 1, 2015 11:00:00 AM var start = new Date(2015, 3, 1, 10, 0, 0); var end = new Date(2015, 3, 1, 11, 0, 0); var calendarEvent = { summary: 'Run account performance report' , description : 'Run account performance report for March.' , start: {dateTime: start.toISOString()}, end: {dateTime: end.toISOString()}, attendees: [{email: 'alice@example.com '}, {email: 'bob@example.com' }], // Red background. Use Calendar.Colors.get() for the full list. colorId: 11 }; calendarEvent = Calendar.Events.insert(calendarEvent, calendarId); Logger.log('New event with ID = %s was created.' + calendarEvent .getId()); }
  • 22. Upgraded URLs ● Separate landing URL and tracking URL ○ Less time to manage URL tracking updates ○ Reduce crawl and load time of website ○ New ValueTrack and custom tracking parameters ● Migration deadline: 1 July, 2015 (guide) ● References: ○ API: guide, migration guide ○ Scripts: blog post
  • 23. Create a new text ad var adOperation = adGroup.newTextAdBuilder() .withHeadline("headline of ad") .withDescription1("first line of ad description") .withDescription2("second line of ad description") .withDisplayUrl("www.example.com") .withFinalUrl("http://www.example.com") .build(); var ad = adOperation.getResult();
  • 30. Resources ● Documentation ● Code samples ● Solutions ● Forum ● 3rd Party Solution