简体   繁体   English

Google Apps脚本,用于将目标从一个属性复制到另一个属性

[英]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.

相关问题 Google Apps脚本在一个工作表中复制一列,将其转置,然后粘贴到另一个 - Google Apps Script Copying a column in one sheet, transposing it, then pasting to another 使用Apps脚本将非连续单元格从Google表格中的一列复制到另一列 - Copying non-contiguous cells from one column to another in Google Sheets with Apps Script 使用 Apps 脚本将部分内容从 Google Docs 复制到另一个 Doc - Copying a section from Google Docs to another Doc using Apps Script 使用脚本将谷歌电子表格列从一个电子表格复制到另一个电子表格 - Copying google spreadsheet columns from one spreadsheet to another with a script 将身份验证从一个Google Apps脚本网络应用程序传递到另一个Google Apps脚本网络应用程序 - Passing authentication from one Google Apps Script webapp to another Google Apps Script webapp Google Apps脚本将事件从一个日历移动到另一个日历 - Google Apps Script Move Event From One Calendar To Another Google Apps 脚本 - 将一行数据从一个电子表格移动到另一个电子表格 - Google Apps Script - move a row of data from one spreadsheet to another 在 Google Apps 脚本中从另一个电子表格编辑一个电子表格 - Editing one Spreadsheet from another Spreadsheet in Google Apps Script Google Apps脚本:将返回值从一个函数传递给另一个函数 - Google Apps Script: pass return value from one function to another 如何从一个Google Apps脚本拨打电话到另一个的功能? - How to make a call from one Google Apps Script to a function in another?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM