[英]Google Apps Script for copying Goals from one property to another
I am trying to copy the views from one property to another in Google analytics.When i try to copy Goals its throwing an error. 我试图在Google Analytics(分析)中将视图从一个属性复制到另一个属性。当我尝试复制Goals时,抛出一个错误。
for (var j = 0; j < profiles_src.items.length; j++) {
var profile_src = profiles_src.items[j];
var profile_dest=Analytics.Management.Profiles.insert(profile_src, accountId_dest, webPropertyId_dest);
sheet.getRange(row, 10).setValue(profile_dest.name);
sheet.getRange(row, 11).setValue(profile_dest.id);
var filter_src=Analytics.Management.ProfileFilterLinks.list(accountId_src, webPropertyId_src, profile_src.id)
//var goal_item=goal_src.items[0];
sheet.getRange(23, 2).setValue(filter_src);
var filter_dest = Analytics.Management.ProfileFilterLinks.insert(filter_src.items[0], accountId_dest, webPropertyId_dest, profile_dest.id);
row++;
}
Put some: 放一些:
Logger.log("The value of my variable is: " + aVariableName);
Statements into your code, then VIEW the LOG to see what is happening. 将语句放入您的代码中,然后查看日志以查看发生了什么。 You can also step through the code line by line.
您也可以逐行浏览代码。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.