snowplow / snowplow-ruby-tracker

Snowplow event tracker for Ruby. Add analytics to your Ruby and Rails apps and gems
http://snowplowanalytics.com
22 stars 24 forks source link

Prevent eCommerce events being sent without items #143

Closed mscwilson closed 3 years ago

mscwilson commented 3 years ago

The track_ecommerce_transaction method requires information about the items purchased, in the form of an array of hashes. One hash per item. One transaction/tr event is sent out along with transaction_item/ti events for each item in the array.

At the moment, an empty array is allowed through. This results in a tr event being sent by itself.

mscwilson commented 3 years ago

Decided that this is actually fine.

  1. users might, for some reason, not want to track the actual items of the transaction.
  2. users can attach item information as context entities to the track_ecommerce_transaction call.
  3. users are recommended to build their own custom ecommerce tracking anyway, using schemas and track_self_describing_event.