Class EngageBySailthruExtensionsKt

    • Constructor Detail

    • Method Detail

      • 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

      • 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

        Parameters:
        uri - the Marigold Link to be unrolled
        Returns:

        Result containing either the unwrapped Uri or an error.