定时器直到事件发生
Timer until Event Occurs
有没有办法跟踪从 "Window Loaded" 事件发生到单击页面上的按钮的时间?
我尝试了几种不同的方法,比如设置一个定时器,它只会在 "Click Text" 为 "Download" 时触发,但不会阻止定时器触发器每秒触发一次。我永远无法在事件或按钮点击时停止计时器。
布莱恩
我从 Simo 那里找到了关于如何做到这一点的答案:
https://productforums.google.com/d/msg/tag-manager/xJ0RGC2wecY/rxmrJRklAgAJ
When you create a Universal Analytics tag, you need to add in all the required fields. Now you don't have any fields populated in your Timing hit so GA can't build any hit out of it.
You need to fill at least Category, Variable and Value fields: https://developers.google.com/analytics/devguides/collection/analyticsjs/user-timings
But judging from the bit you wrote at the end of your latest response, I think you've kind of misunderstood how the timer trigger works.
The timer trigger STARTS a timer upon the page load (GTM's default timer) or any user interaction (my custom timer). You still need to specify a "stop" to the timer to calculate how long something took. Neither GTM's default timer or my timer trigger can help you in identifying how long something took. They can simply be used to measure IF something took X seconds, where X seconds is the interlap between "interval" and "limit".
If you want to know the number of milliseconds from when the page was first loaded in the browser to any interaction such as a click of a button, all you need is a Custom JS variable:
function() {
return window.performance && window.performance.timing ? (new Date().getTime())-window.performance.timing.domInteractive : undefined;
}
This variable would return the time delta in milliseconds between when the variable was invoked and when the current page first became available to the user. So if you want to create a Timing tag out of this, make the Timing tag fire on the click of the button, and then in the timing Value field add a reference to this variable. Thus you'll have a Timing tag that sends the duration it took for user to land on the page and then click the button.
Simo
有没有办法跟踪从 "Window Loaded" 事件发生到单击页面上的按钮的时间?
我尝试了几种不同的方法,比如设置一个定时器,它只会在 "Click Text" 为 "Download" 时触发,但不会阻止定时器触发器每秒触发一次。我永远无法在事件或按钮点击时停止计时器。
布莱恩
我从 Simo 那里找到了关于如何做到这一点的答案:
https://productforums.google.com/d/msg/tag-manager/xJ0RGC2wecY/rxmrJRklAgAJ
When you create a Universal Analytics tag, you need to add in all the required fields. Now you don't have any fields populated in your Timing hit so GA can't build any hit out of it.
You need to fill at least Category, Variable and Value fields: https://developers.google.com/analytics/devguides/collection/analyticsjs/user-timings
But judging from the bit you wrote at the end of your latest response, I think you've kind of misunderstood how the timer trigger works.
The timer trigger STARTS a timer upon the page load (GTM's default timer) or any user interaction (my custom timer). You still need to specify a "stop" to the timer to calculate how long something took. Neither GTM's default timer or my timer trigger can help you in identifying how long something took. They can simply be used to measure IF something took X seconds, where X seconds is the interlap between "interval" and "limit".
If you want to know the number of milliseconds from when the page was first loaded in the browser to any interaction such as a click of a button, all you need is a Custom JS variable:
function() { return window.performance && window.performance.timing ? (new Date().getTime())-window.performance.timing.domInteractive : undefined; }
This variable would return the time delta in milliseconds between when the variable was invoked and when the current page first became available to the user. So if you want to create a Timing tag out of this, make the Timing tag fire on the click of the button, and then in the timing Value field add a reference to this variable. Thus you'll have a Timing tag that sends the duration it took for user to land on the page and then click the button.
Simo