Shopify

Last updated:

Objective

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.

Prerequisites

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.

Questions?

Was this page useful?

Next article

Vue.js

PostHog makes it easy to get data about usage of your Vue.js app. Integrating PostHog into your app enables analytics about user behavior, custom events capture, session replays, feature flags, and more. This guide walks you through integrating PostHog into your app for both Vue.js major versions 2 and 3 . We'll use the JavaScript SDK. For integrating PostHog into a Nuxt.js app, see our Nuxt guide . Prerequisites To follow this guide along, you need: a PostHog account (either Cloud…

Read next article