Tracking and installation

Install UserTrail on Shopify

Add the UserTrail tracking snippet to a Shopify storefront and verify that sessions are recording.

Updated Jun 19, 20262 min read

Before you start

Create a site in UserTrail and copy the tracking snippet for the Shopify store you want to track.

You need permission to edit the Shopify theme or manage customer events, depending on how your store is set up.

Install through theme code

For many Shopify storefronts, you can add the UserTrail snippet to the theme layout.

General steps:

  1. In Shopify admin, open Online Store.
  2. Open Themes.
  3. Choose the active theme and open the code editor.
  4. Find the main layout file, often theme.liquid.
  5. Paste the UserTrail snippet before the closing </head> tag.
  6. Save and publish the change.

After saving, visit the storefront and confirm the snippet loads.

Shopify stores may have consent, privacy, or checkout restrictions depending on plan, region, and storefront setup.

If analytics consent is required, load UserTrail only after the visitor grants analytics consent.

Do not record sensitive payment information or private checkout details. Use masking and avoid installing tracking where sensitive data cannot be protected.

Verify recording

Open the live Shopify storefront and complete a test visit:

  1. View a product page.
  2. Add a product to cart.
  3. Navigate between pages.
  4. Wait for processing.
  5. Open UserTrail Sessions and Heatmaps.

Confirm the page paths, clicks, and device type look correct.

Troubleshooting

If no sessions appear:

  • confirm the active theme contains the snippet
  • check that the snippet site id matches UserTrail
  • confirm tag or consent rules allow the script to load
  • test without ad blockers
  • check browser developer tools for blocked requests

If only some pages record, the snippet may be missing from a template or restricted page.