Batch integration

Connect Woosmap Geofencing SDK with Batch

  1. Batch Integration
  2. Send Batch Custom events

Woosmap Geofencing SDK can send events to Batch from different context types: Geofences, POI, Visits and ZOI.

Whenever location events trigger, you can send custom events with associated properties to your App via a listener method. Your App can then pass them to the Batch SDK and use the Custom Event trigger in the Automation and Journey composers.

Batch Integration

Requirements

Configuration

To configure your app with the Batch SDK follow the instructions on the dedicated SDK Integration guide on https://doc.batch.com/.

Send Batch Custom events

Custom events let you track user activities and key conversions in your mobile app, and tie them back to corresponding push messaging campaigns.

iOS Example

import WoosmapGeofencing
import Batch

public class DataRegion: RegionsServiceDelegate {

    // the didEnterPOIRegion() is called when a user enters in the geofence 
    public func didEnterPOIRegion(POIregion: Region) {
        
        // if you want only push to batch geofence event related to POI,
        // check first if the POIregion.origin is equal to "POI" 
        if POIregion.origin == "POI"
        {
            if let POI = POIs.getPOIbyIdStore(idstore: POIregion.identifier ?? "") as POI? {
                
                let data = BatchEventData()
                // available parameters are listed in the "Geofences Events" section
                data.put(POI.idstore ?? "", forKey: "identifier")
                data.put(POI.name ?? "", forKey: "name")
                
                BatchUser.trackEvent("woos_geofence_entered_event", withLabel: nil, data: data)
            }
            else {
                // error: Related POI doesn't exist
            }
        }
    }

Android Example

public class WoosRegionLogReadyListener implements Woosmap.RegionLogReadyListener {
    public void RegionLogReadyCallback(RegionLog regionLog) {

        BatchEventData data = new BatchEventData();

        POI poi = WoosmapDb.getInstance(getApplicationContext()).getPOIsDAO().getPOIbyStoreId(regionLog.idStore);

        data.put("identifier", poi.idStore);
        data.put("name", poi.name);

        if(regionLog.didEnter) {
            Batch.User.trackEvent("woos_geofence_entered_event", null, data);
        }
        else {
            Batch.User.trackEvent("woos_geofence_exited_event", null, data);
        }
    }
}

Geofences Events

Event data specification

Field name Type Only if the region is a POI
date Datetime  
id String  
latitude Double  
longitude Double  
radius Double  
name String
idStore String
city String
zipCode String
distance String
country_code String
address String
tags String
types String
user_properties.[field_name] String

POI Events

Event data specification

Field name Type
date Datetime
name String
idStore String
city String
zipCode String
distance String
country_code String
address String
tags String
types String
user_properties.[field_name] String

Visits Events

Event data specification

Field name Type
date Datetime
arrivalDate String
departureDate String
id String
latitude String
longitude String

ZOI Events

Event data specification

Field name Type
date Datetime
id String
latitude Double
longitude Double
radius Double
Was this article helpful?
Have more questions? Submit a request