0
我使用下面的代碼來跟蹤我使用JavaScript事件:如何在Google分析中記錄.net事件和例外情況?
(function() {
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', googleAnalyticsAppID, 'auto', { 'cookieDomain': 'none' });
ga('require', 'displayfeatures');
ga('send', 'pageview');
})();
window.onload = function() {
$('.googleAnalytics').click(function() {
var event = this.getAttribute("ga-event");
var category = this.getAttribute("ga-category");
var label = this.getAttribute("ga-label");
gaWeb(category, event, label);
});
};
function gaWeb(category, event, label) {
ga('send', 'event', category, event, label);
}
function gaPageView(page, title) {
ga('send', 'pageview', {
'page': page,
'title': title
});
}
相同的實現,我想在我的C#代碼,在那裏我可以登錄我的谷歌事件,異常的事情。 在.net中是否有任何預建庫可用?
將是有益的。我無法在nuget搜索中找到它們。你能幫助我嗎? – rolls
@rolls GoogleAnalyticsDotNet是包。我也必須尋找它。 –
並確保將' '添加到您的配置中,否則它將不起作用。 –