Class EngageBySailthru
- 
                    
                    
- All Implemented Interfaces:
 
public final class EngageBySailthruSeparates logic between the core Marigold SDK functionality and that of the Sailthru only apps
 
- 
                
                    
                    
- 
                                
                            
                                
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceEngageBySailthru.AttributesHandlerHandler interface for setting custom attributes on the device
public interfaceEngageBySailthru.TrackHandler 
- 
                                
                            
                                
Constructor Summary
Constructors Constructor Description EngageBySailthru() 
- 
                                
                            
                                
Method Summary
Modifier and Type Method Description final UnitsetAttributes(AttributeMap attributeMap, EngageBySailthru.AttributesHandler handler)Asynchronously registers an AttributeMap object with Marigold Mobile. final UnitsetAttributes(AttributeMap attributeMap)Asynchronously registers an AttributeMap object with Marigold Mobile. final UnitremoveAttribute(String key, EngageBySailthru.AttributesHandler handler)Remove a currently set attribute from this Device. final UnitremoveAttribute(String key)Remove a currently set attribute from this Device. final UnitclearAttributes(EngageBySailthru.AttributesHandler handler)Clear device attributes data. final UnitclearAttributes()Clear device attributes data. final UnittrackPageview(URI url, List<String> tags, EngageBySailthru.TrackHandler handler)Asynchronously registers that the given "page" has been viewed with Marigold SPM. final UnittrackImpression(String sectionId, List<URI> urls, EngageBySailthru.TrackHandler handler)Asynchronously registers an impression - a reasonable expectation that a user has seen a piece of content - with Marigold SPM. final UnittrackClick(String sectionId, URI url, EngageBySailthru.TrackHandler handler)Asynchronously registers with Marigold SPM that a section has been clicked/tapped on, transitioning the user to a detail view final UnitsetUserEmail(String userEmail, Marigold.MarigoldHandler<Void> handler)Set the User's Email. final UnitsetUserId(String userId, Marigold.MarigoldHandler<Void> handler)Set an arbitrary external User ID. final UnitlogEvent(String value, JSONObject vars)Log a Marigold Mobile event with associated vars. final UnitlogEvent(String value)Log a Marigold Mobile event with associated vars. final UnitlogEvent(EventSource source, String value)Log an event from a third party source. final UnitclearEvents(Marigold.MarigoldHandler<Void> handler)Clear the custom events from the device data. final UnitsetProfileVars(JSONObject vars, Marigold.MarigoldHandler<Void> handler)Set the profile vars through the SDK. final UnitgetProfileVars(Marigold.MarigoldHandler<JSONObject> handler)Retrieve the profile vars set on the server. final UrihandleSailthruLink(Uri uri, Marigold.MarigoldHandler<Void> handler)If you're using Marigold email with universal links, your application will open with an encoded Marigold link url. final UnitlogPurchase(Purchase purchase, Marigold.MarigoldHandler<Void> handler)Logs a purchase with the Marigold platform. final UnitlogAbandonedCart(Purchase purchase, Marigold.MarigoldHandler<Void> handler)Logs a cart abandonment with the Marigold platform. - 
                    
                    
                    
- 
                                
                            
                                
Method Detail
- 
                                        
setAttributes
@JvmOverloads() final Unit setAttributes(AttributeMap attributeMap, EngageBySailthru.AttributesHandler handler)
Asynchronously registers an AttributeMap object with Marigold Mobile.
- Parameters:
 attributeMap- an AttributeMap with the desired attributes set.handler- callback handler
 
- 
                                        
setAttributes
@JvmOverloads() final Unit setAttributes(AttributeMap attributeMap)
Asynchronously registers an AttributeMap object with Marigold Mobile.
- Parameters:
 attributeMap- an AttributeMap with the desired attributes set.
 
- 
                                        
removeAttribute
@JvmOverloads() final Unit removeAttribute(String key, EngageBySailthru.AttributesHandler handler)
Remove a currently set attribute from this Device. If attribute is not currently set, does nothing.
- Parameters:
 key- key of the attribute to removehandler- callback handler
 
- 
                                        
removeAttribute
@JvmOverloads() final Unit removeAttribute(String key)
Remove a currently set attribute from this Device. If attribute is not currently set, does nothing.
- Parameters:
 key- key of the attribute to remove
 
- 
                                        
clearAttributes
@JvmOverloads() final Unit clearAttributes(EngageBySailthru.AttributesHandler handler)
Clear device attributes data.
- Parameters:
 handler- callback handler
 
- 
                                        
clearAttributes
@JvmOverloads() final Unit clearAttributes()
Clear device attributes data.
 
- 
                                        
trackPageview
final Unit trackPageview(URI url, List<String> tags, EngageBySailthru.TrackHandler handler)
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.handler- an instance of TrackHandler.
 
- 
                                        
trackImpression
final Unit trackImpression(String sectionId, List<URI> urls, EngageBySailthru.TrackHandler handler)
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#onViewAttachedToWindowor 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.handler- an instance of TrackHandler.
 
- 
                                        
trackClick
final Unit trackClick(String sectionId, URI url, EngageBySailthru.TrackHandler handler)
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.handler- an instance of TrackHandler.
 
- 
                                        
setUserEmail
final Unit setUserEmail(String userEmail, Marigold.MarigoldHandler<Void> handler)
Set the User's Email.
- Parameters:
 userEmail- the User's Emailhandler- MarigoldHandler callback on success or failure to update user Email
 
- 
                                        
setUserId
final Unit setUserId(String userId, Marigold.MarigoldHandler<Void> handler)
Set an arbitrary external User ID.
- Parameters:
 userId- An external User IDhandler- MarigoldHandler callback on success or failure to update user ID
 
- 
                                        
logEvent
@JvmOverloads() final Unit logEvent(String value, JSONObject vars)
Log a Marigold Mobile event with associated vars. If value is null or an empty string, no event will be generated.
- Parameters:
 value- The event's name.vars- The vars associated with this event.
 
- 
                                        
logEvent
@JvmOverloads() final Unit logEvent(String value)
Log a Marigold Mobile event with associated vars. If value is null or an empty string, no event will be generated.
- Parameters:
 value- The event's name.
 
- 
                                        
logEvent
final Unit logEvent(EventSource source, String value)
Log an event from a third party source. If value is null or an empty string, no event will be generated.
- Parameters:
 source- An EventSource identifying the source of the third-party event.value- The event's name.
 
- 
                                        
clearEvents
final Unit clearEvents(Marigold.MarigoldHandler<Void> handler)
Clear the custom events from the device data.
- Parameters:
 handler- callback handler
 
- 
                                        
setProfileVars
final Unit setProfileVars(JSONObject vars, Marigold.MarigoldHandler<Void> handler)
Set the profile vars through the SDK.
- Parameters:
 vars- JSONObject containing the vars to set on the server.handler- callback handler.
 
- 
                                        
getProfileVars
final Unit getProfileVars(Marigold.MarigoldHandler<JSONObject> handler)
Retrieve the profile vars set on the server.
- Parameters:
 handler- callback handler.
 
- 
                                        
handleSailthruLink
final Uri handleSailthruLink(Uri uri, Marigold.MarigoldHandler<Void> handler)
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
 
- 
                                        
logPurchase
final Unit logPurchase(Purchase purchase, Marigold.MarigoldHandler<Void> handler)
Logs a purchase with the Marigold platform. This can be used for mobile purchase attribution.
- Parameters:
 purchase- The purchase to log with the platform.handler- callback handler.
 
- 
                                        
logAbandonedCart
final Unit logAbandonedCart(Purchase purchase, Marigold.MarigoldHandler<Void> handler)
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.handler- callback handler.
 
 - 
                                        
 
 - 
                                
                            
                                
 
 - 
                    
                    
                    
 
 -