How can I add a tracking script to every page quickly?

Topic summary

Adding a tracking script across all store pages was resolved by placing the code in theme.liquid, which loads on every page. The recommended location was just before the closing </head> tag, though </body> was also mentioned earlier as a possible placement.

Key points:

  • The shared snippet is JavaScript and marked async (asynchronous), meaning it should load without blocking the rest of the page.
  • Because the app requested the code on “all pages,” editing theme.liquid was identified as the quickest site-wide solution.
  • A code sample was provided, and participants confirmed it should work when inserted into the theme file.

Outcome:

  • The original question appears resolved: the script was added and the poster indicated it seemed to be working.
  • No further technical issues were raised after that.

A later promotional link about another tracking tool appeared, but it was not relevant to resolving the original setup question.

Summarized with AI on March 8. AI used: gpt-5.4.

@JustG - any screenshot of the code?

most probably it is javascript and put it before in theme.liquid file

1 Like