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]?) -> BoolSends 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.
- (BOOL)logSignal:(NSDictionary *)values;Sends the signal to the Acoustic Connect endpoint. Initialize the Connect SDK before calling this method using [[ConnectApplicationHelper sharedInstance] enableFramework:withPostMessageUrl:].
Pass all fields as an NSDictionary. The SDK handles the signal structure automatically.
Signal fields
Required
| Field | Type | Description |
|---|---|---|
productId | String | Unique product identifier. If missing, the signal is discarded. |
signalType | String | Signal type. Value: "wishlistItemAdded". |
Optional
| Field | Type | Description |
|---|---|---|
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. |
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 |
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
priceaccepts 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"
])#import <Connect/Connect.h>
[[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)")
}
}#import <Connect/Connect.h>
- (void)toggleFavorite {
BOOL isFav = [FavoritesStore.shared toggle:self.product.id];
self.favoriteItem.image = [UIImage systemImageNamed:isFav ? @"heart.fill" : @"heart"];
self.favoriteItem.tintColor = isFav ? Theme.accent : Theme.primary;
if (isFav) {
// Item was just added to favorites
NSMutableDictionary *signal = [@{
@"signalType": @"wishlistItemAdded",
@"productId": self.product.id,
@"productName": self.product.name,
@"price": @(self.product.price.doubleValue),
@"productCategory": self.product.categoryName,
@"currency": @"USD",
@"category": @"Behavior",
@"effect": @"positive",
@"name": @"wishlistItemAdded from product detail"
} mutableCopy];
if ([[UserSession shared] isAuthenticated] && [[UserSession shared] email]) {
signal[@"audience"] = @{ @"Email Address": [[UserSession shared] email] };
}
BOOL accepted = [[ConnectCustomEvent sharedInstance] logSignal:signal];
NSLog(@"[Connect] wishlistItemAdded signal accepted: %@", accepted ? @"true" : @"false");
}
}Best practices
- Capture product data at the point of interaction - it is always available when the user is on the product detail screen.
- Use consistent
currencyvalues across signals for accurate segmentation. - Always include an
audienceidentifier where possible - wishlist activity is a strong intent signal worth attaching to a contact. - If your app doesn't display prices, omit
priceandcurrencyrather 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). Afalsereturn indicates the SDK rejected the call. - Confirm
productIdis present - it is required and its absence discards the entire signal. - Verify the
appKeyandpostURLmatch the Connect org you're checking.
Contact not created or updated?
- Verify attribute key names in
audiencematch exactly how they appear in Connect - including capitalization and spacing.
Related pages
Updated about 2 hours ago
