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’m not exactly sure I’m understanding the redirect question correctly, but can state how I approached our setup.

  1. I have my “store” located at domain.com. This is a WordPress hosted site with a custom theme and utilizes Shopify Buy Button JS. We are not using WooCommerce as we rely on the Shopify checkout process
  2. Within Shopify under the domain admin area I have the primary domain set as domain.com but not connected.
  3. I have a third-party domain set up which is checkout.domain.com and then a CNAME pointing checkout.domain.com > shops.myshopify.com
  4. We dynamically generate our Buy Buttons based off of the Buy Now JS SDK but the main part of it, pertaining to URLs or “how does the redirect work” is that you need to set your domain to the thrid-party domain you created earlier when you initialize your Buy Button
function ShopifyBuyInit() {
				var client = ShopifyBuy.buildClient({
					domain: "checkout.domain.com",
					storefrontAccessToken: "YOUR_TOKEN",
				});

The whole shopping experience happens on our WordPress site as the “cart” utilizes the flyout cart that is part of Shopify Buy Button JS framework. Once the user presses “checkout” this is when they jump over to checkout.domain.com and finalize their purchase.

Again, our approach was based off of needing Google Analytics to properly track the user session over the Shopify hosted checkout. Cross-domain linking within GA never appeared to work with domain.com > domain.myshopify.com as Shopify has their checkout flow somewhat locked down from a thrid-party script perspective. Since GA links sessions out of the box on the “root” domain domain.com > checkout.domain.com worked perfectly.