Using Historical Location with your Segments

The information in this article pertains to Urban Airship's Historical Location feature. This feature is available only to certain Urban Airship account levels and requires that Location has been implemented properly in the mobile app using our SDK.
This article does not refer to geo-fencing or iBeacon support. For information on that, please see our Location Triggers and iBeacons Topic Guides.

Using our Historical Location feature with your segments will impact the audience that is addressed by the segment. How the segment is impacted depends on the number of locations and the selected time frames that are used in the segment and the logic that is used to join the segment.

Single condition Segments 

1. Using Location has been selects devices that provided location data from the area and during the timeframe. The following would send to devices who have sent us location data from the United States in the last month:

locHasBeen.png

Here are some examples with a Location has been condition like number 1 above:

  • User A: Was in the United States for two weeks and sent location information. They would get the push. 
  • User B: Was in the United States for two days and sent location information. They would get the push.
  • User C: We don't know where they were, they didn't send location information. They would not get the push. They may have been in the United States but we did not collect information from them. We don't the data to say that they were in the United States.


2. If you change this to Location has not been, you do not end up with all the other devices.

You would get the following: devices that did give us location data in that timeframe, but not from that location.

All devices that did not send us location information in the selected timeframe would not get the push.

locnotbeen.png

Using user has not been in the United States in the past month, means to send to users that have certainly NOT been in the United States in the past month. If we don't have location data from the timeframe, we can't say the user was NOT in the United States. We don't know where the user was. So we only send to people we know were not in the United States during the period.

 
3. You can also set the top selector to If All of the following are False and use Location has been, it will be equivalent to number 2 example above with Location has not been:

locallfalse.png 

More than one Condition: 

1. Location conditions with different timeframes. Whenever you use AND or All with 2 location conditions, the timeframe is applied to the whole segment.  The longer timeframe will narrow down the search, then we apply the second timeframe.

  • For example, location has been in the United States in the last year, and location has not been in Hawaii in the last two months. This will select your devices who gave us location data from the United States in the last year. Then by devices that gave us location data in the last two months outside of Hawaii:

2cond2loc.png


2. Location with a tag. This limits the segment to devices that gave us location data in the timeframe and that location data fits the condition. Then the device also includes the tag. 

  • For example, location has not been in Hawaii in the last 12 months and Tag is surfing: The device gave us location data within 12 months. That location data was outside Hawaii. And the device has the tag, surfing:


locss4allTrueLocandTag.png
 

3. Using OR and Any with location and a tag. The location condition only impacts itself, it doesn't restrict the Tag. 

  • For example, Tag is surfing OR location has not been Hawaii in the last 12 months. This would select devices who have the surfing Tag. It would also select devices who have given us location data in the last two months, and that data was not in Hawaii:

anyLocTag.png

Other notes:

  • You should keep track of which devices are sharing location or not with Tags. Urban Airship's Device Property Tags feature. This will allow you to separately message devices with location permission allowed and those without. 
  • Using the numeral one (1) in any location condition gives you not a whole time window (day, week, month) but the to-date amount of time for the time window chosen. For instance, choosing one week does not give you seven days back, but rather the present calendar week.  See Time Bucketing for more information. 
  • In general it is best to avoid multiple NOT statements when using location. The number of devices in an audience will be drastically reduced using this method.

Related Content: