这是我的要求:将Google Analytics分析报告数据(包括自定义维度和指标)导入sql server。
为此,我创建了ssis包,并整合了“SSIS Google Analytics source”。(参考:http://analyticssource.codeplex.com/)
在Google Analytics源代码中,我仅获得了某些维度(ga:UserType, ga:city
等)和指标(ga:pagetittle, ga:users
等)的预览。
但是,如果我选择任何指标以“%”开头,例如“%New Sessions”或“Avg”,例如“平均页面时间”,则显示错误如下:
System.ArgumentNullException: 'dataType' argument cannot be null.
Parameter name: dataType
at System.Data.DataColumn..ctor(String columnName, Type dataType, String expr, MappingType type)
at System.Data.DataColumn..ctor(String columnName, Type dataType)
at SSISComponents.DataTypes.GaDataToDataTable(GaData googleData)
at SSISComponents.FrmGoogleAnalyticsSource.btnQuery_Click(Object sender, EventArgs e).
我根据analytics.google.com中生成的报告选择了维度和指标。
如何解决此错误以及如何使用SSIS获取所有报告数据(包括自定义维度的analytics.google.com中显示的维度和指标)。