> 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/create-affiliation-custom-dimension-ga4.md).

# 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](/integrations/shopify-to-google-analytics/how-it-works-shopify-to-ga4.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.

![](https://3956158252-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1QhTbrMraNWciQeDvu1b%2Fuploads%2Fgit-blob-ed860f51316eb1d006003e7f4cc1c6fc76c197b9%2Fscreenshot-2023-04-26-at-12.07.47-pm.png?alt=media)

* Click on *Custom Definitions* under Data display.

![](https://3956158252-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1QhTbrMraNWciQeDvu1b%2Fuploads%2Fgit-blob-3323dab3d699cdd3b5c39c76d94113f066f58c38%2Fcustom-definition-location.png?alt=media)

* Click on *Create Custom Dimensions.*

![](https://3956158252-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1QhTbrMraNWciQeDvu1b%2Fuploads%2Fgit-blob-4e30b579e348be002c105114af1005c9697eabe9%2Fscreenshot-2023-04-26-at-11.25.10-am.png?alt=media)

* Add in *Affiliation* as the dimension name.

![](https://3956158252-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1QhTbrMraNWciQeDvu1b%2Fuploads%2Fgit-blob-46b31b734ccc1a063fecdf74cd9d62b5a1880116%2Fscreenshot-2023-04-26-at-11.28.55-am.png?alt=media)

* Add in Affiliation as the description.

![](https://3956158252-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1QhTbrMraNWciQeDvu1b%2Fuploads%2Fgit-blob-9d806e8f4cb41d69e28fb2d5b745962c23288a26%2Fscreenshot-2023-04-26-at-11.49.12-am.png?alt=media)

* Add in Affiliation as the event parameter.

![](https://3956158252-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1QhTbrMraNWciQeDvu1b%2Fuploads%2Fgit-blob-e54ba41b7eb7785684cb26ec5dfce5ae948a7db2%2Fscreenshot-2023-04-26-at-11.51.55-am.png?alt=media)

* Click on *Save.*

![](https://3956158252-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1QhTbrMraNWciQeDvu1b%2Fuploads%2Fgit-blob-1b4031a711d5d3f6a012fc8d63a52f1f3d1d59b9%2Fscreenshot-2023-04-26-at-11.51.20-am.png?alt=media)

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.

![](https://3956158252-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1QhTbrMraNWciQeDvu1b%2Fuploads%2Fgit-blob-deca919a1c8994418e58db136904f3486c6ecb5b%2Fscreenshot-2023-10-13-at-3.25.51-pm.png?alt=media)

**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:

![](https://3956158252-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1QhTbrMraNWciQeDvu1b%2Fuploads%2Fgit-blob-edce56bd43e898ee78a4957d7da260efddbfe65e%2Fscreenshot-2023-10-13-at-3.20.18-pm.png?alt=media)

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.
