Using Segment Consent Management with Shopify

This article explains how Littledata works with Segment's Consent Management.

Segment Consent Managementarrow-up-right accepts signals from your Consent Management Platform (CMP) to capture and enforce user consent preferences, routing events only to destinations approved by the user.

Segment requires every event from your sources to include end-user consent preferences, captured by your CMP or application logic, in the form of the consent objectarrow-up-right.

Littledata uses Shopify's Customer Privacy API to track customer consent. Most Shopify cookie banners and some Consent Management Platforms (CMPs) support this Customer Privacy API.

For Consent Mode to work, you must have a cookie banner. You can set it up from your Shopify Admin by going to Settings -> Customer Privacy -> Cookie Banner.

circle-check

Shopify’s Customer Privacy API supports four consent types, and Littledata maps these onto Segment Consent.

Segment Consent Type
Shopify Consent Type

Advertising

marketing

DataSharing

sale_of_data

Functional

preferences

Analytics

analytics

For all consent types a true value equals a 'yes' value on Shopify.

Segment Consent value
Shopify Consent value

true

yes

false

no

This consent object is sent with all events within the event context object.

You must configure the Segment destinationsarrow-up-right to decide which ones are Advertising, Analytics, Functional or DataSharing.

You can ignore step 2 (integrating your CMP) because Littledata has already done this for the Shopify sourcearrow-up-right.

If you prefer not to collect non-consenting customer data in Segment, then you can exclude client-side events using source middleware for Segment’s AnalyticsJS library.

This example middleware script would drop events from being triggered if context.consent.categoryPreferences.Advertising is not true.

Last updated

Was this helpful?