Using my custom domain for the checkout page when using Buy Button

Topic summary

Issue: Checkout from embedded Shopify Buy Button sends users to shopname.myshopify.com instead of a custom domain, raising branding/credibility and analytics concerns. Some also want a “continue shopping” link and clarity on Facebook Pixel events.

Workaround reported to work: Edit the Buy Button embed (Shopify Buy Button JS SDK) and set ShopifyBuy.buildClient({ domain: “checkout.yourdomain.com”, storefrontAccessToken: “…” }). Point a subdomain (e.g., checkout.yourdomain.com) via CNAME to shops.myshopify.com and connect it in the Online Store channel. Several confirm this keeps checkout under the same root domain and preserves Google Analytics sessions; consider redirects so direct visits to the checkout subdomain don’t expose an unstyled storefront.

Requirements/notes:

  • Typically needs Basic (not Lite) to connect a domain/subdomain.
  • Update the domain everywhere it appears in the embed code (sometimes twice).
  • Buy Button cart is separate by design; it won’t merge with a Shopify theme cart.

Open issues/mixed reports: One user says changing the domain now prevents the button from rendering; status unclear. Others report cart contents not persisting when navigating and difficulties verifying subdomains (e.g., Squarespace/Webflow DNS). FB Pixel behavior and a built-in “continue shopping” link remain unanswered.

Status: No official built-in feature; community workaround widely used but with caveats.

Summarized with AI on December 18. AI used: gpt-5.

I have some good news for you all. Like you, I wanted to be able to design my own website while using Shopify checkout and was baffled that Shopify provided no way to point a domain to buy-button checkout. I spent hours chatting with Support about this, and heard many times that it’s simply “not a feature.” There’s actually an extremely simple solution that’s either not known to support or they’ve chosen not to share.

If you go into your buy button’s embed code, you’ll find a script like the following:

function ShopifyBuyInit() {
var client = ShopifyBuy.buildClient({
domain: ‘insert-custom-domain.com’,
storefrontAccessToken: ‘12345…’,
});

Yes – you can control the domain that surfaces during buy-button checkout by simply switching out the “domain” variable’s value (‘insert-custom-domain’ here for clarity) to your custom domain. I thought this was too simple to work, but confirmed this via a comment from Shopify in a tangentially related thread and it works for me.

FYI I’m using a subdomain that I’ve connected to my online-store channel in Shopify. I don’t think this solution would work without that connection.

Enjoy!

15 Likes