Skip to main content
All CollectionsIntegrationsCMS IntegrationsGoogle Tag Manager
Use Google Tag Manager Variables as Custom Properties
Use Google Tag Manager Variables as Custom Properties

This guide explains how to integrate your existing Google Tag Manager (GTM) variables with Wisepops to create more targeted popup campaigns.

Updated this week

Prerequisites

  • An active Wisepops account

  • Google Tag Manager implemented on your website

  • GTM variables already configured

Need help setting up GTM variables? Consider reaching out to Braidr, a marketing technology agency specializing in marketing data implementation.

Implementation Steps

1. Add Custom Properties Code

Place this code snippet immediately after your Wisepops setup code in Google Tag Manager:

// Send custom properties
wisepops('properties', {
VariableNameForWisepops: {{VariableNameOfGTM}}
}, {temporary: true});

Important: Replace {{variableNameOfGTM}} with your actual GTM variable name.

2. Configure Tag Trigger

Set your Wisepops trigger to "DOM Ready" instead of "Page View" to ensure variables are properly loaded.


Example: Targeting Non-Subscribers

Let's say you want to show popups only to users who haven't subscribed to your newsletter:

// Send custom properties 
wisepops('properties', {
subscribed: {{subscribed}}
}, {temporary: true});

You can then create a custom condition in Wisepops to display campaigns only to users where subscribed = false.


Using Multiple Properties

To use multiple GTM variables, separate them with commas:

// Send custom properties 
wisepops('properties', {
subscribed: {{subscribed}},
country: {{country}},
age: {{age}}
}, {temporary: true});

Troubleshooting

If your custom properties aren't working as expected, verify the GTM variables are available to Wisepops:

  1. Enable GTM Preview mode


  2. Visit your website where the custom properties should be active

  3. Check fired tags - Verify the tag setting custom properties appears in the list

  4. Inspect tag firing sequence - Note when your tag fires (e.g., "3 DOM Ready")

  5. Verify variable values - Select the appropriate message in the left column, open the "Variables" tab, and locate your GTM variable

If your variable shows as undefined, it may be defined too late in the page load sequence. Ensure your variable is defined before the Wisepops custom properties tag fires.

Did this answer your question?