Install Tidemark on Shopify
You add the Tidemark script to your theme once, and it runs on your storefront pages.
Your site's Settings → Tracking tab shows this same code with your domain and script already filled in, under Install on → Shopify. Each site has its own script file name (a short code such as 3fa91c0b2e.js), so copy the code from there rather than typing it.
Steps#
- In your Shopify admin, go to Online Store → Themes → Edit code.
- Open
layout/theme.liquid. - Paste the snippet just before the closing
</head>tag, then save:
<script defer data-domain="example.com" src="https://YOUR-TIDEMARK/js/YOUR-SCRIPT.js"></script>
Replace example.com with the domain you added in Tidemark.
Good to know#
- The snippet lives in your theme, so it applies to pages that use
theme.liquid. - If you switch themes, add the snippet to the new one.
Record your own events#
Call window.plausible('Signup') to record a custom event, with optional properties: window.plausible('Signup', { props: { plan: 'pro' } }). Call it from your theme's JavaScript, in response to something the visitor does. Create a matching goal in your site's settings to see it under Behaviors.
Check that it works#
Open your site in a private window, then look at your Tidemark dashboard. Visits from localhost are ignored, so test on a real address.
If nothing shows up:
- Make sure the domain in the snippet matches the domain you added in Tidemark.
- Turn off any ad blocker for your own test, and check the browser console for a blocked request.
- Make sure the script address in the snippet is reachable from the visitor's browser.