Login

Customer.io: Trigger A Geolocation Followup Drip Campaign

Knowing when a user arrives at a certain location and using that information to get feedback on an event increasingly important factor in keeping in contact with your users without face to face interaction.

That’s because context is everything when interacting with your users. An incredible 93% of said that they are more likely to open correspondence from an event they actually attended.

To get your drip campaign up and running the trick is first know who was actually physically at your event, what they saw, and how long they were there.

Traditionally, knowing who was at your event vs who purchased a ticket but didn’t go was a total shot in the dark.

Thankfully there’s a way to know who was actually at your event, and send follow up emails automatically.

With SpotSense geofencing, Segment, and Customer.io flows, you can now define when a user visited a certain location (i.e. Coachella), how long they were there, route the data using Segment, and create a drip email campaign with Customer.io.

Simply create a geofence on SpotSense, and turn on your Segment integration. Every time a user enters the geofence, that event is sent to Segment as LOCATION-EVENT-ENTER with the coordinates as properties.

Let’s run through it step by step.

Step 1: Identify users who visited your geofence

This recipe assumes you have SpotSense installed, and that you’re tracking location enter and exit events for a certain location. If not, see SDK Installation guide here.

Let’s say you wanted to track when your users visit the Coachella Music Festival.

First, we’ll create a geofence in the SpotSense dashboard:

  1. Log into SpotSense

  2. Navigate to Locations > Geofences.

  3. Click “ New geofence “ and type in Coachella Music Festival.

  4. Manually track the enter event in xCode (This allows you to send user traits and is required for sending follow up emails). Just paste the following code into your view controller

    SWIFT

    func locationManager(_ manager: CLLocationManager, didEnterRegion region: CLRegion) {
    
            //Will Notify Enter event to dashboard for specific region
            spotsense.handleRegionState(region: region, state: .inside)
            SEGAnalytics.shared()?.track("Location Event - Enter", properties: [
                "geofenceID": ("\\(region.identifier)")
            ])
        }
            
        func locationManager(_ manager: CLLocationManager, didExitRegion region: CLRegion) {
            
            //Will Notify Exit event to dashboard for specific region
            spotsense.handleRegionState(region: region, state: .outside)
            SEGAnalytics.shared()?.track("Location Event - Exit", properties: [
                "geofenceID": ("\\(region.identifier)")
            ])
        }
    

    JAVA

    JUST TURN ON THE ‘SEGMENT’ OPTION ON THE GEOFENCE PAGE

  5. Click “Create Geofence”

Step 2: Use Segment to route visit data

This assumes you already have Segment Analytics set up for your mobile app. If not, check out their documentation here

  1. On the Connections page, click Add destination
  2. Find and add Customer.io
  3. Follow instructions to add the destination
  4. Click Preview and follow the steps to Review & Create.

You’ve connected Customer.io!

Our next step is to set up pass SpotSense events to Customer.io That’s where we’ll send our drip campaign from.

Step 3: Set up your visitor audience in Customer.io

This assumes you already have Customer.io set up for your mobile app. If not, create your account here

  1. Click on the Campaigns tab, click Create campaign

  2. Name your campaign i.e. Location follow up

  3. Click on An event is performed

  4. Under Trigger Event choose Location Event - Exit

  5. Click add event data filter and choose geofenceID for event_attribute_name with the value of your geofence ID hash (Found at the page where we created the geofence in SpotSense as the last hash in the URL)

    !https://s3-us-west-2.amazonaws.com/secure.notion-static.com/8b0bbac8-cf52-4bb6-a935-b5c65d6c9838/Screen_Shot_2020-07-22_at_2.08.49_PM.png

  6. Click save > next

  7. Add an email as your first block in the Customer.io flow > design your email

  8. Create any follow up events i.e. emails based on other conditions, sms text messages, push notifications, etc.

  9. Click finish

That’s it! Now every time a user exits the area during a specific time, they will enter in to the drip campaign you have created on Customer.io!

Step 4: Goals of the drip campaign

The contents of your drip needs to accomplish a few things:

  • Make your customers feel genuinely valued — that they’re not the recipient of thoughtless spam.
  • Be genuine when asking for follow up feedback.
  • Incentivize users to take action with your campaign