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 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:
- The subscriber visits your website
- WonderPush determines that his location is needed because it's missing or older than 1 hour
- The subscriber's web browser makes an AJAX call to
https://get.geojs.io/v1/ip/geo.jsonthat returns geolocation information based on the subscriber's IP address
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.
To include the city and country names directly in your messages, see Personalized content.
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.
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 application developers who wish to target their users in WonderPush based on their location need to perform all of these steps:
- prompt users for the permission to use their location
- enable the collection of location information.
Once you've set up your app to collect location, WonderPush automatically lets you target mobile users based on that information.
Web developers who wish to target their users in WonderPush based on their location need to either:
- prompt users for the permission to use their location using the native Geolocation API
- have WonderPush prompt users for the permission by calling
Once location information is collected, targeting users based on their location is easy and can be achieved by creating a segment.
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.
- Follow this guide to set up Geofencing on iOS and this one for Geofencing on Android
- When a Geofence is triggered, use the WonderPush trackEvent method
WonderPush.trackEvent("Enter the Stadium")
- Go to your dashboard and create a notification scheduled
When a subscriber becomes part of the audience:
Updated over 1 year ago