Enable wishlist-item-added signals in an iOS 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: Swift and Objective-C


Implementation considerations

When to fire the signal

Decide when to send the signal relative to the wishlist action:

  • 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 view controller - heart button in the navigation bar
  • 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

Include the audience field to attribute this signal to a contact in Connect. See How behavior signals update Connect data for identifier formats and contact resolution details.


Configuration

Before adding behavior signals, integrate the Connect SDK into your app. A recent beta (debug) version of the SDK is required (2.1.17 or later). See the guide for your development language: Swift or Objective-C.

Method

  func logSignal(_ data: [String: Any]?) -> Bool

Sends the signal to the Acoustic Connect endpoint. Initialize the Connect SDK before calling this method using ConnectSDK.shared.enable(with:).

Pass all fields as a flat [String: Any] dictionary. The SDK handles the signal structure automatically.

Signal fields

Required

FieldTypeDescription
productIdStringUnique product identifier. If missing, the signal is discarded.
signalTypeStringSignal type. Value: "wishlistItemAdded".

Optional

FieldTypeDescription
audience[String: Any]Key-value pairs for contact mapping. Keys must match contact attribute names exactly as they appear in Connect, including capitalization and spacing.
categoryStringSignal category. Value: "Behavior".
currencyStringISO 4217 currency code (for example, "USD", "EUR"). Defaults to the currency set for your Connect subscription.
descriptionStringA description of the signal
effectStringDescribes the effect of the signal on engagement. Use "positive" for wishlist additions.
externalVariantIdStringIdentifier for the specific product variant saved, such as a size or color
nameStringA label to differentiate this signal from others (for example, "wishlistItemAdded from product detail"). Max 256 characters
priceNumberPrice of the product at the time it was saved
productCategoryStringCategory or department the product belongs to
productNameStringDisplay name of the product
wishlistIdStringIdentifier for the specific wishlist the item was added to, useful if a contact can maintain more than one list

Things to know

  • price accepts a native Swift numeric type (Double, NSDecimalNumber).

  • Optional fields enhance the signal but do not prevent processing if omitted.

Basic example

import Connect

ConnectCustomEvent.sharedInstance().logSignal([
    "signalType": "wishlistItemAdded",
    "productId": "SKU-12345",
    "productName": "Linen Throw",
    "price": 89.99,
    "currency": "USD",
    "effect": "positive"
])

Complete example

This example fires a wishlist item added signal from a product detail view controller when the user taps the heart button. The signal fires only when the item is being added (not removed), determined by the return value of FavoritesStore.shared.toggle(_:).

import Connect

@objc private func toggleFavorite() {
    let isFav = FavoritesStore.shared.toggle(product.id)
    favoriteItem.image = UIImage(systemName: isFav ? "heart.fill" : "heart")
    favoriteItem.tintColor = isFav ? Theme.accent : Theme.primary

    if isFav {
        // Item was just added to favorites
        var signal: [String: Any] = [
            "signalType": "wishlistItemAdded",
            "productId": product.id,
            "productName": product.name,
            "price": product.price.doubleValue,
            "productCategory": product.categoryName,
            "currency": "USD",
            "category": "Behavior",
            "effect": "positive",
            "name": "wishlistItemAdded from product detail"
        ]

        if UserSession.shared.isAuthenticated, let email = UserSession.shared.email {
            signal["audience"] = ["Email Address": email]
        }

        let accepted = ConnectCustomEvent.sharedInstance().logSignal(signal)
        NSLog("[Connect] wishlistItemAdded signal accepted: \(accepted)")
    }
}

Best practices

  1. Capture product data at the point of interaction - it is always available when the user is on the product detail screen.
  2. Use consistent currency values across signals for accurate segmentation.
  3. Always include an audience identifier where possible - wishlist activity is a strong intent signal worth attaching to a contact.
  4. If your app doesn't display prices, omit price and currency rather than sending placeholder values.

Verification

After adding a product to your wishlist or favorites, check the Xcode console for:

[Connect] wishlistItemAdded signal accepted: true

The false value means the SDK rejected the call - see Troubleshooting below. Once the console confirms acceptance, verify the signal is available in Connect.


Troubleshooting

Signal not appearing in Connect?

  • Confirm the Connect SDK is initialized before any signal calls. See Method.
  • Capture the return value: let accepted = ConnectCustomEvent.sharedInstance().logSignal(signal). A false return indicates the SDK rejected the call.
  • Confirm productId is present - it is required and its absence discards the entire signal.
  • Verify the appKey and postURL match the Connect org you're checking.

Contact not created or updated?

  • Verify attribute key names in audience match exactly how they appear in Connect - including capitalization and spacing.

Related pages


Did this page help you?