---
updatedAt: 2026-08-11T15:49:28.000Z
---

# Enable wishlist-item-added signals in an Android app

The wishlist-item-added signal fires when a user adds a product, service or offering to a wishlist, favorites list or saved-items list. Use this signal to identify purchase intent, trigger price-drop or back-in-stock journeys and segment contacts by product interest.

**Availability:** Pro, Premium and Ultimate

**Languages:** Kotlin and Java

***

# Implementation considerations

## When to fire the signal

Decide when to send the signal based on your app's behavior:

* **On tap** - fire as soon as the user taps the heart, star or save icon. Captures intent even if the add fails.
* **After confirmation** - fire only after the item is confirmed added. More accurate, but may miss failed attempts.

For most implementations, firing on tap is recommended.

## Multiple entry points

Your app may support adding to favorites from more than one screen:

* Product detail screen - heart button in the action bar or overlay
* Product listing or home screen - quick-save icon on a product card

Each entry point may have access to different amounts of product data. Make sure all flows are covered.

## Contact mapping

Use the `audience` field to map this signal to a contact in Connect. Commonly used identifiers are email address, phone number and customer ID.

> 📘 Note
>
> A customer ID mapped to the Contact key attribute in Connect is the most reliable identifier for known contacts. However, if no matching contact exists and the only attribute is a contact key, the signal is discarded - contact keys alone cannot create new contacts.

We recommend attaching identifiers to as many signals as possible. If the user is not authenticated, omit `audience` - Connect will attempt to identify the visitor using other signals from the same session.

***

# Configuration

## Method

```kotlin Kotlin
Connect.logSignal(data: HashMap<String?, Any?>?): Boolean
```

Sends the signal to the Acoustic Connect endpoint. The Connect SDK must be initialized via `Connect.enable()` before calling this method.

Pass all fields as a flat `HashMap`. The SDK handles the signal structure automatically - you do not need to construct a nested object.

## Signal fields

### Required

| Field        | Schema type | Description                                                     |
| ------------ | ----------- | --------------------------------------------------------------- |
| `productId`  | String      | Unique product identifier. If missing, the signal is discarded. |
| `signalType` | String      | Signal type. Value: `"wishlistItemAdded"`.                      |

### Optional

| Field               | Schema type  | Description                                                                                                                                                    |
| ------------------- | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `audience`          | `JSONObject` | Key-value pairs for contact mapping. Must be a flat `JSONObject` - not a `HashMap`. Keys must match contact attribute names exactly as they appear in Connect. |
| `category`          | String       | Signal category. Value: `"Behavior"`.                                                                                                                          |
| `currency`          | String       | ISO 4217 currency code (for example, `"USD"`, `"EUR"`). Defaults to the currency set for your Connect subscription.                                            |
| `description`       | String       | A description of the signal.                                                                                                                                   |
| `effect`            | String       | Describes the effect of the signal on engagement. Use `"positive"` for wishlist additions.                                                                     |
| `externalVariantId` | String       | Identifier for the specific product variant saved, such as a size or color.                                                                                    |
| `name`              | String       | A label to differentiate this signal from others (for example, `"wishlistItemAdded from product detail"`). Max 256 characters.                                 |
| `price`             | Number       | Price of the product at the time it was saved. Pass as a string (for example, `price.toPlainString()`).                                                        |
| `productCategory`   | String       | Category or department the product belongs to.                                                                                                                 |
| `productName`       | String       | Display name of the product.                                                                                                                                   |
| `wishlistId`        | String       | Identifier for the specific wishlist the item was added to, useful if a contact can maintain more than one list.                                               |

> ✅ Things to know
>
> * `price` has schema type Number but must be passed as a string - use `price.toPlainString()`. The SDK serializer silently drops numeric values.
>
> * Pass `audience` as a `JSONObject`, not a `HashMap`. A `HashMap` value is silently dropped by the SDK serializer and the contact will not be mapped.
>
> * Optional fields enhance the signal but do not prevent processing if omitted.

### Required import

```kotlin Kotlin
import org.json.JSONObject
```

## Basic example

```kotlin Kotlin
val data = hashMapOf<String?, Any?>(
    "signalType" to "wishlistItemAdded",
    "productId" to "SKU-12345",
    "productName" to "Linen Throw",
    "price" to "89.99",
    "currency" to "USD",
    "effect" to "positive"
)
Connect.logSignal(data)
```

## Complete example

This example fires a wishlist item added signal when the user taps the heart button. The signal fires only when the item is being added, determined by the return value of the toggle function.

```kotlin Kotlin
import org.json.JSONObject
import com.acoustic.connect.android.connectmod.Connect

private fun toggleWishlist(product: Product) {
    val isNowFaved = FavoritesStore.toggle(product.id)

    if (isNowFaved) {
        // Item was just added to favorites
        val data = hashMapOf<String?, Any?>(
            "signalType" to "wishlistItemAdded",
            "productId" to product.id,
            "productName" to product.name,
            "price" to product.price.toPlainString(),
            "productCategory" to product.categoryName,
            "currency" to "USD",
            "category" to "Behavior",
            "effect" to "positive",
            "name" to "wishlistItemAdded from product detail"
        )

        // audience must be JSONObject - HashMap values are silently dropped
        UserSession.email?.let { email ->
            data["audience"] = JSONObject().put("Email Address", email)
        }

        Connect.logSignal(data)
    }
}
```

***

# Troubleshooting

**Signal not appearing in Connect?**

* Confirm `Connect.enable()` is called before `logSignal`.
* Capture the return value and check that it is `true`: `val accepted = Connect.logSignal(data)`. A `false` return indicates the SDK rejected the call - no additional configuration is required to use the return value.
* Confirm `productId` is present - it is required and its absence discards the entire signal.
* Verify the `appKey` and `postMessageUrl` match the Connect org you're checking.

**Contact not created or updated?**

* Confirm `audience` is a `JSONObject`, not a `HashMap`.
* Verify attribute key names match exactly how they appear in Connect - including capitalization and spacing.

***

# Related pages

* [Wishlist item removed signal in the Connect Android SDK](https://developer.goacoustic.com/acoustic-connect/docs/wishlist-item-removed-signal-android)
* [How behavior signals are processed in Connect](https://developer.goacoustic.com/acoustic-connect/docs/how-behavior-signals-are-processed-in-connect)