Delayed Guest Redirect

Use this page to learn how you can delay the guest redirect experience for Expedited Guest Checkout.

While we typically suggest calling our .guestRedirect() function as soon as a user inputs their email address for the best checkout experience, some flows may need to call it at a different time.

This function and flow is best used if you want to display Skipify only to existing users and handle non-Skipify users differently. If you'd like to display the Skipify modal for all users, regardless of existing Skipify status, we recommend using the expressCheckout function instead.

The .guestRedirect() function is able to be called from anywhere in your code, for example inside the onClick() function for a button. This allows flexibility in implementation to ensure Skipify provides the best checkout experience in your flow.

Example Flow

The following example flow demonstrates a checkout experience where a user enters their email address and then selects adding a donation. Utilizing the '.guestRedirect()' function allows the Expedited Guest Checkout flow to commence after the user selects a donation instead of when the user enters an email address.

960

Setup

To initialize the .guestredirect(), you will need to initialize our SDK as you would for the Expedited Guest Checkout experience.

You will need to:

  • Set up the SDK
  • Set up the function to create an order
  • Set up Shipping or Tax settings
  • Set up callbacks

Details on this process can be found under the 'Required SDK Features' section of the Expedited Guest Checkout flow.

Calling guestredirect

Calling the .guestRedirect() function will work exactly the same as described in the Expedited Guest Checkout section.

A sample of calling this inside of an onClick() can be found below:

// The guestRedirect function will immediated display the GoCart modal if a user exists
// If a user does not exist, we will not display anything and you may direct users wherever you'd like


const email = '[email protected]' // This would be your stored email from user input
 
const onClick = () => { // your onClick for your button
  new window.GoCartSDK.Button({
      // Insert your callbacks here. Details can be found in the 'Callbacks' page.
   }).guestRedirect(email).then(({ exists }) => {
       if (!exists) { // User does not exist
         // direct user somewhere else
      }
   });
};