Skip to main content
Shopify Customer Data Sync pushes user answers from Nudj question actions directly into Shopify customer metafields. This enables you to use Shopify’s native customer segment builder to target customers based on their Nudj engagement data — no CSV exports, no manual data entry.
Prerequisite: Your community must have a linked Shopify store with the write_customers OAuth scope. Existing Shopify installations are automatically prompted for re-consent when the scope is added.

How It Works

1

Admin Configures Hydration

On a question action, enable data hydration and configure the Shopify sync section. Nudj automatically creates the metafield definition on your Shopify store.
2

User Answers the Question

When a user completes the action, Nudj stores the answer locally and queues an async job to sync it to Shopify.
3

Metafield is Written

The queue job writes the resolved value to the customer’s metafield in Shopify using the $app:nudj namespace. If the customer doesn’t exist in Shopify (no externalUserId), the sync is silently skipped.
4

Segment in Shopify

Use Shopify’s customer segment builder to create segments based on the synced metafield values. For example: “Customers where Favorite Color is Blue”.

Shopify-Specific Configuration

When Shopify sync is enabled on a data hydration config, additional settings become available:

Pin to Customer Detail

When enabled, the metafield appears directly on the customer detail page in your Shopify admin. This makes the data immediately visible when viewing a customer profile.
Pin fields that your support or sales team needs to see at a glance — like preference data or quiz results. Leave unpinned for fields used primarily for segmentation.

Display Name and Description

These values appear in the Shopify admin when viewing metafield definitions. Use clear, descriptive names so your Shopify team understands what each field represents.
  • Display Name: Shown as the field label (e.g., “Favorite Color”)
  • Description: Shown as help text (e.g., “Answer from the Style Quiz challenge”)

Type Mapping

Nudj data types map to Shopify metafield types automatically:
Nudj TypeShopify Metafield TypeNotes
Textsingle_line_text_fieldStandard text metafield
Integernumber_integerWhole numbers
Decimalnumber_decimalDecimal numbers (JSON format)
BooleanbooleanTrue/false values
DatedateISO date string
For boolean expansion mode, each expanded field is always created as a boolean type in Shopify, regardless of the parent field’s data type.

Metafield Namespace

All Nudj-synced metafields use the $app:nudj namespace. This is a Shopify app-reserved namespace that:
  • Prevents naming conflicts with other apps or custom metafields
  • Groups all Nudj data together in the Shopify admin
  • Is automatically associated with your Shopify app installation

Boolean Expansion in Shopify

Boolean expansion is particularly powerful with Shopify because Shopify’s customer segment builder supports boolean filters natively. Example: A “Pick your interests” question with options: Sports, Music, Travel, Food, Tech This creates 5 metafield definitions:
Metafield KeyTypeValue (user selected Sports + Travel)
interests_sportsbooleantrue
interests_musicbooleanfalse
interests_travelbooleantrue
interests_foodbooleanfalse
interests_techbooleanfalse
Segment example: interests_sports = true AND interests_travel = true finds customers interested in both sports and travel.
Boolean expansion is limited to 5 options per action. Each option consumes one metafield definition slot out of the 256 available per namespace. Plan your expansion fields carefully.

Capacity Management

Shopify allows a maximum of 256 custom metafield definitions per namespace per resource type. Nudj checks this limit before creating new definitions.

How Definitions Are Counted

ConfigDefinitions Used
Standard field (Text, Integer, etc.)1
Comma Separated multi-select1
Boolean Expansion (3 options)3
Boolean Expansion (5 options)5

Approaching the Limit

The admin panel warns when you’re approaching the 256-definition limit. New configurations that would exceed the limit are rejected at save time with a clear error message.
Use comma-separated mode instead of boolean expansion when you have many options or don’t need per-option filtering. It uses only 1 definition regardless of option count.

OAuth Scope Requirements

Shopify Customer Data Sync requires the write_customers scope on your Shopify app installation.

New Installations

New Shopify app installations automatically include the write_customers scope. No additional setup is needed.

Existing Installations

Existing installations are prompted for re-consent automatically. When a merchant next accesses the Nudj Shopify app, Shopify’s authenticate.admin() detects the scope difference and presents the consent screen.
No manual action is needed from the merchant beyond accepting the updated permissions when prompted.

Error Handling and Retries

Shopify sync is designed to be resilient:
ScenarioBehavior
Shopify API temporarily unavailableJob retried automatically (up to 5 times with backoff)
Customer has no externalUserIdSync silently skipped — data still stored in Nudj
Community has no Shopify credentialsSync silently skipped
Rate limit exceededJob retried after backoff
Invalid metafield valueMarked as failed, not retried
Type coercion failedNudj data stored, Shopify sync skipped
The user’s participation in the challenge is never blocked or affected by Shopify sync status. All sync happens asynchronously after participation is confirmed.

Segmentation Examples

Once data is synced, use Shopify’s customer segment builder:
Use CaseSegment Query
Customers who prefer bluefavorite_color = 'Blue'
Customers who rated 4+ starsproduct_rating >= 4
Customers interested in sportsinterests_sports = true
Customers with a birthday in Marchcustomer.metafields.app_nudj.birthday.month = 3
Customers who answered the quizquiz_answer IS NOT NULL
These segments can then be used for targeted email campaigns, personalized storefront experiences, and marketing automation within Shopify.

Troubleshooting

  • Verify the user has an externalUserId (linked Shopify customer)
  • Check that the community has active Shopify credentials
  • Ensure the write_customers scope is granted
  • Allow a few seconds for the async queue job to process
  • Check that you saved the action after enabling data hydration
  • Verify the field key doesn’t conflict with an existing definition of a different type
  • Check the 256-definition capacity limit
  • The definition sync job runs asynchronously — allow a few seconds
  • Ensure Pin to Customer Detail is enabled in the hydration config
  • The pin setting can be updated even after first sync
  • Verify the metafield definition exists in Shopify admin under Settings > Custom data > Customers
  • Check that the question has 5 or fewer options
  • Verify sufficient definition capacity (each option = 1 definition)
  • Ensure no other action uses the same field key with a different mode

Next Steps

Configuration Guide

Detailed guide to all data hydration configuration options.

Overview

Understand the full data hydration architecture and supported action types.