You can expand your reach by targeting audiences that are similar to and share
characteristics with your first-party audience lists by using Lookalike
segments. Lookalike segments are groups of people that share characteristics
with others on an existing seed list built from your first-party data---such as a
list of customers who have purchased specific products or used specific
services---letting you connect with potential new customers who demonstrate
similar characteristics.

> [!IMPORTANT]
> **Important:** Lookalike segments are only available for [Demand Gen
> campaigns](https://support.google.com/google-ads/answer/13695777). If you use an audience with a Lookalike segment in other campaign types, it will show as `Eligible - Limited`. Lookalike segments won't be effective outside of Demand Gen campaigns.

You can learn more about Lookalike segments in the [Lookalike segments guide in
the Google Ads Help Center](https://support.google.com/google-ads/answer/13541369).

## Create the user list

Creating a Lookalike user list follows the same process as creating other
[`UserList`](https://developers.google.com/google-ads/api/reference/rpc/v26/UserList) types. Lookalike user lists are created with the
[`UserListService`](https://developers.google.com/google-ads/api/reference/rpc/v26/UserListService) by setting the
[`lookalike_user_list`](https://developers.google.com/google-ads/api/reference/rpc/v26/UserList#lookalike_user_list) field with a
[`LookalikeUserListInfo`](https://developers.google.com/google-ads/api/reference/rpc/v26/LookalikeUserListInfo) object.

[`LookalikeUserListInfo`](https://developers.google.com/google-ads/api/reference/rpc/v26/LookalikeUserListInfo) is created based on existing
audience segments. When creating a Lookalike segment, you need to pass these
existing audience segments in the `seed_user_list_ids` field.

### Requirements

1. The sum of all seed lists must include a minimum of 100 active matched
   people.

2. Set the [`expansion_level`](https://developers.google.com/google-ads/api/reference/rpc/v26/LookalikeExpansionLevelEnum) to `NARROW`, `BALANCED`, or
   `BROAD` to configure the size of the lookalike segment. Find details on each
   level in the [Lookalike segments guide in the Google Ads Help
   Center](https://support.google.com/google-ads/answer/13541369).

3. Select countries to target by setting `country_codes` in
   [`LookalikeUserListInfo`](https://developers.google.com/google-ads/api/reference/rpc/v26/LookalikeUserListInfo) to a list of ISO 3166-1
   alpha-2 country codes.

4. The Lookalike audience segment must not have the same seed list, expansion
   level, and targeted countries as an existing audience segment. In **v24 and
   later** , attempting to create a duplicate Lookalike segment returns
   [`UserListError.DUPLICATE_LOOKALIKE`](https://developers.google.com/google-ads/api/reference/rpc/v26/UserListErrorEnum.UserListError#duplicate_lookalike).

### Best practices

It could take some time after creating your new campaign before you can
effectively use your Lookalike segment. As a best practice, create your campaign
and Lookalike segment two to three days in advance to help ensure that it's
ready when you want to start serving ads.

Lookalike segments refresh automatically every 1--2 days based on your available
customer data. If your seed list no longer meets the minimum requirement,
targeting stops, though this can take up to 3 days to take effect. You won't
encounter errors during this period, but targeting ceases once the segment is
marked as `Ineligible`. The Lookalike segment remains `Ineligible` until its
seed list meets the requirement again. Check that your seed user list has enough
active matched users for Demand Gen eligibility by querying for
[`user_list.size_range_for_display`](https://developers.google.com/google-ads/api/fields/v26/user_list#user_list.size_range_for_display) and
[`user_list.size_range_for_search`](https://developers.google.com/google-ads/api/fields/v26/user_list#user_list.size_range_for_search).

### Code example

To create a Lookalike user list, populate a `LookalikeUserListInfo` object on a
`UserList` and pass it to `UserListService.MutateUserLists`:

    user_list_operation = client.get_type("UserListOperation")
    user_list = user_list_operation.create
    user_list.name = f"Lookalike user list #{uuid.uuid4()}"
    user_list.description = "Lookalike segment based on seed user lists"

    lookalike_info = user_list.lookalike_user_list
    lookalike_info.seed_user_list_ids.extend(seed_user_list_ids)
    lookalike_info.expansion_level = (
        client.enums.LookalikeExpansionLevelEnum.BALANCED
    )
    lookalike_info.country_codes.extend(["US", "CA"])

    response = user_list_service.mutate_user_lists(
        customer_id=customer_id, operations=[user_list_operation]
    )

To target a Lookalike `UserList` in a Demand Gen campaign, wrap the `UserList`
in a `UserListSegment` inside an `Audience`
(`AudienceService.MutateAudiences`) and attach that `Audience` to
`AdGroupCriterion.audience` with
`AdGroup.audience_setting.use_audience_grouped = true`; see the
[Audiences guide](https://developers.google.com/google-ads/api/docs/remarketing/audiences#target-audiences) for details. For end-to-end client library
examples showing how to create and target a `UserList`, see
[Visitors to your website](https://developers.google.com/google-ads/api/docs/remarketing/audience-segments/website-visitors).

## Review list performance

To collect performance data for your audience segments, issue a search request
against the [`ad_group_audience_view`](https://developers.google.com/google-ads/api/fields/v26/ad_group_audience_view) or
[`campaign_audience_view`](https://developers.google.com/google-ads/api/fields/v26/campaign_audience_view) resource. For
example, you can analyze `metrics.conversions` or `metrics.cost_per_conversion`
to determine if targeting a specific audience segment increases conversions, and
then adjust your [bid modifiers](https://developers.google.com/google-ads/api/docs/targeting/bid-modifiers) accordingly.

    SELECT
      ad_group.id,
      ad_group_criterion.criterion_id,
      ad_group_criterion.resource_name,
      metrics.conversions,
      metrics.cost_per_conversion
    FROM ad_group_audience_view
    WHERE segments.date DURING LAST_30_DAYS