Geo-targeting

WonderPush lets you target users based on their location

Geo-targeting is a powerful way to reach out to your subscribers. WonderPush lets you send push notifications to your subscribers based on:

  • their country or city, based on their IP address, as returned by GeoJS,
  • their geographic coordinates (latitude and longitude) as provided by their mobile phone or web browser.

Geo-targeting based on the subscriber's IP address

📘

Geo-targeting based on IP address is only available for websites. Mobile applications can achieve the same, but it's the developer's responsibility to call GeoJS (or any other service) and fill Properties.

WonderPush does not provide IP geolocation, but WonderPush lets you easily add GeoJS to your website for IP geolocation. Here's how it works:

  1. The subscriber visits your website
  2. WonderPush determines that his location is needed because it's missing or older than 1 hour
  3. The subscriber's web browser makes an AJAX call to https://get.geojs.io/v1/ip/geo.json that returns geolocation information based on the subscriber's IP address
  4. The WonderPush Javascript SDK sets the following properties on the subscriber:
  • string_city: the city name in English
  • string_country: the country name in English
  • string_country_code: 2 letter ISO 3166 country code
  • string_country_code3: 3 letter country code.
  • string_region: the region name in English.

You can then create Segments based on these four Properties and reach subscribers based on their city or country.

To include the city and country names directly in your messages, see Personalized content.

Adding IP-based geo-targeting to your site

Adding IP-based geo-targeting to your site is easy, just head over to the Web Plugins section of your dashboard settings and activate the IP-geolocation plugin.

1506

Geo-targeting based on geographic coordinates

Both mobile devices and web browsers can collect their users's geographic coordinates. If your app or website collects user location through the browser or mobile device, so does WonderPush. This works slightly differently between websites and mobile applications.

Mobile applications

Mobile application developers who wish to target their users in WonderPush based on their location need to perform all of these steps:

  1. prompt users for the permission to use their location
  2. enable the collection of location information.

There is extensive documentation on how to do this in iOS and Android.

Once you've set up your app to collect location, WonderPush automatically lets you target mobile users based on that information.

Websites

Web developers who wish to target their users in WonderPush based on their location need to either:

Once location information is collected, targeting users based on their location is easy and can be achieved by creating a segment.

Geo-targeting based on mobile geofence trigger

A geofence is a custom geographical region that you specify. Triggering your push notification by geofence means your user will receive the notification the moment they enter (or exit) a geofence region, even if the application is not launched.

  1. Follow this guide to set up Geofencing on iOS and this one for Geofencing on Android
  2. When a Geofence is triggered, use the WonderPush trackEvent method
    For example: WonderPush.trackEvent("Enter the Stadium")
  3. Go to your dashboard and create a notification scheduled When a subscriber becomes part of the audience:
1188 1189