Set up custom tracking events for popup user activity

1. Copy the Element ID for the popup you want to track.

Go to your website and open the specific popup that you wish to track. Right-click on the popup and click on Inspect Element. Select the top-most container, such as div, and copy the Element ID for the popup.

2. Set up a custom trigger event in Google Tag Manager for each time the popup is displayed.

In Google Tag Manager, create a new Trigger, select Element Visibility under Trigger Configuration, and select ID under Selection method. Enter the popup Element ID you copied earlier into the Elements field under ID.

3. Set up rules for the trigger to fire each time an element appears on screen.

Set Minimum Percent Visible to 50, tick Observe DOM changes, select All Visibility Events, and click Save.

4. Create a new tag with track type set to Event under Google Analytics: Universal Analytics in Google Tag Manager.

Enter PopupView as the Category field and Opened as the Action. Enter a custom value like Services under Label if you want to identify unique pop-ups in your reporting dashboard. Select the custom trigger event you created for the popup under Triggering.