Integrate Einstein Recommendations and Collect API

Einstein Recommendations uses a unique identifier called the PIID to attribute analytics to specific users. By default, the SDK uses the contact key as the PIID. You can explicitly set this value in your app.

The SDK includes a configuration option called useLegacyPiIdentifier. When enabled, this option replaces an absent or empty PIID with the contact key. When disabled, the SDK doesn’t replace an absent or empty PIID.

Configure the SDK with pianalytics and useLegacyPiIdentifier as described in Configure the SDK for iOS.

To ensure future compatibility, we recommend that you explicitly set the PIID.

Set or clear the PIID to control which user receives attribution for collected analytics.

Use this code example with SDK version 10 or later.

Use this code example with SDK version 8.

Use this code example with SDK version 7.

Integrate your mobile app with Einstein Recommendations using these methods. You must have an existing Einstein Recommendations deployment and enable the pianalytics option when you configure the SDK.

Track the contents of an in-app shopping cart to send cart data to Einstein Recommendations. Use this method to capture items, quantities, and prices as users build their carts.

Track purchases made through your mobile app to record order details including shipping, discounts, and cart contents. This data helps Einstein Recommendations understand purchase patterns.

Implement page-view analytics to track which items and pages users view in your app. This information helps Einstein Recommendations provide better product suggestions.


Rights of ALBERT EINSTEIN are used with the permission of The Hebrew University of Jerusalem. Represented exclusively by Greenlight.