Monitoring API is enabled only when the SDK is initialized with LPMonitoringParams, to use this initialization refer to the Quick Start guide.

sendSDE

Use this API method to report on engagement attributes (SDEs) for a consumer in an appInstallationId context including show and accept impressions.

func sendSDE(identities: [LPMonitoringIdentity], monitoringParams: LPMonitoringParams, completion: @escaping (_ response: LPSendSDEResponse)->(), failure: @escaping (_ error: NSError)->())
Parameter Description Required
identities Mandatory array of identity objects of type LPMonitoringIdentity which includes the details on the consumer and issuer. Yes
monitoringParams An mandatory LPMonitoringParams with mandatory Engagement Attributes and optional PageId and entry points array. Yes
completion A Completion callback with response of type LPSendSDEResponse. This response includes sessionID and visitorID for future use. Yes
failure A Failure callback with an error in case the request fails. Yes

getEngagement (default method with identities and monitoringParams only)

Use this API method to get an engagement for a consumer in an appInstallationId context. When calculating eligibility, the SDEs, and other parameters based on the messaging concept determine the decisions.

As an optional parameter, you can pass SDE Data, which includes Entry Points and Engagement Attributes for routing the conversation.

func getEngagement(identities: [LPMonitoringIdentity], monitoringParams: LPMonitoringParams?, completion: @escaping (_ response: LPGetEngagementResponse)->(), failure: @escaping (_ error: NSError)->())
Parameter Description Required
identities Mandatory array of identity objects of type LPMonitoringIdentity which includes the details on the consumer and issuer. No
monitoringParams An optional LPMonitoringParams with optional pageId, Entry Points array and Engagement Attributes. No
completion A Completion callback with response of type LPGetEngagementResponse. This response includes sessionID and visitorID for future use. Yes
failure A Failure callback with an error in case the request fails. Yes

When trying to fetch an Authenticated Engagement, the LPMonitoringIdentity parameter containing the ConsumerId is required.

getEngagement (with additional authParams)

  • Available since: 6.14.0
  • !Important: This method only works with the Implicit and Code Flow authentication method.

SDK provide additional option for brands to supply authParams when calling our monitoring module.

func getEngagement(identities: [LPMonitoringIdentity], monitoringParams: LPMonitoringParams?, authParams: LPAuthenticationParams completion: @escaping (_ response: LPGetEngagementResponse)->(), failure: @escaping (_ error: NSError)->())
Parameter Description Required
identities Mandatory array of identity objects of type LPMonitoringIdentity which includes the details on the consumer and issuer. No
monitoringParams An optional LPMonitoringParams with optional pageId, Entry Points array and Engagement Attributes. No
authParams An object of LPAuthenticationParams only to be used if JWE encryption is enabled on the account otherwise do not add this to the function arguments. This is used to pass a token to the monitoring api to be able to link to the consumer in encrypted scenarios. Each call should have new auth information. No
completion A Completion callback with response of type LPGetEngagementResponse. This response includes sessionID and visitorID for future use. Yes
failure A Failure callback with an error in case the request fails. Yes

When trying to fetch an Authenticated Engagement, the LPMonitoringIdentity parameter containing the ConsumerId is required. If using JWE account encryption it needs an authParams instead of consumer id.

sendSDE (deprecated)

This method was deprecated since SDK version 3.2.0 Use sendSDE(identity: LPMonitoringIdentity, monitoringParams: LPMonitoringParams, completion: @escaping (_ response: LPSendSDEResponse)->(), failure: @escaping (_ error: NSError)->()) instead instead.

Use this API to report on engagement attributes (SDEs) for a consumer in an appInstallationId context including show and accept impressions.

func sendSDE(consumerID: String, monitoringParams: LPMonitoringParams, completion: @escaping (_ response: LPSendSDEResponse)->(), failure: @escaping (_ error: NSError)->())
Parameter Description Required
consumerId Mandatory consumer ID from the host app Yes
monitoringParams A mandatory LPMonitoringParams with mandatory Engagement Attributes and optional PageId and entry points array Yes
completion A Completion callback with response of type LPSendSDEResponse. This response includes sessionID and visitorID for future use Yes
failure A Failure callback with an error in case the request fails Yes

getEngagement (deprecated)

This method was deprecated since SDK version 3.2.0 Use getEngagement(identity: LPMonitoringIdentity, monitoringParams: LPMonitoringParams?, completion: @escaping (_ response: LPGetEngagementResponse)->(), failure: @escaping (_ error: NSError)->()) instead) instead instead.

Use this method to get an engagement for a consumer in an appInstallationId context. When calculating eligibility, the decision is based on the SDEs and other parameters based on the messaging campaign concept.

As an optional parameter, you can pass SDE Data which includes Entry Points and Engagement Attributes for routing the conversation.

func getEngagement(consumerID: String?, monitoringParams: LPMonitoringParams?, completion: @escaping (_ response: LPGetEngagementResponse)->(), failure: @escaping (_ error: NSError)->())
Parameter Description Required
consumerId The consumer ID from the host app No
monitoringParams An optional LPMonitoringParams with optional pageId, Entry Points array and Engagement Attributes No
completion A Completion callback with response of type LPGetEngagementResponse. This response includes sessionID and visitorID for future use Yes
failure A Failure callback with an error in case the request fails Yes

Please refer to the Interface and Class Definitions section for parameter classes.