Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

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

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.

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

1

Open Custom definitions

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

2

Start a new custom dimension

On the Custom dimensions tab, click Create custom dimensions

3

Fill in the details

Enter these values:

  • Dimension name: Affiliation

  • Scope: Event

  • Description: Affiliation

  • Event parameter: affiliation

4

Save

Click Save.

New custom dimensions can take up to 24 hours to show data in GA4.

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

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.

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

Last updated

Was this helpful?