Custom Loader for Multidomain

Hi, can multiple custom loaders be used for the multidomain website? We have 4 Shopify multidomain (.com/.de/.en/.ch) and use the Stape Business package. The backend of those 4 multidomains the same.


Yes, of course, you can generate a loader for each subdomain you have pointed to your container instance on Stape

Thanks. Yeah, we are using 4 custom domains and 4 custom loaders. Those 4 custom loaders we are using in the theme.liquid file and checkout page to connect the GTM. Our Shopify backend is the same. Is this the best practice way OR there is any other way?

no, you’re launching 4 loaders at all times, and you should just give a subdomain dynamically depending on the current domain

Okay. Can you tell me how should I do that? Is there any document or article to solve this? I didn’t find any doc regarding this from Stape.

you didn’t find anything on Stape because this has nothing to do with Stape, it’s how you embed a loader in your JS. In any case, you need something like below

if (location.hostname.includes('/de')) {
   // loader 1

else if (location.hostname.includes('/en')) {
   //loader 2


Thanks. I appreciate your help.