Display the visitor's city within your popup

Lisa Fockens Updated by Lisa Fockens

We expose your visitors' geolocation within our JS callbacks. You can access the location of your visitors through the object event.detail.location.

This object contains the following properties:

  • continent
  • country
  • region
  • city

Use case: Display the visitor's city within your popup.

You can set the detected visitor's city as a custom property to display a dynamic tag within your popup.

To do so, create a JS callback that listen for the event Before popup display, and set its script to the following snippet:

event.detail.wisepops('properties', {
city: event.detail.location.city

You will now be able to use the {{ city }} tag within your popup:

Inject the Name of the Visitor's Company into Your Popups (with Clearbit)

How to Target (or Exclude) Visitors Who Have Seen a Specific URL