通过API创建谷歌分析代码

通过API创建谷歌分析代码,api,google-analytics,google-api,google-analytics-api,Api,Google Analytics,Google Api,Google Analytics Api,是否有谷歌API通过API创建谷歌分析代码(不去谷歌网站手动创建) 请帮助…使用异步方法加载脚本,您可以通过编程方式将ga.js文件包含在头部。这可以通过不同的方式实现,但这是一种常见的方式: var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-XXXXX-X']);//<------ Set the account number! // Add other values _gaq.push(['_trackPageview']);

是否有谷歌API通过API创建谷歌分析代码(不去谷歌网站手动创建)


请帮助…

使用异步方法加载脚本,您可以通过编程方式将ga.js文件包含在头部。这可以通过不同的方式实现,但这是一种常见的方式:

 var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXX-X']);//<------ Set the account number!

// Add other values
_gaq.push(['_trackPageview']);
_gaq.push(['_setDomainName', 'www.example.com']);
_gaq.push(['_setSiteSpeedSampleRate',5]);

// The the script to the head
(function() {
  var ga = document.createElement('script'); 
  ga.type = 'text/javascript'; 
  ga.async = true;
  ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') +
  '.google-analytics.com/ga.js';
  var s = document.getElementsByTagName('script')[0]; 
  s.parentNode.insertBefore(ga, s);
})();
var _gaq=_gaq | |[];

_gaq推送(['''u setAccount','UA-XXXXX-X'])// 无法通过API创建web属性id。

是只读的。您不能通过它创建帐户或配置文件:

Google Analytics通过管理API为开发人员提供对配置数据的访问,该API是帐户和配置数据的只读API


感谢您提供的信息,但是可以通过API创建web属性ID吗?