---
title: Unifying Data Across Sources
slug: analytics-developer-docs/unifying-data-across-sources
docTags: 
createdAt: 2024-03-12T17:57:39.201Z
---

Chord’s standard data implementation includes events being sent to the CDP from, at minimum, a website front-end and a server source. To ensure these events are associated to the same user record in Segment, the website front-end needs to save a few browser identifiers as attributes on the cart or order, so they can be retrieved later by the server source and included in Segment events.

For Shopify sites, these identifiers should be added as cart attributes. If using the Shopify Storefront API, this can be done using the [`cartAttributesUpdate`](https://shopify.dev/docs/api/storefront/2023-10/mutations/cartAttributesUpdate) mutation.

:::hint{type="info"}
Chord's analytics library for [Shopify themes](docId\:F1GgUYhQkivbDBBoTaDZS) saves identifiers as cart attributes automatically. If you're using this library, you don't need to do anything else.
:::

At minimum, a cart attribute named `segmentId` or `_cdpAnonymousId` must be added with the value being the anonymous ID assigned to the user in the browser. This ID can be found by calling `window.analytics.user().anonymousId()` on any page where Segment’s Javascript is present. It won't be available until after Segment has been initialized, so you may want to wait for the `analytics.ready` [callback](https://segment.com/docs/connections/sources/catalog/libraries/website/javascript/#ready).

If using Google destinations, add an attribute with the key `googleClientId` or `_googleClientId` and the value `getCookie('_ga').substring(6)`. *Note: `getCookie` is not a native Javascript function and needs to be implemented. See [an example implementation](https://developer.mozilla.org/en-US/docs/Web/API/Document/cookie).*

Add these attributes to the cart before the customer navigates to checkout. Ideally, if adding these attributes requires an API request, add these attributes at a time that doesn’t block user interaction with your site, like when the cart page loads or after a product is added to the cart.

