Android Mobile SDK: Notify Product Visit Event

The “Notify Product Visit Event” is used to report that the contact has visited a specific product during their navigation in the app. It sends a notification via Mobile SDK when a user accesses a product detail page using the Connectif.sendProductVisit() method.

 

How to Use

The product visit notification uses the Product object from the sendProductVisit method to enrich the information of the sent events.

 

Notify Product Visit Information

These are the properties we can send in our Product object:

Name Required Type Description
productDetailUrl Yes String Product page URL (URL must be unencoded).
productId Yes String Unique product identifier (in the eCommerce system).
name Yes String Product name.
description No String Product description. It can contain HTML code.
imageUrl No String Product image URL.
unitPrice Yes BigDecimal Product unit price.
availability No Availability Can be one of the following values: IN_STOCK or OUT_OF_STOCK.
categories No List<String> The category the product belongs to. If the eCommerce allows subcategories, you can indicate them with the full category path, separating each level with the '/' character.
For example: "/Computers/Keyboards/Logitech".
tags No List<String> Tags associated with the product.
brand No String Product brand.
reviewCount No Int Number of product reviews.
rating No Int Product rating on a scale of 0 to 5.
ratingCount No Int Number of product ratings.
thumbnailUrl No String Product thumbnail image URL.
relatedExternalProductIds No List<String> IDs of related products.
priority No Int Product priority.
unitPriceOriginal No BigDecimal Original product unit price before discount.
unitPriceWithoutVAT No BigDecimal Original product unit price without VAT.
discountedAmount No BigDecimal Discounted amount for the product.
discountedPercentage No Int Discount percentage, ranging from 0 to 100 without a percentage symbol.
publishedAt No Date Date the product was published in the store catalog.
customField1 No String Custom product field.
customField2 No String Custom product field.
customField3 No String Custom product field.

 

This type of event automatically collects the following information:

  • Operating system: Android or iOS.
  • App version.
  • Operating system version.
  • Connectif SDK version.

 

Example

The notification will look like this:

Connectif.sendProductVisit(
Product(
productDetailUrl = "https://example.com/product/12345",
productId = "12345",
name = "Example Product",
unitPrice = BigDecimal("99.99"),
description = "This is an example product",
imageUrl = "https://example.com/product/images/12345.jpg",
availability = Product.Availability.IN_STOCK,
categories = listOf("Electronics", "Gadgets"),
tags = listOf("Trending", "New Arrival"),
brand = "ExampleBrand",
reviewCount = 150,
rating = BigDecimal("4.5"),
ratingCount = 124,
thumbnailUrl = "https://example.com/product/thumbnails/12345.jpg",
relatedExternalProductIds = listOf("54321", "67890"),
priority = 1,
unitPriceOriginal = BigDecimal("120.00"),
unitPriceWithoutVAT = BigDecimal("80.00"),
discountedAmount = BigDecimal("20.00"),
discountedPercentage = BigDecimal("16.67"),
publishedAt = Date(),
customField1 = "Special Edition",
customField2 = "Limited Stock",
customField3 = "Online Only"
)
)

 

Callbacks (Optional)

If you want feedback on potential errors when sending events, you can add an EventCallbacks when using our method.

 object : EventCallbacks {
    override fun onSuccess() {
        //Handle success
    }
    override fun onError(message: String?) {
         //Handle error
    }
}

 

 

Congratulations!
You've reached the end of the lesson.

  

Do you still have unresolved questions?
Remember that our Connectif specialists are available to assist you. To contact them, simply open a support ticket by clicking on the blue "Help" button in your dashboard.


Keep Learning!

To fully unlock the potential of your Connectif account, we recommend continuing with the following articles:

Was this article helpful?
0 out of 0 found this helpful