# Google analytics: how many visitors have visited n times?

I'm trying to guess how many loyal users I have by counting the number of people that have visited the site 10 times. How can I answer this question with Google Analytics?

"Visitor Loyalty" is a tempting answer, but the label for loyalty is "Visits that were the visitor's nth visit," and I want something more like "Visitors that visited n times."

For example, we have 40 visits in the "51-100" visit range, but I think that could be a single user who visited 91 times. Or two users who visited 71 times each. The whole chart makes a good logic puzzle (I wonder if there's a unique solution) but doesn't easily answer the question I have.

## migrated from stackoverflow.comMar 4 '11 at 15:59

This question came from our site for professional and enthusiast programmers.

You can build a custom report using the "Count of Visits" dimension and "Unique Visitor" metric to get the answer you want.

However, remember that each time someone visits they add an additional count to the "Count of Visits" dimension without being removed from the previous ones. So each group is a subset of the one above it. For example, if you have two visitors, one who visits 2 times and another who visits 3 times the report will be as follows:

--------------------------------------
| Count of Visits  | Unique Visitors |
--------------------------------------
| 1                | 2               |
| 2                | 2               |
| 3                | 1               |
--------------------------------------


You can set a cookie that acts as a counter. Increment it only on first page of the visit. Then send the current value (after the increment) in a custom variable, to also only be triggered on first page of visit. Then in the reports you can see how many hits to #n there are from custom variable report.

• Good idea - I think this would produce the same result as @Ewan's solution. – Riley Mar 5 '11 at 14:02

I think 40 visits in the 51-100 visit range means you're had 40 different (unique) visitors who have visited between 51 and 100 times. 9-14 is probably as close as you're going to get to 10. There ya go, clear as mud.

• I'm pretty sure that the 40 is a count of visits, not visitors. – Riley Mar 5 '11 at 14:03
• @Riley: it's the same thing, really. If there have been 40 "tenth visits", it stands to reason that there are 40 people who have visited ten times. If someone has visited eleven times, they would be counted in the "eleven visits" range. – boot13 Mar 6 '11 at 4:48
• But a 52nd, 53rd, and 54th visit are all 51-100th visits, and so are counted as three, even though they are all from the same visitor. Given three 51-100th visits, you cannot tell how many people have visited 51 times. – Riley Mar 6 '11 at 13:46
• @Riley: If I've visited 54 times, I'm counted once in the 51-100th visits range. Given three 51-100th visits, I can tell you that three different people have visited between 51 and 100 times. I can't tell you how many have visited exactly 51 times, but I find the ranges provided are good enough. – boot13 Mar 6 '11 at 14:11
• @Riley: If Visitor Loyalty worked the way you think it works, then the count for the ranges from 1 to 10 would always go down as the range goes up (which is what you will see with Ewan's solution). But that doesn't happen with Visitor Loyalty, which really is giving you what you want, unless it's important to you to have separate counts for every positive integer (which for popular sites becomes unwieldy immediately). – boot13 Mar 6 '11 at 14:27

The Count of Visits Analytics help page suggests that "count of visits" is more like "count of visitors".

If my reading of it is correct, each visitor will only be counted once in each range, and visits prior to the date range will be counted despite being outside the date range.