This guide walks through a sample scenario for building and targeting a
rule-based audience segment in the Google Ads API.

## Scenario overview

Suppose you have a website where you've configured custom remarketing tag
parameters to capture the following user attributes:

- [`event`](https://support.google.com/google-ads/answer/7305793) (or `ecomm_pagetype`): A string parameter indicating the category of page on your site, such as `"checkout"` or `"cart"`.
- `cartsize` (or `cart_size`): A numeric parameter representing the number of items in a user's shopping cart, evaluated using numeric comparison operators such as `GREATER_THAN`.
- `checkoutdate`: A date parameter (`YYYYMMDD` format, such as `"20191031"`, evaluated in the account's time zone) indicating the date on which a user checked out. You only set this parameter when a user completes a purchase.

You want to show more impressions to users who placed multiple items in their
shopping carts and initiated the checkout process. You also want to reach users
who made a purchase during November and December because you plan to run a major
sale on your site during those months.

You can describe this audience with either of the following conditions:

- Users who visited the checkout page **and** had more than one item in their cart.
- Users who checked out during the months of November or December.

If a user matches either condition 1 or condition 2, you want to increase your
bids in specific ad groups or campaigns by 25%.

> [!NOTE]
> **Note:** Creating a `UserList` defines audience membership, whereas bid adjustments are configured separately by attaching the `UserList` to an [`AdGroupCriterion`](https://developers.google.com/google-ads/api/reference/rpc/v26/AdGroupCriterion) or [`CampaignCriterion`](https://developers.google.com/google-ads/api/reference/rpc/v26/CampaignCriterion) and setting its `bid_modifier` field to `1.25`.

## Objects

A rule-based list is represented in the Google Ads API as a
[`rule_based_user_list`](https://developers.google.com/google-ads/api/reference/rpc/v26/UserList#rule_based_user_list).

The following illustration shows the structure of the
[`rule_based_user_list`](https://developers.google.com/google-ads/api/reference/rpc/v26/UserList#rule_based_user_list) for this scenario:

![Structure of a rule-based user list combining two rule item groups](https://developers.google.com/static/google-ads/api/images/rule-based-remarketing.png)

## Next steps

1. [Create rule item groups](https://developers.google.com/google-ads/api/docs/remarketing/audience-segments/scenario/rule-item-groups) to define the individual parameter conditions and group them with `AND` logic.
2. [Create a user list](https://developers.google.com/google-ads/api/docs/remarketing/audience-segments/scenario/create-user-list) to combine the rule item groups with `OR` logic, optionally prepopulate past users, and target the list with a bid modifier.