Is there any way for Google Analytics to track multiple event parameters like Mixpanel?

后端 未结 4 961
[愿得一人]
[愿得一人] 2020-12-31 14:14

Given:

_trackEvent(category, action, opt_label, opt_value, opt_noninteraction)

I tried with opt_label but it seems like it\'s just a string

4条回答
  •  忘掉有多难
    2020-12-31 14:25

    I'm not sure what mixpanel is, so I'm unaware of what you're trying to compare analytics to. If you provided a specific example of the data you're trying to collect, I could provide you with a better answer.

    Lets say you have a video player and you want to track how long people watch the video and how many times people paused the video, you would do something like this;

    if (video == "pause") {
       var playTime = playduration(), // Total minutes of video watched
           clickPause = pauseNum(); // Total number of times video was paused
    
       _gaq.push(['_trackEvent', 'Video', 'Play', playTime]);
       _gaq.push(['_trackEvent', 'Video', 'Pause', clickPause]);
    }
    

    Obviously this is generic, but as you can see in the _gaq.push arrays, Play and Pause are the parameters and playTime and clickPause are the variable values of the parameters.

提交回复
热议问题