For some data, especially related to the purchase of physical goods like groceries, customers may want to send location information. We've had success using the H3 library to convert lat/lon into hexagons with the desired resolutions. For example, a res-7
hexagon represents an area of about 5.161293 KM^2, which can be a good trade-off between precision and sparsity. We've had good results with res-6
, res-7
, and res-8
so far. When sending Interaction data, you can use the context
field to send us geohex information with different resolutions, along with other business-specific info (e.g. region name, city name, fulfillment center, etc.). Example:
POST https:
{
"data": [
{
"user_id": "USER_ID",
"type": "product_detail_page_view",
"product_ids": [
"PRODUCT_ID"
],
"context": {
"custom_context": {
"business_region": "us-east",
"business_area_id": "123",
"business_fullfillment_center": "AZ1",
"city": "new_york",
"geohex_7": "8a2a1072b59ffff",
"geohex_6": "1a2a1072b59ffff",
"weather": "raining"
}
}
}
]