I am trying to create a widget to count number of users who have visited the site more 3 or more times within the time range.

I can easily do this when setting up a segment:

Setting up segment

Note that the tooltip that appears for the question mark next to "Sessions" label defines it as "Total number of Sessions within the date range. A session is the period time a user is actively engaged with your website, app, etc. All usage data (Screen Views, Events, Ecommerce, etc.) is associated with a session."

However, when creating a widget, I cannot find the option to define such a filter. The closest I can find is "Count of sessions", but there is not an arithmetic copmarison operator (it is because Count of sessions is a string dimension),so I have to match it with this regex: (^[3-9]$)|(^[0-9]{2,3}$):

Setting up widget

And the results are very different from the segment:

Widget result

Note 78.32% in widget vs 17.12% in segment.

Question: Is there a way to filter the users by the number of sessions within the time range in a dashboard widget?

1 Answer 1


Count of Sessions as you mentioned is a dimension not a metrics as we may expect it to be, it is incremented in the cookie with each session and is passed in GA as such. To elaborate :

Suppose we have 3 users, following is their visit log :

User A - Visit's 1st time | Count Of Session =1 
User A - Visit's 2nd time | Count Of Session =2 
User A - Visit's 3rd time | Count Of Session =3
User B - Visit's 1st time | Count Of Session =1
User B - Visit's 2nd time | Count Of Session =2
User C - Visit's 1st time | Count Of Session =1

Now if we make a report of Users group by Count Of Sessions, we may have something like this :

Count Of Sessions |  Users
    1             |    3 
    2             |    2 
    3             |    1 

For your problem it would be difficult to present this in a single value, data would make more sense if you could show a tabular view, I've tried to address your case with following widget :

enter image description here

It's important to note that the number of users you see against the Count Of Sessions is not exclusive, to have the exclusive users against each Count Of Sessions we could simply :

Users having n only sessions = (Users with n Count Of Sessions - Users with (n+1) Count Of Sessions

enter image description here

So, Users having only 3 sessions would be 1,062,191 (3,962,517 - 2,900,326)

  • Thanks! The exact regexp should be (^1$)|(^2$) (so we don't exclude values such as 10, 11, 21...)
    – pau.moreno
    Commented Oct 20, 2016 at 11:51
  • Do you know if this count of sessions dimesion is within the selected date range?
    – pau.moreno
    Commented Oct 20, 2016 at 11:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.