> ## Documentation Index
> Fetch the complete documentation index at: https://docs.northbeam.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Shopify Migration: Preserving Customer Stages

**This guide is for existing Northbeam customers migrating from a custom order management system using Orders API to Shopify.**

It covers one specific task: preserving your historical Customer IDs so Northbeam can continue accurately classifying customers as **New** or **Returning** after migration.

> This guide does not cover full order or customer data migration into Shopify..

***

## Why this matters

Shopify generates its own unique Customer IDs when customer records are imported. Northbeam relies on consistent Customer IDs to determine whether a customer is New or Returning.

Without this step, every existing customer will appear as a **New customer** in Northbeam — because Shopify-generated IDs have never been seen before.

To prevent this, you'll store your historical Customer IDs in a Shopify customer **metafield**, which Northbeam's engineering team will then map to your existing customer records.

***

## Before You Start

Make sure you have:

* Access to your Shopify admin
* A customer export from your previous system with **Customer IDs and email addresses intact**
* Your Northbeam pixel still active on your storefront

<Warning>
  **Important:** Do not remove the Northbeam pixel until your Shopify integration is fully verified. Running both systems in parallel during the transition prevents gaps in attribution data.
</Warning>

***

## Step 1: Create a Customer Metafield in Shopify

Do this **before** starting your migration.

1. **Login to your Shopify store** at [shopify.com](https://www.shopify.com) if you haven't already

   <img src="https://mintcdn.com/northbeam/lFRUaEN9QqdoKEgD/images/readme/1a708c52-image.png?fit=max&auto=format&n=lFRUaEN9QqdoKEgD&q=85&s=bf1b1443bdacb2b59050967bf314b144" alt="" width="1919" height="1077" data-path="images/readme/1a708c52-image.png" />
2. **Click on Settings** — find this in your Shopify homepage on the bottom left corner

<Frame caption="Metafields and metaobjects should be on the left in your settings menu">
  <img src="https://mintcdn.com/northbeam/lFRUaEN9QqdoKEgD/images/readme/bd69fe30-image.png?fit=max&auto=format&n=lFRUaEN9QqdoKEgD&q=85&s=11c5f35c79cd6b8d261192fed962907d" alt="" width="498" height="180" data-path="images/readme/bd69fe30-image.png" />
</Frame>

3. **Click on Customers**

   <img src="https://mintcdn.com/northbeam/lFRUaEN9QqdoKEgD/images/readme/e9a3f856-image.png?fit=max&auto=format&n=lFRUaEN9QqdoKEgD&q=85&s=78b7b391fcba991b57727ce847098392" alt="" width="1862" height="847" data-path="images/readme/e9a3f856-image.png" />
4. **Click Add definition** If you haven't added one before, this button will be center-stage!

   <img src="https://mintcdn.com/northbeam/lFRUaEN9QqdoKEgD/images/readme/17a229a1-image.png?fit=max&auto=format&n=lFRUaEN9QqdoKEgD&q=85&s=0fb20097b25dc55982f92e38d6301666" alt="" width="1293" height="851" data-path="images/readme/17a229a1-image.png" />
5. **Customer Metafield Details**
   1. Name: `legacy_customer_id` — note this name exactly, you'll need it later.
   2. Type: **Single line text**
   3. Validation: minimum of **1** and max of **256**

<img src="https://mintcdn.com/northbeam/lFRUaEN9QqdoKEgD/images/readme/5b01f4d3-image.png?fit=max&auto=format&n=lFRUaEN9QqdoKEgD&q=85&s=17b732700dba022307c76438a1103c28" alt="" width="1329" height="1503" data-path="images/readme/5b01f4d3-image.png" />

6. Click **Save**

The metafield namespace will default to `custom`, making the full field key `customer.metafields.custom.legacy_customer_id`

This is the column header you'll use in your CSV import.

***

## Step 2: Export customer data from your current system

Before disconnecting your old system, export your customer list. At minimum, your export must include:

* **Customer ID** (from your legacy system)
* **Email address**

Store this export securely — you'll use it to populate the import file in Step 3 and to verify your data in Step 4.

***

<Warning>
  Do not remove the Northbeam pixel from your website until your Shopify integration is fully verified. Running both in parallel during the transition prevents gaps in attribution data.
</Warning>

***

## Step 3: Format Your Customer List for Shopify

Use the [Northbam Shopify Import Template](https://docs.google.com/spreadsheets/d/1x17iJWc7gx8f13ML5hq15MeCo4D5tqg3Sb4T-9vpKa8/edit?usp=sharing) to format your data

The most common formatting mistake is getting the metafield column name wrong. It must be **exactly**:

`customer.metafields.custom.legacy_customer_id`

***

## Step 4: Import your Customers into Shopify

Proceed to your **Customers** page in Shopify.

1. In the top left corner, click Import:

<img src="https://mintcdn.com/northbeam/lFRUaEN9QqdoKEgD/images/readme/57cd04c0-image.png?fit=max&auto=format&n=lFRUaEN9QqdoKEgD&q=85&s=57c17d098cc789978859eaf1d3eeed8b" alt="" width="346" height="64" data-path="images/readme/57cd04c0-image.png" />

2. Import your CSV files!

   <img src="https://mintcdn.com/northbeam/lFRUaEN9QqdoKEgD/images/readme/a40d5fea-image.png?fit=max&auto=format&n=lFRUaEN9QqdoKEgD&q=85&s=53eb8500c717e7cf6d0c92673a5c4630" alt="" width="803" height="354" data-path="images/readme/a40d5fea-image.png" />

   *We recommend following the [following template](https://docs.google.com/spreadsheets/d/1x17iJWc7gx8f13ML5hq15MeCo4D5tqg3Sb4T-9vpKa8/edit?usp=sharing) for guidance  -- as the template that Shopify provides does not account for Customer metafields*

***

## Step 5: Notify your CSM at Northbeam

Once your data has been uploaded, inform your CSM at Northbeam along with the name of your **legacy customer\_id** field.  Once we have this, the Northbeam engineering Team can map your old Customer IDs into your dashboard, preserving customer stages.
