简体   繁体   English

使用Google Analytics(分析),是否可以使用API​​(以编程方式)创建自定义维度

[英]Using Google analytics, Is it possible to create Custom dimension using API (programatically)

I am working on a SaaS application, where I let user(s) to use their own google analytics account for tracking their site. 我正在开发一个SaaS应用程序,我可以让用户使用他们自己的Google Analytics(分析)帐户来跟踪其网站。

While tracking, I also wants to take benefit of custom dimensions. 在跟踪时,我还想利用自定义维度。 It is not possible to telling/educating each client( most of them are non-technical ) about " how to create custom dimension/metric using Google Analytic Interface ". 无法告知/教育每个客户( 他们中的大多数都是非技术性的 )“ 如何使用Google Analytic Interface创建自定义维度/指标 ”。

Is there any way, that I can create custom dimension using code. 有什么办法可以使用代码创建自定义维度。 something like 就像是

ga('<command>','<dimension name>', '<index>', '<scope>')  

You can create Custom Dimensions in the Google Analytics Management API, see: https://developers.google.com/analytics/devguides/config/mgmt/v3/mgmtReference/management/customDimensions/insert 您可以在Google Analytics Management API中创建自定义维度,请参阅: https : //developers.google.com/analytics/devguides/config/mgmt/v3/mgmtReference/management/customDimensions/insert

There is some example code for working with the api here: https://github.com/google/google-api-java-client-samples/tree/master/analytics-cmdline-sample 这里有一些使用api的示例代码: https : //github.com/google/google-api-java-client-samples/tree/master/analytics-cmdline-sample

Good luck :) 祝好运 :)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM