> 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>" %}

Littledata sends an `affiliation` parameter with every purchase event in GA4. This page shows you how to make sure the Affiliation custom dimension exists, and how to use it to filter orders in reports and explorations.

{% hint style="success" %}
Littledata creates [a set of custom dimensions](https://help.littledata.io/integrations/shopify-to-google-analytics/how-it-works-shopify-to-ga4#custom-parameters) for you during installation, including Affiliation. Only follow the steps below if Affiliation is missing from your property.
{% endhint %}

### Why you need the custom dimension

GA4 only shows custom event parameters in reports once they are registered as custom dimensions. Without the Affiliation dimension, you can't see `affiliation` values in reports, explorations or segments.

The `affiliation` value tells you what kind of order it is. For example:

| Order type                   | Example `affiliation` value                    |
| ---------------------------- | ---------------------------------------------- |
| Regular online order         | `Shopify` (or the order's tags, if it has any) |
| Draft order                  | `Shopify, Draft`                               |
| Shop app order               | `Shopify, Shop App`                            |
| Recurring subscription order | `Subscription Recurring Order`                 |
| Amazon order                 | `Amazon Marketplace`                           |

This makes it easy to separate first-time orders from subscription renewals and other order types.

### Create the Affiliation custom dimension

{% stepper %}
{% step %}

### Open Custom definitions

In Google Analytics, click **Admin** (the gear icon in the bottom left). Under **Data display**, click **Custom definitions**.

![](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)
{% endstep %}

{% step %}
**Start a new custom dimension**

On the **Custom dimensions** tab, click **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)
{% endstep %}

{% step %}
**Fill in the details**

Enter these values:

* **Dimension name**: Affiliation
* **Scope**: Event
* **Description**: Affiliation
* **Event parameter**: affiliation

![](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)
{% endstep %}

{% step %}

### Save

Click Save.
{% endstep %}
{% endstepper %}

{% hint style="info" %}
New custom dimensions can take up to 24 hours to show data in GA4.
{% endhint %}

### Use the Affiliation dimension

You can use Affiliation as a filter in GA4's standard reports, or as a filter or segment in explorations.

#### Standard reports

If you sell subscriptions, you can exclude recurring orders from reports like **Traffic acquisition**. Recurring orders are created by the subscription app, not by a website visit, so GA4 can't attribute them to a channel. Excluding them gives you a clearer view of what your marketing drives.

To do this, add a filter on Affiliation with the match type **does not match regex** and the value `.*Recurring.*`.

![](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

In an exploration, add Affiliation as a dimension and as a filter. You can then include or exclude any order type. The example below is a sales performance exploration with recurring orders filtered out.

![](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)

You can also use Affiliation to build segments for subscription analysis.

### Related articles

* [How it works: Shopify to Google Analytics](https://help.littledata.io/integrations/shopify-to-google-analytics/how-it-works-shopify-to-ga4)
* [How to build a sales performance report in GA4](https://help.littledata.io/google-analytics/conversions/how-to-build-a-sales-performance-report-in-ga4)
* [Segments in Google Analytics](https://help.littledata.io/google-analytics/behavior/segments-in-google-analytics-4)
* [Subscription lifetime revenue by channel in GA4](https://help.littledata.io/google-analytics/subscriptions/subscription-revenue-by-channel-in-google-analytics-4)
