Class EngageBySailthruExtensionsKt
-
- All Implemented Interfaces:
public final class EngageBySailthruExtensionsKt
-
-
Method Summary
Modifier and Type Method Description final static Unit
clearEvents(EngageBySailthru $self)
Clear device events data. final static Result<Unit>
clearEventsResult(EngageBySailthru $self)
Clear device events data. final static Unit
setUserEmail(EngageBySailthru $self, String userEmail)
Set the User's Email. final static Result<Unit>
setUserEmailResult(EngageBySailthru $self, String userEmail)
Set the User's Email. final static Unit
setUserId(EngageBySailthru $self, String userId)
Set an arbitrary external User ID. final static Result<Unit>
setUserIdResult(EngageBySailthru $self, String userId)
Set an arbitrary external User ID. final static Unit
trackPageview(EngageBySailthru $self, URI url, List<String> tags)
Asynchronously registers that the given "page" has been viewed with Marigold SPM. final static Result<Unit>
trackPageviewResult(EngageBySailthru $self, URI url, List<String> tags)
Asynchronously registers that the given "page" has been viewed with Marigold SPM. final static Unit
trackImpression(EngageBySailthru $self, String sectionId, List<URI> urls)
Asynchronously registers an impression - a reasonable expectation that a user has seen a piece of content - with Marigold SPM. final static Result<Unit>
trackImpressionResult(EngageBySailthru $self, String sectionId, List<URI> urls)
Asynchronously registers an impression - a reasonable expectation that a user has seen a piece of content - with Marigold SPM. final static Unit
trackClick(EngageBySailthru $self, String sectionId, URI url)
Asynchronously registers with Marigold SPM that a section has been clicked/tapped on, transitioning the user to a detail view final static Result<Unit>
trackClickResult(EngageBySailthru $self, String sectionId, URI url)
Asynchronously registers with Marigold SPM that a section has been clicked/tapped on, transitioning the user to a detail view final static Unit
setProfileVars(EngageBySailthru $self, JSONObject vars)
Set the profile vars through the SDK. final static Result<Unit>
setProfileVarsResult(EngageBySailthru $self, JSONObject vars)
Set the profile vars through the SDK. final static JSONObject
getProfileVars(EngageBySailthru $self)
Retrieve the profile vars set on the server. final static Result<JSONObject>
getProfileVarsResult(EngageBySailthru $self)
Retrieve the profile vars set on the server. final static Unit
logPurchase(EngageBySailthru $self, Purchase purchase)
Logs a purchase with the Marigold platform. final static Result<Unit>
logPurchaseResult(EngageBySailthru $self, Purchase purchase)
Logs a purchase with the Marigold platform. final static Unit
logAbandonedCart(EngageBySailthru $self, Purchase purchase)
Logs a cart abandonment with the Marigold platform. final static Result<Unit>
logAbandonedCartResult(EngageBySailthru $self, Purchase purchase)
Logs a cart abandonment with the Marigold platform. final static Uri
handleSailthruLink(EngageBySailthru $self, Uri uri)
If you're using Marigold email with universal links, your application will open with an encoded Marigold link url. final static Result<Uri>
handleSailthruLinkResult(EngageBySailthru $self, Uri uri)
If you're using Marigold email with universal links, your application will open with an encoded Marigold link url. -
-
Method Detail
-
clearEvents
final static Unit clearEvents(EngageBySailthru $self)
Clear device events data.
-
clearEventsResult
final static Result<Unit> clearEventsResult(EngageBySailthru $self)
Clear device events data.
- Returns:
Result representing the outcome of the request
-
setUserEmail
final static Unit setUserEmail(EngageBySailthru $self, String userEmail)
Set the User's Email.
- Parameters:
userEmail
- the User's Email
-
setUserEmailResult
final static Result<Unit> setUserEmailResult(EngageBySailthru $self, String userEmail)
Set the User's Email.
- Parameters:
userEmail
- the User's Email- Returns:
Result representing the outcome of the request.
-
setUserId
final static Unit setUserId(EngageBySailthru $self, String userId)
Set an arbitrary external User ID.
- Parameters:
userId
- An external User ID.
-
setUserIdResult
final static Result<Unit> setUserIdResult(EngageBySailthru $self, String userId)
Set an arbitrary external User ID.
- Parameters:
userId
- An external User ID.- Returns:
Result representing the outcome of the request.
-
trackPageview
final static Unit trackPageview(EngageBySailthru $self, URI url, List<String> tags)
Asynchronously registers that the given "page" has been viewed with Marigold SPM. Note that a Content View here directly corresponds to a page view in SPM.
- Parameters:
url
- The URL of the page we're tracking a view of.tags
- Tags for this page.
-
trackPageviewResult
final static Result<Unit> trackPageviewResult(EngageBySailthru $self, URI url, List<String> tags)
Asynchronously registers that the given "page" has been viewed with Marigold SPM. Note that a Content View here directly corresponds to a page view in SPM.
- Parameters:
url
- The URL of the page we're tracking a view of.tags
- Tags for this page.- Returns:
Result representing the outcome of the request
-
trackImpression
final static Unit trackImpression(EngageBySailthru $self, String sectionId, List<URI> urls)
Asynchronously registers an impression - a reasonable expectation that a user has seen a piece of content - with Marigold SPM. Can be used in conjunction with
RecyclerView.Adapter#onViewAttachedToWindow
or similar to know when a particular content item has entered the user's viewport.- Parameters:
sectionId
- the Section ID on Marigold SPM corresponding to the section being viewed.urls
- a List of the URLs of the items contained within this section.
-
trackImpressionResult
final static Result<Unit> trackImpressionResult(EngageBySailthru $self, String sectionId, List<URI> urls)
Asynchronously registers an impression - a reasonable expectation that a user has seen a piece of content - with Marigold SPM. Can be used in conjunction with
RecyclerView.Adapter#onViewAttachedToWindow
or similar to know when a particular content item has entered the user's viewport.- Parameters:
sectionId
- the Section ID on Marigold SPM corresponding to the section being viewed.urls
- a List of the URLs of the items contained within this section.- Returns:
Result representing the outcome of the request
-
trackClick
final static Unit trackClick(EngageBySailthru $self, String sectionId, URI url)
Asynchronously registers with Marigold SPM that a section has been clicked/tapped on, transitioning the user to a detail view
- Parameters:
sectionId
- the ID of the section to track a click for.url
- the URL of the detail being transitioned to.
-
trackClickResult
final static Result<Unit> trackClickResult(EngageBySailthru $self, String sectionId, URI url)
Asynchronously registers with Marigold SPM that a section has been clicked/tapped on, transitioning the user to a detail view
- Parameters:
sectionId
- the ID of the section to track a click for.url
- the URL of the detail being transitioned to.- Returns:
Result representing the outcome of the request
-
setProfileVars
final static Unit setProfileVars(EngageBySailthru $self, JSONObject vars)
Set the profile vars through the SDK.
- Parameters:
vars
- JSONObject containing the vars to set on the server.
-
setProfileVarsResult
final static Result<Unit> setProfileVarsResult(EngageBySailthru $self, JSONObject vars)
Set the profile vars through the SDK.
- Parameters:
vars
- JSONObject containing the vars to set on the server.- Returns:
Result representing the outcome of the request.
-
getProfileVars
final static JSONObject getProfileVars(EngageBySailthru $self)
Retrieve the profile vars set on the server.
- Returns:
JSONObject containing the profile vars. May be null
-
getProfileVarsResult
final static Result<JSONObject> getProfileVarsResult(EngageBySailthru $self)
Retrieve the profile vars set on the server.
- Returns:
Result containing either JSONObject with profile vars or an error.
-
logPurchase
final static Unit logPurchase(EngageBySailthru $self, Purchase purchase)
Logs a purchase with the Marigold platform. This can be used for mobile purchase attribution.
- Parameters:
purchase
- The purchase to log with the platform.
-
logPurchaseResult
final static Result<Unit> logPurchaseResult(EngageBySailthru $self, Purchase purchase)
Logs a purchase with the Marigold platform. This can be used for mobile purchase attribution.
- Parameters:
purchase
- The purchase to log with the platform.- Returns:
Result representing the outcome of the request.
-
logAbandonedCart
final static Unit logAbandonedCart(EngageBySailthru $self, Purchase purchase)
Logs a cart abandonment with the Marigold platform. Use this to initiate cart abandoned flows.
- Parameters:
purchase
- The abandoned purchase to log with the platform.
-
logAbandonedCartResult
final static Result<Unit> logAbandonedCartResult(EngageBySailthru $self, Purchase purchase)
Logs a cart abandonment with the Marigold platform. Use this to initiate cart abandoned flows.
- Parameters:
purchase
- The abandoned purchase to log with the platform.- Returns:
Result representing the outcome of the request.
-
handleSailthruLink
final static Uri handleSailthruLink(EngageBySailthru $self, Uri uri)
If you're using Marigold email with universal links, your application will open with an encoded Marigold link url. This method will decode the link URL and return its canonical location (ie https://link.sailthru.com/blahblah will redirect to https://www.sailthru.com/careers/list/, the link's canonical location), as well as making sure that the clickthrough metrics for this link are correctly attributed in the Marigold platform. This method should be called from your receiving activity's
onStart()
method, and handle the starting intent's link data- Parameters:
uri
- the Marigold Link to be unrolled- Returns:
the destination that the Marigold link points to
-
handleSailthruLinkResult
final static Result<Uri> handleSailthruLinkResult(EngageBySailthru $self, Uri uri)
If you're using Marigold email with universal links, your application will open with an encoded Marigold link url. This method will decode the link URL and return its canonical location (ie https://link.sailthru.com/blahblah will redirect to https://www.sailthru.com/careers/list/, the link's canonical location), as well as making sure that the clickthrough metrics for this link are correctly attributed in the Marigold platform. This method should be called from your receiving activity's
onStart()
method, and handle the starting intent's link data
-
-
-
-