Long question short

How to measure in how many sessions the event in category x with label y is fired more than once?

Long question long

When the user clicks on a specific link on my website, I first show him a popup to ask him to confirm his action (in reality the situation is slightly more complex, but for the sake of a short question I won't elaborate on this now). There is also another button that closes the popup and does not confirm his action.

I want to measure how many users click a "close" button more than once per session, because this is the discouraged action and I would like to know if there's something I should do to discourage people from clicking that button (which is only if there are many users that click it more than once per session).

I have found that I can make a segment that includes the "closes popup" event (category "popup" label "close"), but this does not include the number of times it happens per session. I can also count the number of total events, or even number of total unique events per session, but that still doesn't give me the insight I need.

Is there anyone that could help me set this up?

  • Based on best practices as they relate to user experience, my advice is that you make sure that the pop-up can only occur once per session - again, this is based on my limited understanding of the specific circumstances surrounding the link and pop-up. But as I'm sure you know, the only thing that is worse than getting an annoying pop-up during a visit to a website would be to close out the pop-up a second time, or possibly even more based on information provided. Feb 19, 2018 at 13:00
  • The situation is slightly more complex than what I just described just so that you wouldn't have to read through all of it :). In reality the popup only occurs once, sort of as a warning, unless you click the button that I call the "close" button. I know popups are annoying, and therefore they are not displayed with regular website usage, only if you have forgotten to fill in some other settings, which I would like to remind users of, but I want to also give them the option to ignore it (using the close button) and continue using the site until the need to warn them arises again.
    – minitauros
    Feb 19, 2018 at 13:28
  • I sometimes just assign a different event to the second action when I want to tell the difference between people who do it once and people who do it multiple times. Feb 19, 2018 at 14:53
  • Would be awesome if I could achieve the same without doing extra programming :].
    – minitauros
    Feb 19, 2018 at 16:29

4 Answers 4


A Sequence Segment will let you isolate sessions in which your click event occurred at least twice.

After clicking All Users to bring up the segment panel, and then + New Segment to bring up the segment builder, select Sequences under the Advanced options in the left pane. Set Step 1 to your click event, Add Step, and set Step 2 to your click event also.

For the remaining settings, the default values should be correct already: Include Sessions, Sequence Start of "Any user interaction", and Step 1 "is followed by" Step 2 (rather than "is immediately followed by").

I do not believe there's any way to get number of occurrences per session out of GA without essentially having put it into GA in the first place, but Total Events / Sessions will give you an average. If the average is high, segments for "at least 3 occurrences" and "at least 4 occurrences" can help you see whether a high average is due to a lot of people clicking more times ("as least 3" is not much smaller than "at least 2", etc), or a few people clicking a huge number of times ("at least 3" is a lot smaller than "at least 2").


If you are using the javascript confirm method, you can include ajax code there to save the number of times a user is hitting no (and yes if you'd like). If you are using a custom JS popup, you can write it a similar way

var r = confirm("Are you sure you want to leave?");
if (r == true) {
    //whatever you want to do
} else if (r == false) {
    // ajax post to store a "no"


You can track the button click in GA with a data push, or if you have GTM you can set it up as an event on the GTM side. With GA, you can take the above code and do a similar thing:

var r = confirm("Are you sure you want to leave?");
if (r == true) {
    //whatever you want to do
} else if (r == false) {
    // report to GA as a "cancelled" click
    dataLayer.push({'event' : 'eventClickTrigger', 'eventCategory' : 'Page Leave', 'eventAction' : 'Cancelled', 'eventLabel' : 'Page Leave'});

If you have GTM, it may be easier just to track the cancelled button if it has a class or some other identifier.

There is a good walk through here so I wont copy and paste all their stuff: https://mediacause.org/track-button-clicks-google-tag-manager/

  • Thanks, but the question is not about how to implement the popup - that part has been taken care of. The question is about how to track these actions in Google Analytics.
    – minitauros
    Feb 20, 2018 at 9:26
  • Sorry about that, I have updated my answer
    – Zach Voss
    Feb 20, 2018 at 14:32
  • Thanks again! But this is still not the problem ^^. I am already tracking the click. Data is coming in in GA. I just don't know how - inside GA - to get the data out. How can I find out how many users clicked that button more than once in their session?
    – minitauros
    Feb 21, 2018 at 8:00

There are many ways to view this data. Try Going to Google Analytics, Click Behavior, Click Events, which is a subcategory of Behavior.

Now, to segment your data, chose one of the several options available to you within Google Analytics. If you followed my steps, you should be able to answer your question, see image below:

enter image description here

  • Thanks Josh for your reply! I can indeed reproduce what I see in your screenshot, but I can still not find the info that I was looking for. Does it say in how many sessions my specific event was fired more than once?
    – minitauros
    Mar 26, 2018 at 9:28

You can achieve this with Event Flow report in Behavior>Events>Event Flow.

You can even choose the level of detail to label (your requirement).

You can also see the number of sessions or users in each step to determine the drop off from event to event. Event label to Event label in your case

Relevant snippet from Official guide to Event Flow

For example, all Events in the first column of the flow represent any Event that users triggered before other Events. Events in the second column were triggered second, and so on through the report. Events triggered most frequently appear closer to the top of each column and those triggered less often appear towards the bottom.

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.