Having problems installing Google analytics

Topic summary

Issue: Clarifying where to insert the Google Analytics code in a Shopify theme. The asker wondered if it should go below the and on which page.

Guidance provided:

  • Place the Google Analytics code inside the section (not below the ).
  • Steps: Shopify Admin > Online Store > Themes > (three dots on chosen theme) Edit code > Layout > open theme.liquid > find … and paste the code anywhere between those tags.

Context: In HTML, the holds scripts and metadata that load before page content, while the contains visible page elements. For GA, the recommended location is the .

Notes: A screenshot was included to illustrate the navigation and file location but is not required to follow the steps.

Status: Actionable instructions were given; no confirmation from the original poster yet, so resolution is pending.

Summarized with AI on January 26. AI used: gpt-5.

Do I need to enter code right below the body. If so in what page?

Thank you

1 Like

Hi @NineAmulets

You need to enter the code in the head. Please follow the instruction below

  1. From you Admin page, go to Online store > Themes > Click the three dots on the theme you want to edit > Edit code
  2. Go to Layout folder and open the theme.liquid file
  3. Find the and , place the code anywhere between those line of codes