def _create_ad_group(client, customer_id, campaign_resource_name):
    """Creates an ad group for the remarketing campaign.

    Args:
        client: An initialized GoogleAds client.
        customer_id: The Google Ads customer ID.
        campaign_resource_name: The resource name of the target campaign.
    Returns:
        The string resource name of the newly created ad group.
    """
    # Gets the AdGroupService.
    ad_group_service = client.get_service("AdGroupService")

    # Creates an ad group operation and configures the new ad group.
    ad_group_operation = client.get_type("AdGroupOperation")
    ad_group = ad_group_operation.create
    ad_group.name = "Dynamic remarketing ad group"
    ad_group.campaign = campaign_resource_name
    ad_group.status = client.get_type("AdGroupStatusEnum").AdGroupStatus.ENABLED

    # Issues a mutate request to add the ad group.
    ad_group_response = ad_group_service.mutate_ad_groups(
        customer_id=customer_id, operations=[ad_group_operation]
    )
    ad_group_resource_name = ad_group_response.results[0].resource_name

    return ad_group_resource_name
    # [END add_merchant_center_dynamic_remarketing_campaign_1]