Package 

Class BsLogItemEvent.Builder


  • 
    public final class BsLogItemEvent.Builder
    
                        

    BsLogItemEvent is required to log item related events which included when an item is viewed and when an item's detail is viewed.

    • Method Detail

      • init

         final <ERROR CLASS> init(Context context)

        init is required to pass context to the SDK method and log the event. if not provided, it will throw an exception on runtime.

      • setItemViewAction

         final <ERROR CLASS> setItemViewAction(ItemViewAction item_viewAction)

        setItemViewAction is required to set Type for the type of log in this case, if a user is viewing an item or it's details. setType log is used to define if the log is about the item itself or if the user id going into the details. you can provide the values using 2 different methods, one is for enum based and the other is for string based. Below is the method for the enum based approach.

      • setItemViewAction

         final <ERROR CLASS> setItemViewAction(String item_viewAction)

        setItemViewAction is required to set Type for the type of log in this case, if a user is viewing an item or it's details. setType log is used to define if the log is about the item itself or if the user id going into the details. you can provide the values using 2 different methods, one is for enum based and the other is for string based. Below is the method for the string based approach. Remember to note that for string input you need to use the same names as defined in the enum or else the events will be discarded.

      • setItemId

         final <ERROR CLASS> setItemId(String item_id)

        setItemId is required to log the Id for item the events are being logged. Details about the item are to be provided in the catalog for more details about the item.

      • setItemQuantity

         final <ERROR CLASS> setItemQuantity(Integer item_quantity)

        setItemQuantity is required to log the quantity for item the events are being logged. Details about the item are to be provided in the catalog for more details about the item.

      • setItemPrice

         final <ERROR CLASS> setItemPrice(Float item_price)

        setItemPrice is required to log the price for item the events are being logged. Details about the item are to be provided in the catalog for more details about the item.

      • setItemCurrency

         final <ERROR CLASS> setItemCurrency(CurrencyCode currency_code)

        setItemCurrency is required to log the currency for item the events are being logged. Details about the item are to be provided in the catalog for more details about the item.

      • setItemType

         final <ERROR CLASS> setItemType(ItemType item_type)

        setItemType is required to log the type for item the events are being logged. Details about the item are to be provided in the catalog for more details about the item.

      • setItemStockStatus

         final <ERROR CLASS> setItemStockStatus(ItemStockStatus stock_status)

        setItemStockStatus is required to log the stock status for item the events are being logged. Details about the item are to be provided in the catalog for more details about the item.

      • setItemPromoId

         final <ERROR CLASS> setItemPromoId(String promo_id)

        setItemPromoId is required to log the promo Id for item the events are being logged. Details about the item are to be provided in the catalog for more details about the item. If there is not promo associated with the product, you do not need to pass it.

      • setItem

         final <ERROR CLASS> setItem(ItemModel item)

        setItem can be used to pass the whole item as an object as well. You can use the POJO ItemModel to parse the data int he required format and pass that to this function to log the event.

      • setItem

         final <ERROR CLASS> setItem(String itemJsonString)

        setItem can be used to pass the whole item as a Json String object as well. You can use the POJO ItemModel to parse the data int he required format and pass that to this function as a string to log the event. You can use Gson to convert the object to string but SDK will parse the Json string back to POJO so pass it in the log. This method should be used with caution and is suitable for react native bridge.

      • setSearchId

         final <ERROR CLASS> setSearchId(String search_id)

        setSearchId is used to associate the search id with the item being viewed by the user. It is required to track if the item is a result of some search performed by the user in the app.

      • setMeta

         final <ERROR CLASS> setMeta(Object meta)

        You can pass any type of value in setMeta. It is for developer and partners to log additional information with the log that they find would be helpful for logging and providing more context to the log. Default value for the meta is null.

      • updateImmediately

         final <ERROR CLASS> updateImmediately(Boolean update_immediately)

        updateImmediately is responsible for updating the values ot the backend immediately. By default this is set to false or whatever the developer has set in the SDK initialisation block. This differs the time for which the logs will be logged, if true, the SDK will log the content instantly and if false it will wait till the end of user session which is whenever the app goes into background.

      • build

         final <ERROR CLASS> build()

        build will validate all of the values provided and if passes will call the track function and queue the events based on it's updateImmediately value and also on the user's network resources.