Use the AddToCartListingEventBuilder when a buyer completes a purchase and that purchase is confirmed.

This can include but is not limited to:

  • Winning an auction
  • An offer is accepted
  • A user completes a "buy-it-now" purchase



Create an empty AddToCartListingEventBuilder

 AddToCartListingEventBuilder(String listing_id)

Create an AddToCartListingEventBuilder with just a listing ID

 AddToCartListingEventBuilder(String listing_id, Double pricePerUnit, Integer quantity)

Create an AddToCartListingEventBuilder with all required properties

Public Methods

 AddToCartListingEventBuilder setBuyType(String buy_type)

Set the type of purchase, such as "Auction", "Offer", "BIN". 

 AddToCartListingEventBuilder setListingID(String listing_id)

Set the unique Listing Identifier used to reference this specific listing. This Listing Identifier is used in other calls to edit the Listing, add the listing the a customers cart, purchase the listing, etc.

 AddToCartListingEventBuilder setPricePerUnit(Double price)

Set the price per individual item in a listing. A multipack is considered a single item.

 AddToCartListingEventBuilder setQuantity(String listing_id)

Set the quantity purchased.

 AddListingEventBuilder setRevenuePerUnit(Double revenue)

Set the revenue (per item) that you (as the marketplace) makes for a purchase.

Prior to a purchase, if the amount could change, it is the estimated amount.

 AddToCartListingEventBuilder setShippingPrice(Double shipping_price)

Set how much the shipping was calculated as when purchased

 AddToCartListingEventBuilder setShippingType(String shipping_type)

Set the method of shipment requested. Common shipment methods might be:

  • UPS
  • USPS
  • FedEx
  • 2-Day
  • 1-Day

Methods inherited from EventBuilder

 Object build()

Returns the object required by the track() method in the Kahuna SDK. This should be used just as a KahunaEventBuilder would.

 EventBuilder addProperty(String key, String value)

Sets the event property named "key" with the value "value".

Intelligent Event campaign filters ignore the letter case of event names, property keys, and property values. For example, the event WATCH_MOVIE matches the filter value watch_movie, Watch_Movie, and Watch_movie.

The property key must be a string value.

Property keys cannot start with k_, because this prefix is reserved for Kahuna system keys.

Property values must be a single string. You can provide a set of values by calling addProperty() multiple times with the same key, passing in a different value each time.

You can add up to 25 properties to a single builder object.

Because multiple values for a key are stored as a set, you can't add the same value more than once. If you try, you still have one occurrence of that value in the set.

If you try to set an empty key or value, addProperty ignores the call and writes a message to the debug logs.

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request