Getting started: Shopify to Segment connection

Updated on 2021-12-24

Littledata provides a Segment connection for Shopify and Shopify Plus. The app automatically fixes ecommerce tracking and lets you use Shopify as a Segment source. It automatically tracks key events and page views, then sends that data to Segment.

How to install ' by Littledata'

  1. Login to your Shopify account.
  2. Go the Shopify app store listing for by Littledata:

Segment app

  1. Click Add app to begin the installation process.
  2. Configure Segment. Log into your Segment workspace, and Connect Shopify (by  Littledata):

Create a Shopify source for Segment

  1. You will need to add your Segment workshop write key. Follow this guide to find your write key, then enter it and hit NEXT.

Add a Segment write key


If you want to add the tracking code manually, please continue reading section B) below

A) Automatic route

  1. Select the Automatic route to add the tracking code automatically. The tracking code and Segment's analytics.js library will be automatically added to your store:

Choose Manual or Automatic Shopify install

  1. Installation is complete! You will now start receiving data from Shopify to Segment, including sales data and checkout steps:

B) Manual route

Manual installation requires you to paste Littledata's code into your store layout. This is recommended for projects under source control, as it ensures that our code will not be overwritten when you make site updates

  1. Select the Manual route to paste the code manually into your Shopify layouts and click next:

  1. You will then be instructed to add the scripts to your code. Click COPY, which will copy the script to clipboard:

  1. Go to your Shopify Admin > Online Store > Themes > Actions > Edit code and create a new snippet named LittledataLayer. Paste the script you copied in the previous step, and click Save.

  1. Then you will copy the three-line code and paste the snippet in every one of your store’s Layouts, just above the  tag. In the example below, we’ll paste the snippet in row 75:

  1. After you finish the above steps, hit NEXT. You will now start receiving data from Shopify to Segment, including sales data and checkout steps.

You will now be able to send data from Shopify to hundreds of Segment destinations. You can send data from Segment to Google Analytics by following the steps described here.*

Please see our Segment FAQ for answers to common questions. You can email the Littledata team at if anything is unclear.