Skip to main content

Display the visitor's city within your popup

Updated over 10 months ago

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:

Did this answer your question?