# How to create and use the custom dimension for Affiliation in GA4

{% embed url="<https://www.youtube.com/watch?v=fV530aNb1Mg&list=PLzjBsQdVKYbsjYJN8Mz_SqJj-8utjPoR6&index=17>" %}

Creating Google Analytics 4 custom dimensions and metrics allows you to easily access and use your event properties and user properties.

For example, without creating a custom dimension for your custom `affiliation` event parameter, you won't be able to see the parameter values in reports or use them on explorations, segments and so on.

By adding ‘affiliation’ as a custom dimension, you’ll be able to analyze subscription data and answer specific questions to your business’s needs.

{% hint style="success" %}
Littledata applies automatically [a set of custom dimensions](https://github.com/littledata/helpcenter-content/blob/main/posts/how-it-works-shopify-to-ga4/README.md#custom-parameters) during installation, including Affiliation.
{% endhint %}

## How to create a custom dimension for Affiliation in GA4

To create a custom dimension in Google Analytics 4 please follow the steps below:

* Click on the Admin cog on the bottom left-hand corner in Google Analytics.

![](/files/gfbpthSV7tYHRD2OVNhn)

* Click on *Custom Definitions* under Data display.

![](/files/friQ6iKI0ptNUUIovEtU)

* Click on *Create Custom Dimensions.*

![](/files/DA3gzi15XB9k3wE60hbN)

* Add in *Affiliation* as the dimension name.

![](/files/P3hLBIZzkp7WEhyIVEfi)

* Add in Affiliation as the description.

![](/files/llUHSMhLJgZCoOoPScSO)

* Add in Affiliation as the event parameter.

![](/files/CboqhF5nw0g9koEnbTgM)

* Click on *Save.*

![](/files/1WJcLZqjpXmWedHdsk14)

You will be able to use the custom dimension within 24 hours after its creation.

## How to use the custom dimension for Affiliation

You can use this custom dimension and apply it to the built-in GA4 reports or create filters and segments on explorations.

**Existing GA4 reports**

If you are using a subscription app, you will be able to look at reports like Traffic Acquisition and exclude recurring or offline orders, by applying a filter based on the affiliation custom dimension. You'll want to exclude recurring orders/rebills as they will be unattributed due to GA4's session-based architecture.

![](/files/mu3Bs1h94ZsWckueb5dq)

**Explorations**

By creating an exploration similar to the[ Sales performance](/google-analytics/conversions/how-to-build-a-sales-performance-report-in-ga4.md) one, you will be able to create a filter based on affiliation and include or exclude any type of orders coming into GA4.

{% hint style="success" %}
Learn [how to build a Sales Performance report in GA4.](/google-analytics/conversions/how-to-build-a-sales-performance-report-in-ga4.md)
{% endhint %}

Here is an example of a Sales performance exploration that has recurring orders excluded by a filter based on affiliation:

![](/files/3dMoW7Rakj2uKgmTebqN)

Additionally, you can also [create segments for subscription analysis in GA4](https://blog.littledata.io/2023/03/15/how-to-create-segments-for-subscription-orders-in-google-analytics-4) by using the custom dimension for affiliation.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.littledata.io/integrations/shopify-to-google-analytics/create-affiliation-custom-dimension-ga4.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
