Master Your Shopify Login Flow: How to Redirect Customers After Login with New Customer Accounts


You've embraced Shopify's New Customer Accounts – a smart move for creating smoother, passwordless login experiences. However, you might have noticed a default behavior: customers are immediately sent to their order status page after logging in. While functional, this isn't always the ideal journey. What if they wanted to continue Browse where they left off, or perhaps you want to greet them on the homepage?


Fortunately, customizing this post-login redirect is straightforward. This guide provides step-by-step instructions to control exactly where your customers land after signing in using Shopify's New Customer Accounts, enhancing their experience and aligning it with your store's flow. Whether it's their last visited page, your homepage, or a unique welcome page, you're in control.


Why Customize the Post-Login Redirect?


  • Seamless User Experience (UX): Redirecting to the last visited page reduces friction and lets customers pick up right where they left off.

  • Consistent Branding: Sending users to the homepage reinforces your brand and presents current promotions or curated collections.

  • Targeted Engagement: Directing users to specific pages (like "New Arrivals" or a "My Account" dashboard) can guide their next steps effectively.

  • Reduced Confusion: Prevents the potential jarring experience of landing on an order page when the customer simply intended to continue shopping.


Before You Begin: Always Backup Your Theme!


Safety first! Before diving into code edits, create a backup of your live theme. This ensures you can easily revert if anything unexpected happens.

  1. From your Shopify admin, navigate to Online Store > Themes.

  2. Find your current theme, click the Actions dropdown (or the ... button).

  3. Select Duplicate.

  4. Rename the duplicated theme for clarity (e.g., "Theme Backup - Pre Login Redirect Mod").


Step 1: Locate the Correct Shopify Theme Files


The login link code is usually found in header-related files. The exact file depends on your theme:

  • Most Themes (including Shopify's free themes like Dawn):

    • Desktop Header: sections/header.liquid

    • Mobile Header/Drawer: Often in sections/header.liquid as well, or sometimes snippets/header-drawer.liquid or snippets/mobile-nav.liquid.

  • Third-Party Themes: Look for similar files. Common names include:

    • sections/header.liquid

    • snippets/navigation.liquid

    • snippets/account-links.liquid


Tip: Open the theme code editor (Actions > Edit code) and use the search bar within the editor to look for routes.account_login_url or parts of the account icon/link code to pinpoint the exact location(s). Remember to check both desktop and mobile views.


Step 2: Modify the Login Redirect URL


Once you've found the file(s) containing the login link, locate the following Liquid code snippet:

{{ routes.account_login_url }}


Now, replace it based on your desired redirect behavior:


Option A: Redirect Customers to the Last Visited Page

This is often the most user-friendly option. Replace the original code with:


{{ routes.storefront_login_url }}



This variable automatically captures the page the customer was on when they clicked 'login'.


Option B: Redirect Customers to Your Store's Homepage

To consistently send logged-in customers to your homepage, replace the original code with:


https://{{ shop.permanent_domain }}/customer_authentication/login?return_to=%2F


The %2F is the URL-encoded version of /, representing the root (homepage).


Option C: Redirect Customers to a Specific Page (e.g., "New Arrivals")

To direct customers to a custom page, like a specific collection or a dedicated account dashboard page, replace the original code with:


https://{{ shop.permanent_domain }}/customer_authentication/login?return_to={{ "/collections/new-arrivals" | url_encode }}


Important: Change /collections/new-arrivals to the relative URL of your desired landing page (e.g., /pages/welcome or /collections/all). The | url_encode filter ensures the URL is formatted correctly.


Step 3: Save, Test, and Publish


  1. Save the changes in the theme file editor.

  2. Preview your theme. Log out of your customer account (if logged in) and test the login process. Try logging in from different pages (homepage, product page, collection page) to ensure the redirect works as expected for the option you chose. Check both desktop and mobile views.

  3. Once you're confident everything is working correctly, go back to Online Store > Themes, find your edited theme (it might still be the duplicate you worked on), and click Publish.


Taking Control Further: Enhancing the Post-Purchase Journey


Customizing the login redirect is a fantastic way to refine the customer journey before they potentially make a purchase or check their orders. But what about after the order is placed?


A seamless experience shouldn't stop at login. Customers often need flexibility after purchase – maybe they selected the wrong size, need to update their shipping address, or want to add another item. This is where Revize integrates perfectly with Shopify's New Customer Accounts framework.


While you're optimizing the login flow, consider empowering your customers further with Revize. Our app allows customers to effortlessly edit their own orders directly from their order status page (the same area they access via the New Customer Accounts login), reducing support tickets and increasing customer satisfaction.


By combining a smooth, customized login redirect with post-purchase flexibility like order editing via Revize, you create a truly customer-centric experience that fosters loyalty.


Wrapping Up


Adjusting the post-login redirect in Shopify's New Customer Accounts is a simple yet powerful customization. By choosing where your customers land after signing in, you create a more intuitive and personalized shopping experience. Whether redirecting them to their last viewed page, the homepage, or a special landing page, these thoughtful touches contribute significantly to customer satisfaction and can positively impact engagement.


Happy customizing and selling!

Check Next Story

Ready to jump in?

FramerBite gives you the blocks needed to create a truly professional website for your SaaS.

FramerBite gives you the blocks needed to create a truly professional website for your SaaS.

Copyright © 2023 All Rights Reserved by FramerBite

FramerBite gives you the blocks needed to create a truly professional website for your SaaS.

Copyright © 2023 All Rights Reserved by FramerBite

FramerBite gives you the blocks needed to create a truly professional website for your SaaS.

Copyright © 2023 All Rights Reserved by FramerBite

FramerBite gives you the blocks needed to create a truly professional website for your SaaS.

Copyright © 2023 All Rights Reserved by FramerBite