SlideShare a Scribd company logo
Google Inc. - All Rights Reserved
MCC スクリプト
JavaScript を使った効率的なアカウント管理
Ryuich Hoshi, Google.
目次
● はじめに
● 使ってみよう
● 参考資料
● Questions?
Google Inc. - All Rights Reserved
はじめに
Google Inc. - All Rights Reserved
● AdWords のデータをプログラムから操作する方法
● JavaScript を使用
● 開発環境は AdWords UI の中に用意
AdWords スクリプトの復習
Script
Google Inc. - All Rights Reserved
function main() {
// AWQL を使って指定した名前のキャンペーンを取得
var demoCampaign = AdWordsApp.campaigns().
withCondition("Name='Demo campaign'").get().next();
// AWQL を使って、直下の広告グループを取得
var demoAdGroup = demoCampaign.adGroups().
withCondition("Name='Demo adgroup'").get().next();
// 広告グループの設定を変更
demoAdGroup.setKeywordMaxCpc(1.2);
}
AdWords スクリプトの復習
Google Inc. - All Rights Reserved
● MCC レベルで使える AdWords スクリプト
● 多くのアカウントを管理可能に
MCC スクリプトとは?
Google Inc. - All Rights Reserved
● 現在は、すべての方がご利用になれます
利用可能な方
Google Inc. - All Rights Reserved
● 1つのスクリプトで複数のアカウントを管理可能
● 1つのスクリプトを複数のアカウントにコピーする必要なし
● 複数のアカウントを並列に処理
利点
Google Inc. - All Rights Reserved
● 管理している全てのアカウントの入札単価を調整
● 複数アカウントのレポートを出力
よくある使い方
Google Inc. - All Rights Reserved
MCC スクリプトを使ってみる
1
2
Google Inc. - All Rights Reserved
使ってみよう
Script
Google Inc. - All Rights Reserved
初めての MCC スクリプト
function main() {
// 全ての子アカウントを取得
var accountIterator = MccApp.accounts().get();
// 取得したアカウントを順に処理
while (accountIterator.hasNext()) {
var account = accountIterator.next();
// 子アカウントのパフォーマンス データを取得
var stats = account.getStatsFor("THIS_MONTH");
// ログに出力
Logger.log("%s,%s,%s,%s", account.getCustomerId(), stats.getClicks(),
stats.getImpressions(), stats.getCost());
}
}
Google Inc. - All Rights Reserved
● アカウントを管理する機能を提供
● 子アカウントを取得
● 操作するアカウントを選択
● 複数のアカウントを並列に処理
MccApp クラス
Google Inc. - All Rights Reserved
var accountIterator = MccApp.accounts().get();
● MccApp.accounts メソッドを使用
● デフォルトでは、全ての子アカウントを返す(サブMCCは除く)
子アカウントを選択する
Script
Google Inc. - All Rights Reserved
● アカウント レベルでフィルターすることが可能
子アカウントを選択する
var accountIterator = MccApp.accounts()
.withCondition('LabelNames CONTAINS "xxx"')
.get();
Script
Google Inc. - All Rights Reserved
● Customer Id を直接指定することも可能
子アカウントを選択する
var accountIterator = MccApp.accounts()
.withIds(['123-456-7890', '345-678-9000'])
.get();
Script
Google Inc. - All Rights Reserved
● デフォルトでは、スクリプトが置かれているアカウント
● MccApp.select を使い、操作対象アカウントを変更
● AdWordsApp クラスを使いアカウントを操作
● 最後に操作対象をMCC アカウントへ戻すことを忘れずに!
いまどのアカウントを操作している?
Script
Google Inc. - All Rights Reserved
var childAccount = MccApp.accounts().withIds(["918-501-8835"])
.get().next();
// 現在のMCCアカウントを保存
var mccAccount = AdWordsApp.currentAccount();
// 子アカウントを選択
MccApp.select(childAccount);
// 子アカウントへの処理を実行
...
// 操作対象を MCC アカウントに戻す
MccApp.select(mccAccount);
特定の子アカウントを操作する
Google Inc. - All Rights Reserved
アカウントを並列に処理する
Google Inc. - All Rights Reserved
● AccountSelector.executeInParallel メソッドを使
用
● 50 アカウントまで並列に処理可能
● すべての処理終了後、オプションで callback 関数を実行可
能
アカウントを並列に処理する
Script
Google Inc. - All Rights Reserved
function main() {
MccApp.accounts().executeInParallel("processAccount");
}
function processAccount() {
Logger.log("Operating on %s",
AdWordsApp.currentAccount().getCustomerId());
// アカウントへの処理を実行
// ...
return;
}
アカウントを並列に処理する
Script
Google Inc. - All Rights Reserved
function main() {
MccApp.accounts().executeInParallel("processAccount",
"allFinished");
}
function processAccount() {
...
}
function allFinished(results) {
...
}
Callback 関数を指定
Google Inc. - All Rights Reserved
● Callback 関数の results 引数を使用
● ExecutionResult オブジェクトの配列
● 1つのアカウント処理につき、1つの ExecutionResult
実行結果を分析する
Google Inc. - All Rights Reserved
● ExecutionResult オブジェクトが含む情報
● CustomerId
● Status (Success, Error, Timeout)
● Error (もしあれば)
● processAccount の返り値
実行結果を分析する
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());
}
実行結果を返す
Google Inc. - All Rights Reserved
● 処理関数は string の返り値を返すことができる
● 複雑なオブジェクトを返したい場合には、JSON.stringify /
JSON.parse を使用してオブジェクトの serialize /
deserialize を行う
● 大きな値を返したい場合には、各種データストレージを使う
(E.g. SpreadSheetApp, DriveApp...)
実行結果を返す
Google Inc. - All Rights Reserved
実行時間制限
30-X分
processAccount(A)
30分30分
30-X分
processAccount(C)
30-X分
processAccount(B)
main() 関数
executeInParallel() をアカウント
A, B, C へ実行
allFinished()
Xminutes
1時間
Google Inc. - All Rights Reserved
参考資料
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

Similar to Mcc scripts deck (日本語)

Vertica 9.0.0 新機能
Vertica 9.0.0 新機能Vertica 9.0.0 新機能
Vertica 9.0.0 新機能
Kaito Tono
 
HTML5で作るハイブリッドアプリに広告実装ハンズオンセミナー第2回
HTML5で作るハイブリッドアプリに広告実装ハンズオンセミナー第2回HTML5で作るハイブリッドアプリに広告実装ハンズオンセミナー第2回
HTML5で作るハイブリッドアプリに広告実装ハンズオンセミナー第2回
caytosales
 
HTML5で作るハイブリッドアプリに広告実装ハンズオンセミナー
HTML5で作るハイブリッドアプリに広告実装ハンズオンセミナーHTML5で作るハイブリッドアプリに広告実装ハンズオンセミナー
HTML5で作るハイブリッドアプリに広告実装ハンズオンセミナー
caytosales
 
Team Foundation Server / Visual Studio Team Services によるプロジェクト管理・リポジトリ管理・継続的イ...
Team Foundation Server / Visual Studio Team Services によるプロジェクト管理・リポジトリ管理・継続的イ...Team Foundation Server / Visual Studio Team Services によるプロジェクト管理・リポジトリ管理・継続的イ...
Team Foundation Server / Visual Studio Team Services によるプロジェクト管理・リポジトリ管理・継続的イ...
Masaki Takeda
 
Try_to_writecode_practicaltest #atest_hack
Try_to_writecode_practicaltest #atest_hackTry_to_writecode_practicaltest #atest_hack
Try_to_writecode_practicaltest #atest_hack
kimukou_26 Kimukou
 
【17-C-2】 クラウド上でのエンタープライズアプリケーション開発
【17-C-2】 クラウド上でのエンタープライズアプリケーション開発【17-C-2】 クラウド上でのエンタープライズアプリケーション開発
【17-C-2】 クラウド上でのエンタープライズアプリケーション開発
lalha
 
20150207コデアルエンジニア学生向けハッカソン就活イベント発表資料
20150207コデアルエンジニア学生向けハッカソン就活イベント発表資料20150207コデアルエンジニア学生向けハッカソン就活イベント発表資料
20150207コデアルエンジニア学生向けハッカソン就活イベント発表資料
codeal
 
Team Foundation Server / Visual Studio Team Services 手順書
Team Foundation Server /Visual Studio Team Services 手順書Team Foundation Server /Visual Studio Team Services 手順書
Team Foundation Server / Visual Studio Team Services 手順書
Masaki Takeda
 
Angular jsとsinatraでturbolinks
Angular jsとsinatraでturbolinksAngular jsとsinatraでturbolinks
Angular jsとsinatraでturbolinksMinori Tokuda
 
LabVIEW NXG Web Module Training Slide
LabVIEW NXG Web Module Training SlideLabVIEW NXG Web Module Training Slide
LabVIEW NXG Web Module Training Slide
Yusuke Tochigi
 

Similar to Mcc scripts deck (日本語) (10)

Vertica 9.0.0 新機能
Vertica 9.0.0 新機能Vertica 9.0.0 新機能
Vertica 9.0.0 新機能
 
HTML5で作るハイブリッドアプリに広告実装ハンズオンセミナー第2回
HTML5で作るハイブリッドアプリに広告実装ハンズオンセミナー第2回HTML5で作るハイブリッドアプリに広告実装ハンズオンセミナー第2回
HTML5で作るハイブリッドアプリに広告実装ハンズオンセミナー第2回
 
HTML5で作るハイブリッドアプリに広告実装ハンズオンセミナー
HTML5で作るハイブリッドアプリに広告実装ハンズオンセミナーHTML5で作るハイブリッドアプリに広告実装ハンズオンセミナー
HTML5で作るハイブリッドアプリに広告実装ハンズオンセミナー
 
Team Foundation Server / Visual Studio Team Services によるプロジェクト管理・リポジトリ管理・継続的イ...
Team Foundation Server / Visual Studio Team Services によるプロジェクト管理・リポジトリ管理・継続的イ...Team Foundation Server / Visual Studio Team Services によるプロジェクト管理・リポジトリ管理・継続的イ...
Team Foundation Server / Visual Studio Team Services によるプロジェクト管理・リポジトリ管理・継続的イ...
 
Try_to_writecode_practicaltest #atest_hack
Try_to_writecode_practicaltest #atest_hackTry_to_writecode_practicaltest #atest_hack
Try_to_writecode_practicaltest #atest_hack
 
【17-C-2】 クラウド上でのエンタープライズアプリケーション開発
【17-C-2】 クラウド上でのエンタープライズアプリケーション開発【17-C-2】 クラウド上でのエンタープライズアプリケーション開発
【17-C-2】 クラウド上でのエンタープライズアプリケーション開発
 
20150207コデアルエンジニア学生向けハッカソン就活イベント発表資料
20150207コデアルエンジニア学生向けハッカソン就活イベント発表資料20150207コデアルエンジニア学生向けハッカソン就活イベント発表資料
20150207コデアルエンジニア学生向けハッカソン就活イベント発表資料
 
Team Foundation Server / Visual Studio Team Services 手順書
Team Foundation Server /Visual Studio Team Services 手順書Team Foundation Server /Visual Studio Team Services 手順書
Team Foundation Server / Visual Studio Team Services 手順書
 
Angular jsとsinatraでturbolinks
Angular jsとsinatraでturbolinksAngular jsとsinatraでturbolinks
Angular jsとsinatraでturbolinks
 
LabVIEW NXG Web Module Training Slide
LabVIEW NXG Web Module Training SlideLabVIEW NXG Web Module Training Slide
LabVIEW NXG Web Module Training Slide
 

More from marcwan

Opportunity Analysis with Kratu
Opportunity Analysis with KratuOpportunity Analysis with Kratu
Opportunity Analysis with Kratumarcwan
 
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
 
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
 
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 performance
marcwan
 
OAuth 2.0 refresher
OAuth 2.0 refresherOAuth 2.0 refresher
OAuth 2.0 refresher
marcwan
 
Mobile landing pages
Mobile landing pagesMobile landing pages
Mobile landing pages
marcwan
 

More from marcwan (20)

Opportunity Analysis with Kratu
Opportunity Analysis with KratuOpportunity Analysis with Kratu
Opportunity Analysis with Kratu
 
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
 
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
 
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
 
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
 

Recently uploaded

FIDO Alliance Osaka Seminar: Welcome Slides.pdf
FIDO Alliance Osaka Seminar: Welcome Slides.pdfFIDO Alliance Osaka Seminar: Welcome Slides.pdf
FIDO Alliance Osaka Seminar: Welcome Slides.pdf
FIDO Alliance
 
2024年度_サイバーエージェント_新卒研修「データベースの歴史」.pptx
2024年度_サイバーエージェント_新卒研修「データベースの歴史」.pptx2024年度_サイバーエージェント_新卒研修「データベースの歴史」.pptx
2024年度_サイバーエージェント_新卒研修「データベースの歴史」.pptx
yassun7010
 
FIDO Alliance Osaka Seminar: PlayStation Passkey Deployment Case Study.pdf
FIDO Alliance Osaka Seminar: PlayStation Passkey Deployment Case Study.pdfFIDO Alliance Osaka Seminar: PlayStation Passkey Deployment Case Study.pdf
FIDO Alliance Osaka Seminar: PlayStation Passkey Deployment Case Study.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: CloudGate.pdf
FIDO Alliance Osaka Seminar: CloudGate.pdfFIDO Alliance Osaka Seminar: CloudGate.pdf
FIDO Alliance Osaka Seminar: CloudGate.pdf
FIDO Alliance
 
論文紹介:When Visual Prompt Tuning Meets Source-Free Domain Adaptive Semantic Seg...
論文紹介:When Visual Prompt Tuning Meets Source-Free Domain Adaptive Semantic Seg...論文紹介:When Visual Prompt Tuning Meets Source-Free Domain Adaptive Semantic Seg...
論文紹介:When Visual Prompt Tuning Meets Source-Free Domain Adaptive Semantic Seg...
Toru Tamaki
 
単腕マニピュレータによる 複数物体の同時組み立ての 基礎的考察 / Basic Approach to Robotic Assembly of Multi...
単腕マニピュレータによる 複数物体の同時組み立ての 基礎的考察 / Basic Approach to Robotic Assembly of Multi...単腕マニピュレータによる 複数物体の同時組み立ての 基礎的考察 / Basic Approach to Robotic Assembly of Multi...
単腕マニピュレータによる 複数物体の同時組み立ての 基礎的考察 / Basic Approach to Robotic Assembly of Multi...
Fukuoka Institute of Technology
 
【DLゼミ】XFeat: Accelerated Features for Lightweight Image Matching
【DLゼミ】XFeat: Accelerated Features for Lightweight Image Matching【DLゼミ】XFeat: Accelerated Features for Lightweight Image Matching
【DLゼミ】XFeat: Accelerated Features for Lightweight Image Matching
harmonylab
 
CS集会#13_なるほどわからん通信技術 発表資料
CS集会#13_なるほどわからん通信技術 発表資料CS集会#13_なるほどわからん通信技術 発表資料
CS集会#13_なるほどわからん通信技術 発表資料
Yuuitirou528 default
 
FIDO Alliance Osaka Seminar: NEC & Yubico Panel.pdf
FIDO Alliance Osaka Seminar: NEC & Yubico Panel.pdfFIDO Alliance Osaka Seminar: NEC & Yubico Panel.pdf
FIDO Alliance Osaka Seminar: NEC & Yubico Panel.pdf
FIDO Alliance
 
YugabyteDB適用に向けた取り組みと隠れた魅力 (DSS Asia 2024 発表資料)
YugabyteDB適用に向けた取り組みと隠れた魅力 (DSS Asia 2024 発表資料)YugabyteDB適用に向けた取り組みと隠れた魅力 (DSS Asia 2024 発表資料)
YugabyteDB適用に向けた取り組みと隠れた魅力 (DSS Asia 2024 発表資料)
NTT DATA Technology & Innovation
 
【AI論文解説】Consistency ModelとRectified Flow
【AI論文解説】Consistency ModelとRectified Flow【AI論文解説】Consistency ModelとRectified Flow
【AI論文解説】Consistency ModelとRectified Flow
Sony - Neural Network Libraries
 
LoRaWAN 4チャンネル電流センサー・コンバーター CS01-LBカタログ
LoRaWAN 4チャンネル電流センサー・コンバーター CS01-LBカタログLoRaWAN 4チャンネル電流センサー・コンバーター CS01-LBカタログ
LoRaWAN 4チャンネル電流センサー・コンバーター CS01-LBカタログ
CRI Japan, Inc.
 
MPAなWebフレームワーク、Astroの紹介 (その2) 2024/05/24の勉強会で発表されたものです。
MPAなWebフレームワーク、Astroの紹介 (その2) 2024/05/24の勉強会で発表されたものです。MPAなWebフレームワーク、Astroの紹介 (その2) 2024/05/24の勉強会で発表されたものです。
MPAなWebフレームワーク、Astroの紹介 (その2) 2024/05/24の勉強会で発表されたものです。
iPride Co., Ltd.
 
FIDO Alliance Osaka Seminar: LY-DOCOMO-KDDI-Mercari Panel.pdf
FIDO Alliance Osaka Seminar: LY-DOCOMO-KDDI-Mercari Panel.pdfFIDO Alliance Osaka Seminar: LY-DOCOMO-KDDI-Mercari Panel.pdf
FIDO Alliance Osaka Seminar: LY-DOCOMO-KDDI-Mercari Panel.pdf
FIDO Alliance
 
TaketoFujikawa_物語のコンセプトに基づく情報アクセス手法の基礎検討_JSAI2024
TaketoFujikawa_物語のコンセプトに基づく情報アクセス手法の基礎検討_JSAI2024TaketoFujikawa_物語のコンセプトに基づく情報アクセス手法の基礎検討_JSAI2024
TaketoFujikawa_物語のコンセプトに基づく情報アクセス手法の基礎検討_JSAI2024
Matsushita Laboratory
 

Recently uploaded (15)

FIDO Alliance Osaka Seminar: Welcome Slides.pdf
FIDO Alliance Osaka Seminar: Welcome Slides.pdfFIDO Alliance Osaka Seminar: Welcome Slides.pdf
FIDO Alliance Osaka Seminar: Welcome Slides.pdf
 
2024年度_サイバーエージェント_新卒研修「データベースの歴史」.pptx
2024年度_サイバーエージェント_新卒研修「データベースの歴史」.pptx2024年度_サイバーエージェント_新卒研修「データベースの歴史」.pptx
2024年度_サイバーエージェント_新卒研修「データベースの歴史」.pptx
 
FIDO Alliance Osaka Seminar: PlayStation Passkey Deployment Case Study.pdf
FIDO Alliance Osaka Seminar: PlayStation Passkey Deployment Case Study.pdfFIDO Alliance Osaka Seminar: PlayStation Passkey Deployment Case Study.pdf
FIDO Alliance Osaka Seminar: PlayStation Passkey Deployment Case Study.pdf
 
FIDO Alliance Osaka Seminar: CloudGate.pdf
FIDO Alliance Osaka Seminar: CloudGate.pdfFIDO Alliance Osaka Seminar: CloudGate.pdf
FIDO Alliance Osaka Seminar: CloudGate.pdf
 
論文紹介:When Visual Prompt Tuning Meets Source-Free Domain Adaptive Semantic Seg...
論文紹介:When Visual Prompt Tuning Meets Source-Free Domain Adaptive Semantic Seg...論文紹介:When Visual Prompt Tuning Meets Source-Free Domain Adaptive Semantic Seg...
論文紹介:When Visual Prompt Tuning Meets Source-Free Domain Adaptive Semantic Seg...
 
単腕マニピュレータによる 複数物体の同時組み立ての 基礎的考察 / Basic Approach to Robotic Assembly of Multi...
単腕マニピュレータによる 複数物体の同時組み立ての 基礎的考察 / Basic Approach to Robotic Assembly of Multi...単腕マニピュレータによる 複数物体の同時組み立ての 基礎的考察 / Basic Approach to Robotic Assembly of Multi...
単腕マニピュレータによる 複数物体の同時組み立ての 基礎的考察 / Basic Approach to Robotic Assembly of Multi...
 
【DLゼミ】XFeat: Accelerated Features for Lightweight Image Matching
【DLゼミ】XFeat: Accelerated Features for Lightweight Image Matching【DLゼミ】XFeat: Accelerated Features for Lightweight Image Matching
【DLゼミ】XFeat: Accelerated Features for Lightweight Image Matching
 
CS集会#13_なるほどわからん通信技術 発表資料
CS集会#13_なるほどわからん通信技術 発表資料CS集会#13_なるほどわからん通信技術 発表資料
CS集会#13_なるほどわからん通信技術 発表資料
 
FIDO Alliance Osaka Seminar: NEC & Yubico Panel.pdf
FIDO Alliance Osaka Seminar: NEC & Yubico Panel.pdfFIDO Alliance Osaka Seminar: NEC & Yubico Panel.pdf
FIDO Alliance Osaka Seminar: NEC & Yubico Panel.pdf
 
YugabyteDB適用に向けた取り組みと隠れた魅力 (DSS Asia 2024 発表資料)
YugabyteDB適用に向けた取り組みと隠れた魅力 (DSS Asia 2024 発表資料)YugabyteDB適用に向けた取り組みと隠れた魅力 (DSS Asia 2024 発表資料)
YugabyteDB適用に向けた取り組みと隠れた魅力 (DSS Asia 2024 発表資料)
 
【AI論文解説】Consistency ModelとRectified Flow
【AI論文解説】Consistency ModelとRectified Flow【AI論文解説】Consistency ModelとRectified Flow
【AI論文解説】Consistency ModelとRectified Flow
 
LoRaWAN 4チャンネル電流センサー・コンバーター CS01-LBカタログ
LoRaWAN 4チャンネル電流センサー・コンバーター CS01-LBカタログLoRaWAN 4チャンネル電流センサー・コンバーター CS01-LBカタログ
LoRaWAN 4チャンネル電流センサー・コンバーター CS01-LBカタログ
 
MPAなWebフレームワーク、Astroの紹介 (その2) 2024/05/24の勉強会で発表されたものです。
MPAなWebフレームワーク、Astroの紹介 (その2) 2024/05/24の勉強会で発表されたものです。MPAなWebフレームワーク、Astroの紹介 (その2) 2024/05/24の勉強会で発表されたものです。
MPAなWebフレームワーク、Astroの紹介 (その2) 2024/05/24の勉強会で発表されたものです。
 
FIDO Alliance Osaka Seminar: LY-DOCOMO-KDDI-Mercari Panel.pdf
FIDO Alliance Osaka Seminar: LY-DOCOMO-KDDI-Mercari Panel.pdfFIDO Alliance Osaka Seminar: LY-DOCOMO-KDDI-Mercari Panel.pdf
FIDO Alliance Osaka Seminar: LY-DOCOMO-KDDI-Mercari Panel.pdf
 
TaketoFujikawa_物語のコンセプトに基づく情報アクセス手法の基礎検討_JSAI2024
TaketoFujikawa_物語のコンセプトに基づく情報アクセス手法の基礎検討_JSAI2024TaketoFujikawa_物語のコンセプトに基づく情報アクセス手法の基礎検討_JSAI2024
TaketoFujikawa_物語のコンセプトに基づく情報アクセス手法の基礎検討_JSAI2024
 

Mcc scripts deck (日本語)

  • 1. Google Inc. - All Rights Reserved
  • 4. Google Inc. - All Rights Reserved はじめに
  • 5. Google Inc. - All Rights Reserved ● AdWords のデータをプログラムから操作する方法 ● JavaScript を使用 ● 開発環境は AdWords UI の中に用意 AdWords スクリプトの復習
  • 6. Script Google Inc. - All Rights Reserved function main() { // AWQL を使って指定した名前のキャンペーンを取得 var demoCampaign = AdWordsApp.campaigns(). withCondition("Name='Demo campaign'").get().next(); // AWQL を使って、直下の広告グループを取得 var demoAdGroup = demoCampaign.adGroups(). withCondition("Name='Demo adgroup'").get().next(); // 広告グループの設定を変更 demoAdGroup.setKeywordMaxCpc(1.2); } AdWords スクリプトの復習
  • 7. Google Inc. - All Rights Reserved ● MCC レベルで使える AdWords スクリプト ● 多くのアカウントを管理可能に MCC スクリプトとは?
  • 8. Google Inc. - All Rights Reserved ● 現在は、すべての方がご利用になれます 利用可能な方
  • 9. Google Inc. - All Rights Reserved ● 1つのスクリプトで複数のアカウントを管理可能 ● 1つのスクリプトを複数のアカウントにコピーする必要なし ● 複数のアカウントを並列に処理 利点
  • 10. Google Inc. - All Rights Reserved ● 管理している全てのアカウントの入札単価を調整 ● 複数アカウントのレポートを出力 よくある使い方
  • 11. Google Inc. - All Rights Reserved MCC スクリプトを使ってみる 1 2
  • 12. Google Inc. - All Rights Reserved 使ってみよう
  • 13. Script Google Inc. - All Rights Reserved 初めての MCC スクリプト function main() { // 全ての子アカウントを取得 var accountIterator = MccApp.accounts().get(); // 取得したアカウントを順に処理 while (accountIterator.hasNext()) { var account = accountIterator.next(); // 子アカウントのパフォーマンス データを取得 var stats = account.getStatsFor("THIS_MONTH"); // ログに出力 Logger.log("%s,%s,%s,%s", account.getCustomerId(), stats.getClicks(), stats.getImpressions(), stats.getCost()); } }
  • 14. Google Inc. - All Rights Reserved ● アカウントを管理する機能を提供 ● 子アカウントを取得 ● 操作するアカウントを選択 ● 複数のアカウントを並列に処理 MccApp クラス
  • 15. Google Inc. - All Rights Reserved var accountIterator = MccApp.accounts().get(); ● MccApp.accounts メソッドを使用 ● デフォルトでは、全ての子アカウントを返す(サブMCCは除く) 子アカウントを選択する Script
  • 16. Google Inc. - All Rights Reserved ● アカウント レベルでフィルターすることが可能 子アカウントを選択する var accountIterator = MccApp.accounts() .withCondition('LabelNames CONTAINS "xxx"') .get(); Script
  • 17. Google Inc. - All Rights Reserved ● Customer Id を直接指定することも可能 子アカウントを選択する var accountIterator = MccApp.accounts() .withIds(['123-456-7890', '345-678-9000']) .get(); Script
  • 18. Google Inc. - All Rights Reserved ● デフォルトでは、スクリプトが置かれているアカウント ● MccApp.select を使い、操作対象アカウントを変更 ● AdWordsApp クラスを使いアカウントを操作 ● 最後に操作対象をMCC アカウントへ戻すことを忘れずに! いまどのアカウントを操作している?
  • 19. Script Google Inc. - All Rights Reserved var childAccount = MccApp.accounts().withIds(["918-501-8835"]) .get().next(); // 現在のMCCアカウントを保存 var mccAccount = AdWordsApp.currentAccount(); // 子アカウントを選択 MccApp.select(childAccount); // 子アカウントへの処理を実行 ... // 操作対象を MCC アカウントに戻す MccApp.select(mccAccount); 特定の子アカウントを操作する
  • 20. Google Inc. - All Rights Reserved アカウントを並列に処理する
  • 21. Google Inc. - All Rights Reserved ● AccountSelector.executeInParallel メソッドを使 用 ● 50 アカウントまで並列に処理可能 ● すべての処理終了後、オプションで callback 関数を実行可 能 アカウントを並列に処理する
  • 22. Script Google Inc. - All Rights Reserved function main() { MccApp.accounts().executeInParallel("processAccount"); } function processAccount() { Logger.log("Operating on %s", AdWordsApp.currentAccount().getCustomerId()); // アカウントへの処理を実行 // ... return; } アカウントを並列に処理する
  • 23. Script Google Inc. - All Rights Reserved function main() { MccApp.accounts().executeInParallel("processAccount", "allFinished"); } function processAccount() { ... } function allFinished(results) { ... } Callback 関数を指定
  • 24. Google Inc. - All Rights Reserved ● Callback 関数の results 引数を使用 ● ExecutionResult オブジェクトの配列 ● 1つのアカウント処理につき、1つの ExecutionResult 実行結果を分析する
  • 25. Google Inc. - All Rights Reserved ● ExecutionResult オブジェクトが含む情報 ● CustomerId ● Status (Success, Error, Timeout) ● Error (もしあれば) ● processAccount の返り値 実行結果を分析する
  • 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()); } 実行結果を返す
  • 27. Google Inc. - All Rights Reserved ● 処理関数は string の返り値を返すことができる ● 複雑なオブジェクトを返したい場合には、JSON.stringify / JSON.parse を使用してオブジェクトの serialize / deserialize を行う ● 大きな値を返したい場合には、各種データストレージを使う (E.g. SpreadSheetApp, DriveApp...) 実行結果を返す
  • 28. Google Inc. - All Rights Reserved 実行時間制限 30-X分 processAccount(A) 30分30分 30-X分 processAccount(C) 30-X分 processAccount(B) main() 関数 executeInParallel() をアカウント A, B, C へ実行 allFinished() Xminutes 1時間
  • 29. Google Inc. - All Rights Reserved 参考資料 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
  • 30. Google Inc. - All Rights Reserved Questions?
  • 31. Google Inc. - All Rights Reserved