Foursquare
Foursquare is a location data platform providing location data targeting in your Braze campaigns. Use Foursquare’s Pilgrim SDK on iOS and Android apps to provide real-time event triggering based on location, allowing you to harness Foursquare’s powerful geo-targeting capabilities to send relevant, personalized messaging with Braze.
This integration is maintained by Foursquare.
Prerequisites
| Requirement | Description |
|---|---|
| Foursquare account | A Foursquare account is required to take advantage of this partnership. |
| Braze REST API key | A Braze REST API key with users.track permissions. This can be created in the Braze dashboard from Settings > API Keys. |
| Braze workspace and App IDs | The Braze workspace and App IDs can be found in the developer console. |
Integration
To integrate the two platforms, you must integrate the two SDKs and map the matching user fields. After integrating the Pilgrim SDK, you will receive location events on the device or to a webhook.
Step 1: Map user ID fields
To correctly map fields between the two SDKs, set the same user ID in both systems using the changeUser method in the Braze SDK and the setUserId method of PilgrimUserInfo in the Pilgrim SDK.
Step 2: Configure Pilgrim console

Find the workspace and App IDs in the Braze developer console. Next, enter your Braze REST API Key and App IDs in the Foursquare Pilgrim Console.
Once you have configured the Pilgrim Console, the Pilgrim SDK will record location events and forward them to Braze, allowing you to retarget and segment qualified customers. See the Foursquare developer site for more details.
Pilgrim SDK requires that you enable location services.
Triggering messages
Once the integration is set up, you can set up a campaign or Canvas that will action off of location events generated by the Pilgrim SDK. This integration route is ideal for real-time messaging right after users enter a venue of interest or delayed follow-up communication after they’ve left, like a thank you note or reminder.
To send a campaign that will send messages based on a set location:
- Create a Braze campaign or Canvas that sends with Action-Based Delivery
- For your trigger, use a custom event of
arrivalwith an event property filter forlocationTypeas shown in the following screenshot.

Retargeting
To retarget your users, use the Pilgrim SDK to set a last_location custom attribute on your Braze users’ user profiles. You can then use the matches regex comparison to retarget users who went to a particular location in the real world, for example, segmenting all users who were recently at a pizza place.

You can also segment users in Braze who visited a particular type of venue based on Foursquare’s primaryCategoryId in a particular window of time. To leverage this data point for your retargeting use cases, log primaryCategoryId as an event property during your audience segmentation process. To identify the users and properties used by the Foursquare API and Pilgrim SDK, refer to the Foursquare developer site.
Edit this page on GitHub