Airship

How We Work Together

With Foursquare and Airship, you can send notifications to your users in-app based on how they move throughout the world. Airship can help you identify your most loyal customers and keep them coming back for more with personalized messaging, the ability to offer coupons and deals based on their location, and accelerate conversions to provide a great user experience from start to finish.

Examples of What You Can Do

Integrating with Airship enables you to provide some powerful use-cases to help personalize your users' experiences:

Example JSON Payloads

Visits HistoricalVisits DepartureVisits ArrivalGeofence ExitGeofence EnterGeofence Dwell

{
    "lat": "{Double}",
    "lng": "{Double}",
    "locationType": "{String}",
    "visitId": "{String}",
    "timestamp": "{YYYY-MM-DDTHH:MM:SS.XXXZ}",
    "venueName": "{String}",
    "venueId": "{String}",
    "primaryCategoryName": "{String}",
    "primaryCategoryId": "{String}",
    "primaryChainName": "{String}",
    "primaryChainID": "{String}",
    "address": "{String}",
    "crossStreet": "{String}",
    "city": "{String}",
    "state": "{String}",
    "zipCode": "{String}",
    "country": "{String}",
    "supervenueId": "{String}",
    "supervenueName": "{String}",
    "supervenuePrimaryCategoryId": "{String}",
    "supervenuePrimaryCategoryName": "{String}",
    "supervenuePrimaryChainId": "{String}",
    "supervenuePrimaryChainName": "{String}"
},
"type": "track"
{
    "EventDefinitionKey": "pilgrimArrivalEntrySource",
    "ContactKey": "{String}",
    "Data": {
        "visitType": "departure",
        "confidence": "{ConfidenceLevel}",
        "lat": "{lat}",
        "lng": "{long}",
        "locationType": "venue",
        "visitId": "{VisitID}",
        "timestamp": "{Timestamp}",
        "venueName": "{VenueName}",
        "venueId": "{VenueID}",
        "primaryCategoryName": "{PrimaryCategoryName}",
        "primaryCategoryId": "{PrimaryCategoryID}",
        "address": "{Address}",
        "crossStreet": "{Cross Street}",
        "city": "{CityName}",
        "state": "{StateCode}",
        "zipCode": "{ZipCode}",
        "country": "{CountryCode}",
        "ContactKey": "{String}",
        "userId": "{String}"
    }
}
{
    "EventDefinitionKey": "pilgrimArrivalEntrySource",
    "ContactKey": "{String}",
    "Data": {
        "visitType": "arrival",
        "confidence": "{ConfidenceLevel}",
        "lat": "{lat}",
        "lng": "{long}",
        "locationType": "venue",
        "visitId": "{VisitID}",
        "timestamp": "{Timestamp}",
        "venueName": "{VenueName}",
        "venueId": "{VenueID}",
        "primaryCategoryName": "{PrimaryCategoryName}",
        "primaryCategoryId": "{PrimaryCategoryID}",
        "address": "{Address}",
        "crossStreet": "{Cross Street}",
        "city": "{CityName}",
        "state": "{StateCode}",
        "zipCode": "{ZipCode}",
        "country": "{CountryCode}",
        "ContactKey": "{String}",
        "userId": "{String}"
    }
}
{
    "EventDefinitionKey": "pilgrimArrivalEntrySource",
    "ContactKey": "{String}",
    "Data": {
        "geofenceEventType": "exit",
        "geofenceLat": "{Double}",
        "geofenceLng": "{Double}",
        "radius": "{Double}",
        "venueId": "{String}",
        "categoryIds": "{String}",
        "venueChainIds": "{String}",
        "partnerVenueId": "{String}",
        "eventLat": "{Double}",
        "eventLng": "{Double}",
        "geofenceId": "{String}",
        "geofenceName": "{String}",
        "geofenceProperties": {},
        "ContactKey": "{String}",
        "userId": "{String}"
    }
}
{
    "userId": "{String}",
    "eventName": "geofenceDwell",
    "createdAt": 1646691515,
    "dataFields": {
        "geofenceEventType": "dwell",
        "geofenceLat": "{Double}",
        "geofenceLng": "{Double}\",   
        "radius": "{Double}",
        "venueId": "{String}\",   
        "categoryIds": "{String}",
        "venueChainIds": "{String}",
        "partnerVenueId": "{String}",
        "eventLat": "{Double}",
        "eventLng": "{Double}",
        "geofenceId": "{String}",
        "geofenceName": "{String}"
    }
}

Integration Details

  1. Make sure the Pilgrim SDK is properly setup.

  2. Make sure that you've set a user specific ID by using the setUserId method of PilgrimUserInfo in the Pilgrim SDK.

  3. Make sure that you've set an airshipId property on the PilgrimUserInfo object with the user's Airship Channel ID.

iOS: let channelID = UAirship.channel().identifier.

Android: String channelId = UAirship.shared().getChannel().getId();

  1. From your Foursquare Pilgrim Console, Enable Third Party Integrations.

  2. Fill in your Airship account's App Key and Access Token in your app's Foursquare Pilgrim Console.

  3. Select the specific visit and geofence fields you wish to send to Airship.

  4. Once done in the Airship modal, be sure to save your changes. Once saved, the Pilgrim SDK will automatically track location events and forward them to Airship.