How does Shopify's multi-domain setup integrate with AMP?

Written By Stephen Gardner (Super Administrator)

Updated at June 8th, 2021

Shopify allows you to connect multiple domains to a single Shopify store.  For example, you can have "mystore.com" and "mystore.co.uk" connected to the same Shopify store.

When using AMP, it is only possible to generate AMP pages in the original shop's language and currency.  This means that the second connected domain can still have AMP pages, but these will still be in the original language and currency.  Because of this, if your secondary domain uses a different language or currency, you might want to disable AMP for the second domain, which we will discuss below.  If your secondary domain does not use a different language and currency, you may want to keep the AMP pages active for both domains.  This is totally up to you.  Next, we'll show you how to view the AMP pages for each domain to see if they are suitable for your needs.

Viewing your AMP pages for each domain

You can access the AMP page URL immediately by clicking a product from your AMP Pages admin panel.

  • Open the AMP Pages section of the AMP app.
  • Click on any product
  • Click on the AMP URL to open the AMP page
  • To view the AMP page in the second domain, manually edit the page in the address bar.  For example, if your site is mystore.com, and your other site is mystore.co.uk, simply change .com to .co.uk, and leave the rest of the URL untouched.  This will open the AMP page in the secondary domain.

If this secondary AMP page doesn't suit your needs, we recommend disabling AMP for this domain (discussed below).  If this secondary AMP page does suit your needs, you're all set, and you can end here.

Disabling AMP for your secondary domain(s)

To disable AMP for your secondary domain(s), you'll simply adjust one line of code in your Shopify's theme.liquid file, to make sure that the AMP snippet is only added on the main domain.

  • Open your Shopify's theme.liquid file.
  • Locate this line of code: {% include 'shop-sheriff-amp' %}
    Note: if this code is not there, it is because you haven't published any pages from the Page Visiblity section of the app, so you should first publish any portion of your shop on AMP, and then this code will be visible.
  • Replace this line of code with the following lines of code (make sure to change mystore.com with the domain of your website): 
    {% if request.host == 'mystore.com' %}
      {% include 'shop-sheriff-amp' %}
    {% endif %}

Once complete, this will make sure that Google does not index your AMP pages for any other domain other than your main domain.  This will be the ideal result.  Note that the AMP page will still be viewable via the unique AMP URL, but since Google does not see the AMP snippet on that version of your site, they will not index the AMP version of this page.

Can I redirect users from one domain to the other on AMP?

No. Since Google crawls websites primarily from the USA, even international websites, but has also been known to crawl from other countries, predicting a crawler's location is inherently unreliable.  If you choose to build in an auto-redirection feature, this can therefore confuse crawlers, and severely impact your SEO, so we never recommend this.  Furthermore, for AMP pages, Google caches AMP pages and does not allow either client-side or server-side automatic redirection, so performing an automatic redirect is inherently impossible on AMP.  To avoid being indexed in a certain country, the above method of Disabling AMP for a secondary domain is the ideal method to address this issue.  When you disable AMP for a secondary domain, Google will not index the AMP version of that page.  There is no way to automatically redirect users from one page to another page when visiting AMP pages.

I am set on having my AMP pages in multiple languages, how can I go about doing this?

The only translation app that we know that integrates with AMP is GTranslate.  GTranslate will be able to take the AMP pages that you build with Shop Sheriff, and translate them into multiple languages.  This method does not use the Shopify multi-domain setup.  Instead, GTranslate manages this for you on their end.  To get started using GTranslate, or for any queries regarding translating AMP pages with GTranslate, we recommend contacting their awesome support team and they'll be happy to help out.

Was this article helpful?