Improving Location Trigger Accuracy

Reach location triggers can add a layer of sophistication to your mobile wallet marketing strategy by displaying your passes at relevant locations and times. When adding location triggers to your templates or passes, it is best to use latitude and longitude coordinates as mapping systems can vary and GPS does not always work reliably. Latitude and longitude coordinates ensure the highest degree of accuracy possible, and are easy to add to your passes by using the Reach API. 

You can add coordinates to your template with the Add Locations to Template API call:

POST /v1/template/12345/locations HTTP/1.1
Content-Type: application/json
Authorization: Basic <Base64 key>
Api-Revision: 1.2

{
   "locations":[
      {
         "longitude":-122.374,
         "latitude":37.618,
         "relevantText":"Hello loc0"
      }
   ]
}

Upon executing this request, you should see the specified coordinates appear as a trigger in the UI. Any passes created after that point in time will have that trigger added to them, and will appear on users' lock screens when they enter the location radius of the trigger. 

If you have already distributed passes with an incorrect/out-of-date location trigger, you can clear them out and add the correct trigger following the steps below:

  1. Remove the current trigger from existing passes by passing an empty locations array via the Bulk Update endpoint:
    1. POST /v1/template/12345/passes HTTP/1.1
      Content-Type: application/json
      Authorization: Basic <Base64 key>
      Api-Revision: 1.2
      
      {
      "locations":[] }
  2. Add the new trigger to existing passes via the Bulk Update endpoint:
    1. POST /v1/template/12345/passes HTTP/1.1
      Content-Type: application/json
      Authorization: Basic <Base64 key>
      Api-Revision: 1.2
      
      {
         "locations":[
            {
               "longitude":-122.374,
               "latitude":37.618,
               "relevantText":"Hello loc0"
            }
         ]
      }

 

A word of caution when using the Bulk Update endpoint: any data sent via the Bulk Pass Update API will replace that same data for all passes under that template ID. This can refer to:

  • Membership ID fields

  • Coupon Codes

  • Barcode values or alternative text

  • Any other field or image on the pass

The only fields, images or barcode data that will be modified on passes under that template ID are those fields, images or barcode data sent in the Bulk Pass Update API. Therefore, only modify fields you intend to change. 

Please note that there is no rate limiting on location based notifications with Apple Wallet. Therefore, if your users are consistently leaving and entering the trigger range, the pass notification will be triggered each time. Keep this in mind when planning your campaigns and setting location triggers. 


 Related Content: