Solved

Checkout Event with Multiple Products

  • 16 August 2021
  • 4 replies
  • 572 views

Badge

Hello, I´m new to Amplitude.

Recently I discovered a few errors with the implementation that was done at my company before I started.

And I would like some practical examples to show my IT team so we can fix it.

One of the errors encontered was Check Out / Cart with Multiple Products

As Revenue = Price x Quantity

But what if you have two different priced products.

Our implementation was “adding” the prices, adding the quantities and multiplying … but obviously this is wrong.

What is the best way to solve this?

Precalculate an average price based on quantities??

icon

Best answer by sydney.koh 17 August 2021, 19:25

View original

4 replies

Userlevel 7
Badge +10

Hey @davidgough ,

The following post might help you with your question -

 

Hope this will help!

Badge

Hi Saish, thanks for the link.

 

So basically double up (triple up) on the events. But then, how can I track individual purchases?

 

Is it possible to link a puchase number for consequente unique counts?

 

David

 

Userlevel 7
Badge +10

I believe that sending an event property like order_id for those individual events under one purchase order will help in some charts, but there isn’t a direct way of using a direct linking mechanism afaik.

Denis also mentions in his answer about sending in a consolidated final purchase event with the individual products as an array as one of the most common approaches. So using the Uniques metric in your event segmentation chart for this event will help you track the unique individuals who are purchasing.  

Userlevel 5
Badge +8

Hello David!

 

Nice find Saish Denis presented a great way to set up multiple products purchases! After reading your questions there is another implementation that is very similar to Denis’ but slightly different and may help your case.

  1. Create an event called Order Completed (or whatever name you want) that will track an order. You will need to have some property like order_id on the event. You will have a unique order_id for each Order Completed events. This event will track the entire order and can be logged as Revenue in SDKs or sending revenue field with the event. You can also add custom event properties for this event like a product array. If you had a 3 products at $1 and 2 products at $2. You can have one Order Completed event that has a total revenue of $7.
     
  2. Create another event called Product Purchased (or whatever name you want) in which fires for each item purchased in an Order. There should be an event property on each event called something like item_id in order to show each unique item. This event will not be tracked as Revenue. So that revenue is not double-counted since they are counted in the event above.

This solution is a little different so you should consider the logic of both and see which one fits your case better! It may also be a good idea to try them in a test project before you implemented them in your main project. 

 

Let me know if you have any questions!

 

Best,

Sydney


 

Reply