How to track WordPress lightbox events with Google Analytics

Product:

Wonder Lightbox

Tutorial:

Wonder Lightbox is a WordPress plugin to open images, videos, PDF files, HTML contents in a lightbox popup. This tutorial will guide you how to track the lightbox open events with Google Analytics.

There are 2 steps in this tutorial:

  • Step 1 - Add Google Analytics Tracking ID to Wonder Lightbox
  • Step 2 - View WordPress lightbox events in Google Analytics

Step 1 - Add Google Analytics Tracking ID to Wonder Lightbox

Google Analytics tracking ID has a format like UA-XXXXXXXX-1. Please view the following tutorial to find your Google Analytics tracking ID: https://support.google.com/analytics/answer/1032385?hl=en.

To add the Google Analytics ID to Wonder Lightbox, in your WordPress dashboard, go to the left menu Wonder Lightbox -> Lightbox Options, click the Advanced Options tab, then add the following code to the Data Options input box:

data-googleanalyticsaccount="UA-XXXXXXXX-1"

Step 2 - View WordPress lightbox events in Google Analytics

To view the logged WordPress lightbox events, in your Google Analytics dashboard, click the left menu Behaviour -> Events -> Top Events. The event category is Lightbox. The analytics data processing is not real time. It may take several days for the events to appear in your Google Analytics dashboard.

google analytics top events