> For the complete documentation index, see [llms.txt](https://help.littledata.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.littledata.io/integrations/shopify-to-google-analytics/tracking-first-party-data-ga4.md).

# Using user-provided data (UPD) in GA4 for better attribution

Set up user-provided data (UPD) in Google Analytics 4 from the Data manager, and send consented, first-party user data from Shopify in four steps.

Google Analytics 4 has a new **Data manager** page, in public beta, for using your own data to improve measurement. Its first recommendation is **Set up user-provided data (UPD)**: "Get detailed audience reporting and improve conversion measurement by sending your consented, first-party user data."

![Set up user-provided data (UPD) card in the GA4 Data manager](https://3956158252-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1QhTbrMraNWciQeDvu1b%2Fuploads%2Fgit-blob-0adda406b3c6cc09d0fbb11d3cc40168a95a2cb7%2Fga4-data-manager-set-up-user-provided-data.png?alt=media)

Littledata sends that data for you. Cookies only identify a browser, and they expire. User-provided data identifies a person, so GA4 can recognize your customers across devices and without cookies.

UPD works alongside User ID. GA4 groups the two under **User ID and user-provided data collection**, and Littledata sends both from your Shopify store.

| Feature                  | What Littledata sends                                   | What GA4 does with it                                                                           |
| ------------------------ | ------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
| User ID                  | The Shopify customer ID, as `user_id`                   | Counts one customer as one user across sessions, browsers and devices                           |
| User-provided data (UPD) | The customer's email, phone and address, SHA-256 hashed | Matches the customer to consented, signed-in Google users when cookies or other IDs are missing |

Together they give you:

* **Cross-device identity.** A customer who browses on a phone and buys on a laptop is one user, not two.
* **Cookieless identity.** Less reliance on browser cookies, which Safari and iOS can limit to 7 days.
* **Improved conversion measurement** in Google Ads. Similar to [enhanced conversions](https://support.google.com/analytics/answer/14077171?hl=en), for ad clicks that cookies can't connect to a purchase.
* **Detailed audience reporting.** Demographic and interest reports based on your first-party data.
* **Larger remarketing audiences.** GA4 audiences shared with Google Ads can use Customer Match.

{% hint style="info" %}
Both the Data manager and user-provided data collection are in beta in GA4. Google may change it, and results can take a few weeks to show in reports.
{% endhint %}

### Set up user-provided data (UPD)

You need **Editor** access or higher on the GA4 property. Follow the steps in this order.

{% stepper %}
{% step %}
**Set up user-provided data in the GA4 Data manager**

In GA4, go to **Admin** > **Data manager**. On the **Set up user-provided data (UPD)** card, click **Take action**.

GA4 opens the **User ID and user-provided data collection** panel. Click **Turn on** next to **User-provided data collection**, review the user-provided data policy, then click **Turn on** again.

![GA4 User ID and user-provided data collection panel with the Turn on button](https://3956158252-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1QhTbrMraNWciQeDvu1b%2Fuploads%2Fgit-blob-e38ab858ee8d4536fc531e81d6e313ebc6319057%2Fga4-user-id-and-user-provided-data-collection.png?alt=media)

If you don't see the Data manager yet, go to **Admin** > **Data collection and modification** > **Data collection** to find the same panel.

User ID collection has no switch. GA4 uses the `user_id` as soon as Littledata sends it.
{% endstep %}

{% step %}
**Turn on Send user data in Littledata**

Do this straight after step 1. Open the Littledata app and go to your **Google Analytics 4** destination settings. Under the **Data customization** tab, turn on **Send user data**.

![Send user data setting in the Littledata GA4 destination](https://3956158252-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1QhTbrMraNWciQeDvu1b%2Fuploads%2Fgit-blob-ef44d3f5e05dd8772c52fbc899616ffcb9f1d61c%2Fuser_data_embedded.png?alt=media\&token=229f10f4-f508-4208-8887-8e2074ce55b1)
{% endstep %}

{% step %}
**Link Google Ads and turn on ads personalization**

Improved conversion measurement and audience sharing only work with a linked ads account.

* Go to **Admin** > **Product links** > **Google Ads links** and link your account.
* Go to **Admin** > **Data collection and modification** > **Data collection** and check that **Ads personalization** is allowed for your regions.

Skip this step if you only want cross-device reporting inside GA4.
{% endstep %}

{% step %}
**Choose a reporting identity that uses User ID**

Go to **Admin** > **Data display** > **Reporting identity**. Select **Blended**, then click **Save**. **Observed** also uses User ID, but without modeling.

**Device-based** ignores User ID, so reports won't join a customer's devices together. Reporting identity only changes how reports look, and you can switch back at any time.
{% endstep %}
{% endstepper %}

Littledata now sends the Shopify customer ID and hashed customer data with your conversion events.

{% hint style="warning" %}
Turn on the GA4 setting first, and keep both settings in step. Google can reject events that contain user data if user-provided data collection is off in GA4. If it's on in GA4 but **Send user data** is off in Littledata, Google may not track purchases.
{% endhint %}

### How it works

When **Send user data** is on, Littledata adds `user_id` and a `user_data` object to the conversion events it sends to GA4. All personal fields are hashed with the **SHA-256** algorithm before they leave Littledata.

If user-provided data collection is off in your GA4 property, Google can reject these events. That's why you turn on the GA4 setting first.

This is an example of the data Littledata sends:

```javascript
   "user_id":"7158222333381",
   "user_data":{
      "sha256_email_address":"53b61bf697983d0f07a1e4d6962d81a1b86ccf594d32e9bdfb6ad5e110d48b1c",
      "sha256_phone_number":"f029f7d3dd85b2b7e9b657792d168ab92c48c4363634c59187d5a2dd3279188f",
      "address":{
         "sha256_first_name":"1b99f3740501eaef26b5a0a3958b8fe9e81b822981a414d510b1e5b139348cdf",
         "sha256_last_name":"e75be31f77b4aae647f4e0b4233bb5cf3b67384434b76ed36f6ff723f79ef1ce",
         "sha256_street":"4249a5b864b0f3382e9d29c6fd98065fdea6a0ec263fa691842e7e52787aa3e6",
         "city":"3eef36f440a655f87ec46c3e7e4a61427d3c3549b53c33e34f65fa78ad9ee31d",
         "region":"124e0b7201b0388d7c07f43194b9645d162b77005b66fef7283c689a69ff7c56",
         "postal_code":"92c7d71b95dc6540fc58e891dbe649fe72ae5e93b5f42fd7fbdeefe6cef3e51d",
         "country":"884129b7691d98f541650f9974a034323677ebe4e1c3bd71ebf5d43cdf118acc"
      }
   }
```

#### Related articles

* [12 things every GA4 admin should do](https://help.littledata.io/google-analytics/setup/ga4-onboarding-admin-settings)
* [How it works: Shopify to Google Analytics](https://help.littledata.io/integrations/shopify-to-google-analytics/how-it-works-shopify-to-ga4)
* [Changing the data pipeline settings](https://help.littledata.io/advanced/developer/data-pipeline-settings)
