Self describing events vs e-commence fields for order basket tracking


#1

Currently we track our order events as an unstructured event without any schema associated with it, the event itself is a nested map with keys for things like order value, delivery costs, total items, etc. and then an item key whose value is an array of items where each item is a map of sku, price, etc., for example:

{ “order_value”: 50.0, “total_items”: 2, “delivery_costs”: 2.99,
“items”: [{“sku”: “ABC01”, “price”: 24.99} {“sku”: “DEF23”, “price”: 25.01}]}

Fingers crossed that’s actually valid JSON but I think it conveys the intent.

We’re looking to get ourselves up-to-date and implement best practice Snowplow events. I believe one approach would be to track a single self describing (unstruct) JSON event with the basket details and add the item maps as self describing custom contexts. Another could be to use the e-commerce fields in the Snowplow along with some custom contexts for any extra fields we’d want.

My preference is for the first but I was wondering what the pros and cons are, and also if there are other good/better options to consider.

Thanks
Gareth