Shopify
Add one script tag to your theme. Takes two minutes.
Steps
- In your Shopify admin, go to Online Store > Themes.
- Next to your live theme, click the three dots (or Customize) and choose Edit code.
- Open layout/theme.liquid.
- Paste the snippet below just before the closing </head> tag.
- Click Save.
The snippet
Replace SITE_ID with the ID from your Glyphex site settings.
<script defer src="https://glyphex.io/t/SITE_ID.js"></script>
Shopify custom pixels (Settings > Customer events) run in a sandbox, which limits what a tracker can see. Use theme.liquid instead.
Verify it works
Open your live site in a new tab, then open Realtime in your Glyphex dashboard. Your visit should show up within a few seconds.
Track custom events
Add data attributes in your theme files. Liquid values work inside them:
<!-- In a theme section or snippet -->
<button
data-glyphex-event="add_to_cart_click"
data-glyphex-event-product="{{ product.handle }}"
>
Add to cart
</button>Events can also be sent with window.analytics.track(name, props) or the declarative data-glyphex-event and data-glyphex-event-<prop> attributes.
Troubleshooting
- No data? Check that the Site ID matches exactly and the page was republished or the cache cleared.
- Ad blockers can block analytics scripts. Disable yours to test.
- Content Security Policy: allow https://glyphex.io in both script-src and connect-src.
- Check DevTools > Network for a request to glyphex.io/t/. A 404 means the Site ID is wrong.