Classic Analytics到Universal Analytics事件跟踪代码

时间:2021-12-25 14:34:36

I'm going to switch from the Classic Analytics to Universal Analytics.

我将从Classic Analytics切换到Universal Analytics。

As I understand, I need to edit my event tracking code accordingly?

据我了解,我需要相应地编辑我的事件跟踪代码?

My current event tracking code look like this:

我当前的事件跟踪代码如下所示:

_gaq.push(['_trackEvent', 'Contact', 'About us', 'Contact form']);

What do I need to write in order to make it work with Universal Analytics?

我需要编写什么才能使其与Universal Analytics一起使用?

1 个解决方案

#1


The Universal Analytics syntax for tracking Custom Events would be:

用于跟踪自定义事件的Universal Analytics语法将是:

ga('send', 'event', 'Contact', 'About us', 'Contact form');

You can check the official documentation about Custom Events here: https://developers.google.com/analytics/devguides/collection/analyticsjs/events

您可以在此处查看有关自定义活动的官方文档:https://developers.google.com/analytics/devguides/collection/analyticsjs/events

You might also be interested in the official guide to upgrading from the Classic to Universal Analytics: https://developers.google.com/analytics/devguides/collection/upgrade/reference/gajs-analyticsjs

您可能还对从经典分析升级到通用分析的官方指南感兴趣:https://developers.google.com/analytics/devguides/collection/upgrade/reference/gajs-analyticsjs

#1


The Universal Analytics syntax for tracking Custom Events would be:

用于跟踪自定义事件的Universal Analytics语法将是:

ga('send', 'event', 'Contact', 'About us', 'Contact form');

You can check the official documentation about Custom Events here: https://developers.google.com/analytics/devguides/collection/analyticsjs/events

您可以在此处查看有关自定义活动的官方文档:https://developers.google.com/analytics/devguides/collection/analyticsjs/events

You might also be interested in the official guide to upgrading from the Classic to Universal Analytics: https://developers.google.com/analytics/devguides/collection/upgrade/reference/gajs-analyticsjs

您可能还对从经典分析升级到通用分析的官方指南感兴趣:https://developers.google.com/analytics/devguides/collection/upgrade/reference/gajs-analyticsjs