Last updated:


Integrating PostHog with your Shopify store

Why is this useful?

Tracking how users use your Shopify store can help you improve the user experience and increase conversion rates on your e-shop.


To follow this tutorial along, you should:

  1. Have deployed PostHog or be using PostHog Cloud.

Step-by-step instructions

  1. Get your PostHog snippet from your 'Project Settings' or the initial PostHog setup

  2. Login to your Shopify dashboard

  3. Go to 'Online Store' -> 'Themes' (see image below)

  4. On your theme, click 'Actions' -> 'Edit code' (see image below)

    Shopify Dashboard

  5. You should now be seeing a code editor. Click on theme.liquid under 'Layout' on the left sidebar (see image below)

  6. Navigate until you see the closing </head> tag. Paste your snippet there, before that tag, like in the image below:

    Shopify Dashboard

  7. Click the green save button on the top right and you're good to go - PostHog should now be working on your Shopify store!

To confirm PostHog is configured correctly, visit your store and then check if the events from your session appear in PostHog. Note that this may take a few minutes.


Was this page useful?

Next article


Getting analytics about your WordPress site is simple with PostHog. Get data about traffic, usage, and user behavior with our free, open-source analytics platform. Once you have that data, you can discover insights and build dashboards with our suite of analytics tools. In this guide, we'll walk you through how to set up PostHog on your WordPress site. You can do this by adding our JavaScript snippet to the header of your WordPress site directly, or by using a third-party plugin to insert the…

Read next article