How to write a script that counting conversion action different type

61 views
Skip to first unread message

zhang...@beads.us

unread,
Sep 17, 2018, 3:45:40 AM9/17/18
to AdWords Scripts Forum

I set " sign in"  "purches"  “addCart"  three type conversion action in every campaign,  but I can't  count them through script,   Can this way be implemented?

Hiroyuki Miyauchi (AdWords Scripts Team)

unread,
Sep 17, 2018, 6:58:01 AM9/17/18
to AdWords Scripts Forum
Hello,

You may utilize ConversionCategoryName which returns "Download", "Lead", "Purchase/Sale", "Signup", "View of a key page" and "Other" through the AdWords API reports. You may refer to this sample on how to generate reports in AdWords Scripts. Could you confirm if this is the field you are looking for?

Regards,
Hiroyuki
AdWords Scripts Team

zhang...@beads.us

unread,
Sep 17, 2018, 10:24:53 PM9/17/18
to AdWords Scripts Forum
It's a little complicated, 
  • Can it be implemented with a simple script?


Hiroyuki Miyauchi (AdWords Scripts Team)于2018年9月17日星期一UTC+8下午6时58分01秒写道:
你好,

您可以使用  ConversionCategoryName通过  AdWords API报告  返回  “下载”,“潜在客户”,“购买/销售”,“注册”,“关键页面视图”和“其他” 您可以参考  此示例  ,了解如何在AdWords脚本中生成报告。你能否确认这是否是你想要的领域?

问候,
博之
AdWords脚本小组

在2018年9月17日星期一下午3:45:40 UTC + 8,(未知)写道:

我在每个广告系列中都设置了“登录”“purches”“addCart”三种类型转换操作,但我无法通过脚本来计算它们,这种方式可以实现吗?

Hiroyuki Miyauchi (AdWords Scripts Team)

unread,
Sep 18, 2018, 3:14:24 AM9/18/18
to AdWords Scripts Forum
Hello,

You may utilize the sample code snippet below as your reference. In the script, it fetches ConversionCategoryName using Campaign Performance Report, but you may utilize any other report types shown in this guide to fetch the field.

function main() {

   
var report = AdWordsApp.report('SELECT CampaignId, ConversionCategoryName FROM CAMPAIGN_PERFORMANCE_REPORT', {
        apiVersion
: 'v201806'
   
});
   
var rows = report.rows();
   
while (rows.hasNext()) {
       
var row = rows.next();
       
Logger.log('CampaignId:' + row['CampaignId'] + ', CampaignName:' + row['CampaignName'] + ', ConversionCategoryName:' + row['ConversionCategoryName']);
   
}

}

Please let me know if you have further clarifications.

Regards,
Hiroyuki
AdWords Scripts Team

Reply all
Reply to author
Forward
0 new messages