Tracking Pop-Ups With Events in Google Analytics

popup tracking in google analytics

popup tracking in google analyticsOne of the beautiful things about Google Analytics is that you can track just about anything on your website. Recently, we helped a blog implement some custom tracking for their pop-ups. I know what you’re thinking… why pop-ups!? Pop ups are evil! Yes, I know. But for their business , it makes sense and regardless how much I try to convince them that pop-ups are annoying, they’re still going to keep it on their blog.

So, the next question was; what do we want to track? There are four actions we want to know about:

  1. Loading ; how often did the pop-up load on the blog, in a particular period of time?
  2. Closing ; how many people closed the pop-up using the X in the upper right hand corner?
  3. Already a subscriber ; we placed a link below the CTA that says “I’m already a subscriber” to tell us never to show the pop-up to them again (cookie-based tracking)
  4. Sign-up ; how many sign-ups to the newsletter did we get from pop-ups?

In this example, we’re working with a blog that receives approximately 7M sessions a month. The next step would be to figure out how we’d want this data to show up in Google Analytics. Here’s how we did it (you’ll probably need a developer to help you with this, but here’s how you would structure your events):

ga(‘send’, ‘event’, ‘pop up’, ‘load’, ‘[current page url]’);
ga(‘send’, ‘event’, ‘pop up’, ‘close window’, ‘[current page url]’);
ga(‘send’, ‘event’, ‘pop up’, ‘already subscribed’, ‘[current page url]’);
ga(‘send’, ‘event’, ‘pop up’, ‘subscribe’, ‘[current page url]’);

So what are we looking at here? Firstly, we’re using event tracking under the new Universal Analytics commands. Our event breaks out into this:

category = pop up
action = load, close window, already subscribed, subscribe
label = the page where the action took place

After we implemented this on both the desktop and mobile version of the website, we used the Real-time report in Google Analytics to test and see how our data was coming in. Here’s a few things you can look at:

google analytics events pop up dashboard

You’ll want to drill in to your ‘pop up’ category so you only see the actions and labels for what we just implemented. After that, you’ll see the breakdown of your traffic by desktop, mobile and tablet users. There’s a lot of neat things you can do now in this report. If you’re interested in only seeing “already subscribed” actions, then you click on that and next to it are the pages where users clicked “already subscribed”.

google analytics pop up tracking already subscribed

Another thing you can do, is if you’re running a campaign for a page, click on the page url under Event Label and you’ll see the distribution of load, close, already subscribed and new subscribes.

google analytics events pop up single

Neat huh! At the end of the day, or the next day, you can go back into your Events report and pull all your pop up data and determine which pages drove more subscribes. Here’s how you report may look like:

google analytics pop up data

 Above, you’ll find a breakdown of all your Actions under the pop up Category.

google analytics pop up data label

Click on subscribe, and you’ll get all the pages where your new visitors subscribed via your pop up! Gold!

Finally, the last step you’d want to do after you’ve set up the technical part of tracking these actions is to set up a Goal in Google Analytics to measure conversions. Here, we’re most concerned about people subscribing, so in order to create a Goal in Google Analytics we would do the following:

pop up goal

Now you’re done!

What can you learn from all this data? Well, you can ask yourself these questions when looking at your data:

  • Which pages are driving the more subscribers?
  • Do some “types” of content drive more subscribers than others?
  • Is there related content I can publish and promote more of so I can get new visitors to my site and subscribing via my pop up?

If your site is like this one, where mobile traffic has already exceed desktop, perhaps you’ll want to drill in and see where mobile visitors are converting compared to desktop. I’ll let you dive into that one yourself 🙂

Closing Thoughts

There are endless possibilities with Google Analytics event tracking. Hopefully this post opened your eyes into new ideas on where you can include additional tracking around your website. If you’ve got any feedback on our approach, we’d love to hear from you in the comments below.

If you’re looking for some help to implement this type of custom tracking for pop-ups, connect with us and we’ll work with you to get it up!.

6 thoughts on “Tracking Pop-Ups With Events in Google Analytics”

  1. Hi Jackson,

    Great article.

    We have a pop up on our website. It’s purpose is to funnel customers to a blow out sale on a product we are trying to unload.

    I set up a goal in GA with a destination url unique to the popup:

    Is this the correct way to implement this? It appears that either A – no one is clicking on the pop up or B – Google doesn’t register my reference #promopopup

    We are using WordPress 4.1 with the latest Woocommerce Plugin



    1. Hey Michael – it would probably be best to check your real-time Events report after you’ve pushed this new code to the live site and test it that way. If the data shows that the events are triggered, then it should be good. Otherwise, I would double check your configuration. Hope that helps.

Leave a Reply

Your email address will not be published. Required fields are marked *