public interface

AnalyticsManager

com.salesforce.marketingcloud.analytics.AnalyticsManager

Class Overview

Public facing interface for interacting with the Marketing Cloud SDK's analytics features.

Summary

Public Methods
abstract String getPiIdentifier()
Returns the value set by setPiIdentifier(String).
abstract void setPiIdentifier(String piIdentifier)
Set the Predictive Intelligence Identifier to be associated with your Predictive Intelligence analytics.
abstract void trackCartContents(PiCart cart)
PI Analytics Convenience method to track a shopping cart.
abstract void trackCartConversion(PiOrder order)
PI Analytics Convenience method to track a purchase.
abstract void trackInboxOpenEvent(InboxMessage message)
Track the opening of a InboxMessage in ETAnalytics.
abstract void trackPageView(String url, String title)
Track page views within your application
abstract void trackPageView(String url, String title, String item)
Track page views within your application
abstract void trackPageView(String url, String title, String item, String searchTerms)
Track page views within your application
abstract void trackPageView(String url)
Track page views within your application

Public Methods

public abstract String getPiIdentifier ()

Returns the value set by setPiIdentifier(String).

Returns
  • the current value of the Predictive Intelligence Identifier set by your application or null if not set.

public abstract void setPiIdentifier (String piIdentifier)

Set the Predictive Intelligence Identifier to be associated with your Predictive Intelligence analytics. This value can be cleared by setting it to null. By default, if unset, the SDK will use the Contact Key. You can decide whether or not you want this default, legacy behavior by setting MarketingCloudConfig.Builder#setUseLegacyPiIdentifier(boolean). This default behavior will be removed in an upcoming SDK release and you will be required to explicitly set the identifier.

Parameters
piIdentifier the Predictive Intelligence Identifier for your PI Analytics.

public abstract void trackCartContents (PiCart cart)

PI Analytics Convenience method to track a shopping cart.

Parameters
cart the shopping cart contents to be tracked in analytics.

public abstract void trackCartConversion (PiOrder order)

PI Analytics Convenience method to track a purchase.

Parameters
order represents the cart items and associated meta data. The PiOrder must contain at least 1 PiCartItem in cartItems().

public abstract void trackInboxOpenEvent (InboxMessage message)

Track the opening of a InboxMessage in ETAnalytics.

Parameters
message to be reported as opened/viewed

public abstract void trackPageView (String url, String title)

Track page views within your application

Parameters
url - a non-null String to identify the location within your app traversed by your customers. For example: com.your.package.activity.name
title - a String (null if n/a) to identify the title of the location within your app traversed by your customers. For example: Activity Name

public abstract void trackPageView (String url, String title, String item)

Track page views within your application

Parameters
url - a non-null String to identify the location within your app traversed by your customers. For example: com.your.package.activity.name
title - a String (null if n/a) to identify the title of the location within your app traversed by your customers. For example: Activity Name
item - a String (null if n/a) to identify an item viewed by your customer. For example: UPC-1234

public abstract void trackPageView (String url, String title, String item, String searchTerms)

Track page views within your application

Parameters
url - a non-null String to identify the location within your app traversed by your customers. For example: com.your.package.activity.name
title - a String (null if n/a) to identify the title of the location within your app traversed by your customers. For example: Activity Name
item - a String (null if n/a) to identify an item viewed by your customer. For example: UPC-1234
searchTerms - a String (null if n/a) to identify search terms used by your customer. For example: blue jeans

public abstract void trackPageView (String url)

Track page views within your application

Parameters
url - a non-null String to identify the location within your app traversed by your customers. For example: com.your.package.activity.name