This guide outlines how to Photolock on a Shopify store.
It only takes a few minutes to install Photolock on your website. Once installed, you’ll be able to control & limit actions that your website's visitors can perform on your site.
<script type="text/javascript" id="photolockScript" src="https://www.photolock.io/lock.js?shop={{shop.permanent_domain}}" async defer></script>
<noscript id="photolockNoscript"><style>body *{display:none}body:before{content:"Please enable javascript to view this site"}</style></noscript>
How to use the code
Paste the code right before the closing head tag of every page.
IMPORTANT: If you copy the code snippet above you'll need to manually change your shop (this is called your shop or website domain id in the code).
You’ll need to open your website under the web domain that is part of the id value. The app will not work in preview or development modes.
Configure Domain:
After you install the script on your site, go to Photolock dashboard and click "Locks" in the navigation menu.
Find Website settings and add your custom domain
Domain settings in Photolock dashboard
Your website domain must match the value here. Most websites these days use multiple domains. At a minimum, you have a domain with "www" and also a root domain as shown below.
www.mysite.com
mysite.com
Therefore it is important to configure a primary domain for your website and add redirects to the primary domain. Photolock only accepts a single domain. In case users visit your site with other domains and there are no redirects to primary domain, Photolock will not activate.
In Shopify, you can configure your primary domain under Online Store > Domains
Shopify Domain Settings