How to Calculate Average Scroll Depth?

早过忘川 提交于 2020-06-29 04:22:20

问题


I am trying to calculate the average scroll depth of a page on a website. In Google Analytics, I have events that fire at milestones of 10% increments—so when a user reaches 10% down the page, 20%, 30%, and so on. I have have a custom metrics for each milestone (so I can track via the metrics or via the events).

My question is: with this information, how to I calculate the average scroll depth of the page? Or in other words, how do I find the average distance a user will scroll down the page?


Example of events data:

Milestone Events 
10%       500
20%       400
30%       475
40%       300 
50%       200 
60%       100
70%       75 
80%       60  
90%       20
100%      10

Example of custom metric data:

Page     10 Scroll  20 Scroll  30 Scroll  40 Scroll  50 Scroll  60  Scroll  70 Scroll  80 Scroll  90 Scroll  100 Scroll
Name     500         400        475       300         200        100          75        60          20          10

回答1:


I was trying to solve this exact same thing. Try multiplying the scrolled threshold by the number of events (10x500) + (20x400) + (30x475) +(40x300) + (50x200) + (60x100) +(70x75) +(80x60) + (90x20) + (100x10)

Then, take that total divided by the total number of events. 500 + 400 + 475... etc.




回答2:


(Edited on request)

Short answer - use this formula:

Avg Scroll Depth = [({{Scroll 25%}} – {{Scroll 50%}}) * 0.25 + ({{Scroll 50%}} – {{Scroll 75%}}) * 0.50 + ({{Scroll 75%}} – {{Scroll 100%}}) * 0.75 + {{Scroll 100%}} * 1)]/{{Pageviews}}

Where {{Scroll 25%}} is the total number of events of 25% scroll, etc. that we set up as the Event Action values (or Event Label, however you did it). If you used increments of 10%, then it'd be 0.1*(10%-20%) + 0.2*(20%-30%) + ... etc.

These numeric fields will have Nulls, so you can define your metric in the Data Studio chart using NARY_MAX(Scroll XX%, 0). I thought it would be clearer and more useful to have each count of Scroll XX% events as unique variables, so I went in the Resource > Manage Added Data Sources and added new fields using this formula for each XX% Event Action value:

COUNT(CASE WHEN REGEXP_MATCH(Event Action, "XX%" ) THEN 1 ELSE 0 END)


Long pedantic answer - here's why:

I found this thread after I watched this video https://www.youtube.com/watch?v=EMJzHycsNy4 and implemented his method 1. Then I saw several users were having the same problem as I was: avg scroll depth over 100%.

On reflection, in Method 1, {{Scroll Depth}} / {{Pageviews}} cannot give a meaningful average scroll depth.

Because we set up the custom metric Scroll Depth as an Event Category that increments by 1 each time the tag fires, {{Scroll Depth}} is just the total number of events triggered by your scroll depth tag. For example, if you have it set to trigger at 25, 50, 75, and 100%, and a user scrolls all the way down on one pageview, it will fire 4 times. So for this single pageview, the "average" will be 4/1 = 400%.

{{Scroll Depth}} / {{Pageviews}} might be useful if you only triggered the scroll depth tag to fire once per page, so you'd have a binary value, 0 or 1, for each pageview. Dividing would then give you the average number of users who made a scroll of any depth vs. those who didn't scroll at all. There is much discussion on whether you should make the scroll an interaction hit or non-interaction hit based on whether you think visitors who are scrolling but not doing anything else on a page should still be counted as a bounce. Different discussion.

A classical average would be the sum of each event times its weight divided by total events, as suggested above and here: Average scroll rate in Google Studio Avg Scroll Depth = ({{Scroll 25%}} * 0.25 + {{Scroll 50%}} * 0.50 + {{Scroll 75%}} * 0.75 + {{Scroll 100%}} * 1) / {{Scroll Depth}} / 100

But that doesn't work here, because each trigger is fired at a threshold, with multiple events per pageview. So for example, for a single user who only scrolls to 25%, that's the only event. But if they scroll to 50%, then you have two events, one at 25% and one at 50%. Summing them classically gives (1 * 0.25 + 1 * 0.50)/2 = 0.375, clearly not right - that would be the average of two pageviews, one at 25% and one at 50%. We want only the max scroll depth for each pageview. On a single pageview, each subsequent event thus negates the previous. So the correct formula would be:

Avg Scroll Depth = [({{Scroll 25%}} – {{Scroll 50%}}) * 0.25 + ({{Scroll 50%}} – {{Scroll 75%}}) * 0.50 + ({{Scroll 75%}} – {{Scroll 100%}}) * 0.75 + {{Scroll 100%}} * 1)]/{{Pageviews}}

So the max depth for one user and one pageview is given by:

  • 1 user scrolling to 25%: (1 – 0) * 0.25 + (0 – 0) * 0.50 + (0 – 0) * 0.75 + 0 * 1 = 0.25
  • 1 user scrolling to 50%: (1 – 1) * 0.25 + (1 – 0) * 0.50 + (0 – 0) * 0.75 + 0 * 1 = 0.5
  • 1 user scrolling to 75%: (1 – 1) * 0.25 + (1 – 1) * 0.50 + (1 – 0) * 0.75 + 0 * 1 = 0.75
  • 1 user scrolling to 100%: (1 – 1) * 0.25 + (1 – 1) * 0.50 + (1 – 1) * 0.75 + 1 * 1 = 1

If you have two users and two pageviews:

  • User 1 scrolls to 50% = 0.5
  • User 2 scrolls to 75% = 0.75

So the average should be (0.5 + 0.75)/2 pageviews = 0.625

Applying the scroll depth formula, summing, and dividing by two works out:

User 1: (1 – 1) * 0.25 + (1 – 0) * 0.50 + (0 – 0) * 0.75 + 0 * 1 = 0.50

User 2: (1 – 1) * 0.25 + (1 – 1) * 0.50 + (1 – 0) * 0.75 + 0 * 1 = 0.75


Both: [(2 – 2) * 0.25 + (2 – 1) * 0.50 + (1 – 0) * 0.75 + 0 * 1 ]/2 page views = 0.625

If you have three users and three pageviews:

  • User 1 scrolls to 50% = 0.5
  • User 2 scrolls to 75% = 0.75
  • User 3 scrolls to 100% = 1

So the average should be (0.5 + 0.75 + 1)/3 pageviews = 0.75

User 1: (1 – 1) * 0.25 + (1 – 0) * 0.50 + (0 – 0) * 0.75 + 0 * 1 = 0.50

User 2: (1 – 1) * 0.25 + (1 – 1) * 0.50 + (1 – 0) * 0.75 + 0 * 1 = 0.75

User 3: (1 – 1) * 0.25 + (1 – 1) * 0.50 + (1 – 1) * 0.75 + 1 * 1 = 1


All: [(3 – 3) * 0.25 + (3 – 2) * 0.50 + (2 – 1) * 0.75 + 1 * 1]/3 = 0.75

Etc. Unfortunately, I couldn't figure out a way to set up a count of particular Event Action numbers in the GA calculated metric. Data Studio gives you a lot more flexibility; there, you can set up one calculated variable for each Event Action using filters, then get the overall avg from them.



来源:https://stackoverflow.com/questions/53561722/how-to-calculate-average-scroll-depth

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!