- In your Shopify admin, go to Online Store → Themes.
- On your current (published) theme, click the … menu and choose Edit code. Shopify won’t let you edit the code of a paid theme until you’ve bought it, so a trial copy won’t work.
- In the Layout folder, open
theme.liquid. - Scroll to the closing
</body>tag and paste the Snippet just above it. - Save.
Your line
<script async src="https://cdn.sitepets.com/v1/pet.js" data-key="sp_YOUR_SITE_KEY"></script>
If it doesn’t show up
Shopify doesn’t set a Content-Security-Policy on your storefront by default, so this is almost always a pasting issue rather than a blocked request. If you added one, allow cdn.sitepets.com in script-src and img-src, and cdn.sitepets.com and b.sitepets.com in connect-src.
Updating a theme drops your code changes from the updated copy, so paste the Snippet again after updating your theme. And until you remove the storefront password, visitors only see the password page, which doesn’t run the Snippet.
Once it’s live, Claim your Pet from the browser you copied the Snippet in.