Class EngageBySailthru

  • All Implemented Interfaces:

    
    public final class EngageBySailthru
    
                        

    Separates logic between the core Marigold SDK functionality and that of the Sailthru only apps

    • Constructor Detail

      • EngageBySailthru

        EngageBySailthru()
    • Method Detail

      • 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#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.
        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.
      • setUserId

         final Unit setUserId(String userId, Marigold.MarigoldHandler<Void> handler)

        Set an arbitrary external User ID.

        Parameters:
        userId - An external User ID
        handler - 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.
      • 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.