Analytics, Einstein Recommendations, and Collect API
Enable analytics by setting parameters in
MarketingCloudConfig.Builder(). To implement analytics in your mobile app, set the
analyticsEnabled parameter to
true. To implement web and mobile analytics in your mobile app, set the
piAnalyticsEnabled parameter to
Integrate Einstein Recommendations and Collect API
Einstein Recommendations analytics uses a unique identifier to attribute collected analytics to a specific user. By default, the SDK uses the contact key as this identifier, called the PIID. Your app can explicitly set this value. Review setPiIdentifier and setUseLegacyPiIdentifier for details and configuration information.
If the PIID isn’t set or is null and the SDK is configured to use the Legacy PI identifier, the SDK sends the contact key as the PIID.
Example: Analytic Attribution
These methods integrate your mobile app with Einstein Recommendations. To use the methods, you must have an existing Einstein Recommendations deployment, and you must enable the “PiAnalytics” option when you configure your SDK.
To track the contents of an in-app shopping cart, use trackCartContents(), as shown in the example. For more information about this method’s general use with Einstein Recommendations, see Track Items in Shopping Cart.
To track a purchase made through your mobile app, use trackCartConversion(), as shown in the example. For more information about this method’s general use with Einstein Recommendations, see Track Purchase Details.
Track Page Views
To implement page-view analytics in your app, use trackPageView(), as shown in the example. For more information about this method’s general use with Einstein Recommendations, see Track Items Viewed.
Track Inbox Message Opens
To track analytics for inbox messages, use trackInboxOpenEvent(). This method sends the open analytic value to Marketing Cloud, as in the example. The SDK automatically provides analytics for message downloads.
Rights of ALBERT EINSTEIN are used with permission of The Hebrew University of Jerusalem. Represented exclusively by Greenlight.