Install Render Better’s Shopify theme support code

Render Better provides code for Shopify themes to help with the integration between Render Better and Shopify and to make it easier to control Render Better from within Shopify. During the onboarding to Render Better, the below code changes should be made to a Shopify theme before launching a Shopify site on Render Better.

Why is the support code needed?

During the installation of Render Better, your website’s primary domain is pointed at Render Better and a subdomain is created to point directly at Shopify. The subdomain is needed to help with any troubleshooting (see Troubleshooting Render Better), to serve as a fallback site in certain circumstances, and to help you compare performance with and without Render Better. Typically, that subdomain is a shop subdomain on your domain, such as shop.your-shopify-store.com, that is set up during your onboarding.

Provided the two domain set up, the Shopify theme support code is meant to ensure…

  1. … visitors don’t accidentally end up on that Shopify subdomain directly
  2. … search engines don’t index the Shopify subdomain

In addition to the above, the theme support code makes it easy to enable or disable Render Better and change a few of it’s settings through the Shopify Theme Customizer.

Steps to install the support code

Before you get started, it’s important understand the two domains needed by Render Better that have been set up for your site (as explained above) since they will need to be replaced in the code we provide in our support code installation instructions below.

Typically, these two domains will be:

  • Render Better Domain
    • Typically www.<domain>.com or <domain>.com
    • This is the domain that Render Better will be optimizing and where visitors will be sent
  • Shopify Subdomain
    • Typically shop.<domain>.com
    • This domain is meant to access the site without Render Better in special circumstances. Render Better will make sure visitors are sent to the Render Better domain most of the time.

Toggle each of the steps below and follow the directions provided to implement Render Better’s support code.

Add the Render Better support snippet snippets/renderbetter-support.liquid
Include the support code snippet in layouts/theme.liquid
Replace instances of the canonical link tag
Add the templates/robots.txt.liquid code
Add the config/settings_schema.json code
Add the Shopify Subdomain and Render Better Domain in the Shopify Theme Customizer

And you’re done! If you have questions, please reach out to success@renderbetter.com.