> AI agents: this is one page from PostHog's docs. Full index of Markdown docs for LLMs: https://posthog.com/llms.txt # Shopify web analytics installation Canonical URL: https://posthog.com/docs/web-analytics/installation/shopify > **Cloud region:** This page uses US Cloud hosts. For an EU Cloud project, use `https://eu.i.posthog.com` instead of `https://us.i.posthog.com` (ingestion host). ## On this page - [Open theme editor](#open-theme-editor) - [Add the PostHog snippet](#add-the-posthog-snippet) - [Send events](#send-events) - [Next steps](#next-steps) 1. 1 ## Open theme editor Required In your Shopify admin, go to **Online Store** > **Themes**. Click **Actions** > **Edit code** on your current theme. 2. 2 ## Add the PostHog snippet Required Open `theme.liquid` and paste the following code just before the closing `` tag: theme.liquid ```html ``` Click **Save**. 3. 3 ## Send events Recommended Click around and view a couple pages to generate some events. PostHog automatically captures pageviews, clicks, and other interactions for you. If you'd like, you can also manually capture custom events: JavaScript ```javascript posthog.capture('my_custom_event', { property: 'value' }) ``` See the [Shopify integration docs](https://posthog.com/docs/libraries/shopify.md) for tracking checkout events and revenue. 4. 4 ## Next steps Recommended After installing PostHog and ensuring [autocapture](https://posthog.com/docs/product-analytics/autocapture.md) is enabled, head to your [web analytics dashboard](https://posthog.com/docs/web-analytics/dashboard.md) to see your data. And then check out our [start here](https://posthog.com/docs/web-analytics/start-here.md) guide. > **PostHog tip:** Web analytics works with [anonymous events](https://posthog.com/docs/data/anonymous-vs-identified-events.md). This means if you are primarily using PostHog for web analytics, it can be significantly cheaper for you.