+ All Categories
Home > Technology > MCC Scripts update

MCC Scripts update

Date post: 15-Jul-2015
Category:
Upload: supergigas
View: 1,397 times
Download: 5 times
Share this document with a friend
30
Scripts Update Lightweight solution for account management Zhuo Chen
Transcript
Page 1: MCC Scripts update

Scripts UpdateLightweight solution for account management

Zhuo Chen

Page 2: MCC Scripts update

Agenda

● Brief recap

● New features

● Demo

● Resources

● Q&A

Page 3: MCC Scripts update

Recap(from last workshop)

Page 4: MCC Scripts update

Capabilities

● No need for dev token

● Simple JavaScript Code

● Integrated IDE

● Preview mode

● Scheduled run

● External data source

Page 5: MCC Scripts update

Sample AdWords Script

Print all campaign names under current accountfunction 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());

}

}

Page 6: MCC Scripts update

Sample MCC Script

Print stats of all accounts under current MCCfunction 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()); }}

Page 7: MCC Scripts update

Limits

● Execution time

● Entities

● Quota of underlying Google services

● More details: doc

Page 8: MCC Scripts update

New features

Page 9: MCC Scripts update

New Features

● Bulk upload

● Display criteria

● Shopping campaigns

● Google services integration

● Upgraded URLs

Page 10: MCC Scripts update

New Features (Cont.)

● Many more:○ Account label

○ Ad customizer

○ Ad extension - review, callout

○ Entity builder

○ Bidding

○ ...

Page 11: MCC Scripts update

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

Page 12: MCC Scripts update

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();}

Page 14: MCC Scripts update

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());}

Page 15: MCC Scripts update

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

Page 16: MCC Scripts update

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(); ...}

Page 17: MCC Scripts update

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); }}

Page 18: MCC Scripts update

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

Page 19: MCC Scripts update

Advanced APIs

● Enablement:○ Advanced APIs button -> Google Developers Console link

● Considerations:○ Authorization○ Permission○ Quota○ Billing

● References: doc, examples

Page 20: MCC Scripts update

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]);}

Page 21: MCC Scripts update

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: '[email protected] '}, {email: '[email protected]' }], // 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());}

Page 22: MCC Scripts update

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

Page 23: MCC Scripts update

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();

Page 24: MCC Scripts update

Resources

Page 25: MCC Scripts update

Documentation

Page 26: MCC Scripts update

Code snippets

Page 27: MCC Scripts update

Code snippets

Page 28: MCC Scripts update

Solutions


Recommended