目前有 110 位成員在線上
目前有 110 位成員在線上
AdWords 廣告精選學習資源
star_border

Adwords Script - 帳戶品質分數每日報表分享 (Account QS Change Trend)

新接觸的先參考PART 1: Adwords Script 介紹 - 誰都懂的半API的帳戶自動化及新式報表

--------------------------------------------------------------------------------------------------------------------------------------

 

 

Account QS.jpg

 

帳戶品質分數每日報表能給我們甚麼新角度?

系統只能提供現時的QS, 這報表能追蹤QS的改變

 

為甚麼不是單字的QS?

帳戶是有本身的QS, 它是一個很有用的監測方法知道Google認為你的帳戶有多好, 它並非跟踪每個關鍵字的QS, 因為帳戶優化是包括把關鍵字移去另一個campaign等, 如果想知道優化的方向做得好不好, 這是個很好的監測報表

參考: How Account Quality Score Can Guide AdWords Optimization

 

甚麼action point?

如上圖我們有了時間, QS, 加上自己落的Remark, 就知道當我加了新推廣後, 其實帳戶的表現較差了

或者當我們執行了大型優化後, 這報表也能反映它的成功與否

P.S. 帳戶QS的計法會參考曝光比例, 所以請了解下面的coding才可更準確的幫到你的case

 

 

 

ADWORDS SCRIPT:

我保留了原創者的註解, 我的註解會用中文

留意紅色的是要轉為的自己的

--------------------------------------------------------------------------------------------------------------------------------------

 

function main() {
var time = "LAST_30_DAYS" //"ALL_TIME"; 利用前30日的數據, 可按你要求改變
var minImpressionsForKeyword = 20; // 關鍵字最少20曝光才計算
var maxCampaigns = 50;
var campaignNameContains = "CP"; // 可選指定計算的campaign名包含字串

Logger.log("Quality Score Report provided by Top Tier Marketing.");
Logger.log("----------------------------------------------");
Logger.log("Settings:");
Logger.log(" Date range: " + time);
Logger.log(" Up to " + maxCampaigns + " campaigns whose name includes: '" + campaignNameContains + "'"); // 可選指定計算的campaign名包含字串
Logger.log(" Keywords with at least " + minImpressionsForKeyword + " impressions");

var campaignIterator = AdWordsApp.campaigns()
.forDateRange(time)
.withCondition("Status = ENABLED")
.withCondition("Name CONTAINS_IGNORE_CASE '" + campaignNameContains + "'")
.orderBy("Name DESC")
.withLimit(maxCampaigns)
.get();

var impressions = 0;
var totalImpressions = 0;
var totalQS = 0;

//Now I start to step through all the campaigns that matched my criteria using the pre-built function from google: next()
while(campaignIterator.hasNext()) {
var campaign = campaignIterator.next();

//For each of the campaigns I encounter in the script, I want to know how many impressions it got so I need to create an object that contains
//all the stats for a campaign. Luckily Google made a function available that handles this, it's called getStatsFor(time).
//I can use this same function on campaigns or ad groups so that makes it easier to remember.
var campaignStats = campaign.getStatsFor(time);

//Now I can access the object that contains the stats and use pre-built functions to get the specific metrics I want,
//like impressions with getImpressions(). Just to make sure the script works as expected,
//I also send the campaign name and its impressions to the log where I can see it as the script is running.
var campaignName = campaign.getName();
impressions = campaignStats.getImpressions();

//totalImpressions += campaignStats.getImpressions();
Logger.log(campaignName + ": " + impressions + " impressions");

//Now I use the built-in function to get all the ad groups for a campaign. Just like I did for the campaign,
//I can specify some additional criteria, for example, I only want enabled ad groups that have at least a certain amount of impressions for my specified time range.

var conditionText = "Impressions >" + minImpressionsForKeyword;
var campaignAdGroupIterator = campaign.adGroups()
.withCondition("Status = ENABLED")
.withCondition(conditionText)
.forDateRange(time)
.get();

//Now I step through each of the ad groups that matched my criteria and I get their stats like cost and impressions.

while(campaignAdGroupIterator.hasNext()) {
var adGroup = campaignAdGroupIterator.next();
var adGroupName = adGroup.getName();
var adGroupStats = adGroup.getStatsFor(time);
var adGroupImpressions = adGroupStats.getImpressions();
var adGroupCost = adGroupStats.getCost();

//And now I want to go down to the keyword level because that's where the quality score is.
//So I again use a built-in function from Google to get all the keywords that belong to a specific ad group.

var adGroupKeywordIterator = adGroup.keywords()
.withCondition("Status = ENABLED")
.withCondition(conditionText)
.forDateRange(time)
.orderBy("Impressions DESC")
.get();//Logger.log("Quality Score");
while (adGroupKeywordIterator.hasNext()) {

//Get the stats for every keyword...
// Get the keyword stats
var keyword = adGroupKeywordIterator.next();
var keywordStats = keyword.getStatsFor(time);
var keywordImpressions = keywordStats.getImpressions();
var keywordQS = keyword.getQualityScore();
var keywordName = keyword.getText();

//This is really the only part of the script that does something that I had to figure out, how to convert the keyword-level quality score into an account level quality score.
//The way I like to do this is to make an impression weighted QS. It simply means that the QS of a high impression keyword is more important than the QS of a low impression keyword.
//At the end of the script, I will also need to know how many total impressions I used for my calculations so I keep a running total of this in a variable I named totalImpressions.

var QSContribution = keywordQS * keywordImpressions;
totalQS += QSContribution;totalImpressions += keywordImpressions;}
}
}

//Now I calculate the account level quality score by dividing the impression weighted QS I've been calculating
//as the script went through each keyword and dividing it by the total impressions. Then I use the Logger function to output this to my screen so I can see the number.

var acctQS = totalQS / totalImpressions;
Logger.log("Total Account Quality Score: " + acctQS.toFixed(2));


//Because I don't want to log into my account every day to go look at the results of the script, I email it to myself. Luckily there's a built-in function for that too: MailApp.sendEmail()

var date = new Date();
var spreadsheetUrl = "https://docs.google.com/spreadsheet/ccc?key=0Ahntcoqpd7CbdVvWAWETGBRThetdryNkVxaGtvWGc&usp=sharing"; // 將資料放入google doc, 自己先開一個spreadsheet的文件, 文件權限要放給adwords login
// var qualityScoreSheet = SpreadsheetApp.openByUrl(spreadsheetUrl).getActiveSheet();
var qualityScoreSheet = SpreadsheetApp.openByUrl(spreadsheetUrl).getSheetByName('Sheet1'); // 放入sheet1
qualityScoreSheet.appendRow(["Ebey", date, acctQS]); // 在google doc上只放這3項數據, 每次的加上去
var recipient = "stampedehello@gmail.com";var subject = "Ebey Quality Score Report Finished"; // 完成後發去那個email及設定email名
var body = "The quality score report has finished running.\nAccount QS: " + acctQS;
MailApp.sendEmail(recipient, subject, body);}

簡介 Stampede Tong

自2007年以來,我一直從事在Adwords和網絡廣告代理。由於與Google的分銷商計劃,它讓我在領先的地位學習Adwords和了解最新的功能。我想給予更多實用的解決方案給使用者,因為經驗實踐跟理論一樣的重要。在社群交流幫助也是一種樂趣,因為它總是給你不止是一個答案,還有靈感!

評論
修訂者 Xwolf
‎2013-08-12 24:17
赞!
修訂者 丁子寶
‎2013-08-12 12:53 - 已編輯 ‎2013-08-12 18:08

赞!
另外 var campaignNameContains = "CP"; -- 这里的CP是不是也该标红色?因为也是要替换成自己的,标识自己想观察的系列名字。

var spreadsheetUrl = "https://docs.google.com/spreadsheet/ccc?key=0Ahntcoqpd7CbdVvWAWETGBRThetdryNkVxaGtvWGc&usp=sharing"; // 將資料放入google doc, 自己先開一個spreadsheet的文件, 文件權限要放給adwords login

--- 这里也是先要在Google Doc 建一个文件,然后把自动创建的Share URL替换成上面的

修訂者 社群站長 Julie 社群站長
‎2013-08-12 14:48

谢谢 Stampede 的分享!

修訂者 解答王 Stampede 解答王
‎2013-08-12 16:59

謝謝! 已修正

var campaignNameContains = "CP"; // 可選指定計算的campaign名包含字串

 

對, link也是紅色... 但我轉不了...

我的做法是在我私人的google doc開一個spreadsheet, 之後放權(只要有url的都可以改)

那我只要登入我的帳戶就能看到各客戶的報表

修訂者 Edwinpan
‎2013-08-15 04:06

這超棒的!!! 真的是太贊了

 

var campaignNameContains = "CP"; // 可選指定計算的campaign名包含字串

 

如果不指定就可以看全部了。

 

如果有五個帳戶也可以指定不同的Sheet 來一起管理

修訂者 丁子寶
‎2013-08-15 09:41

官方渠道也有不少基礎的adwords scripts可以了解和學習,有興趣的都可以去參考

 

https://developers.google.com/adwords/scripts/

 

https://developers.google.com/adwords/scripts/community/

 

修訂者 解答王 Stampede 解答王
‎2013-08-15 09:58

Hi Edwinpan

 

如果不指定, 請試試把那句改為

var campaignNameContains = "";

 

Hi 子寶

 

對的呢, 網上也有不同的script可參考, 就算是同一目的, 也有不同款式

我這款是可以log入google doc及email提醒

修訂者 Ken K
‎2013-08-30 11:24

非常好用,設定個schedule,每天定時看看。
謝謝分享