Visitors who Took Specific ActionsStay organized with collectionsSave and categorize content based on your preferences.
Page Summary
Audience lists can be populated with users who have taken specific actions on your website, including conversions and non-conversion actions.
To create and target audience segments, you need to review the advertising policy, set up your Google tag, and set up conversion tracking.
You can retrieve your Google tag from the Google Ads UI or using the Google Ads API by creating aRemarketingAction.
Install your Google tag on all website pages and optionally add custom parameters for more tailored user lists.
Basic user lists define membership based on users who triggered conversion actions on your website or took non-conversion actions associated with aRemarketingAction.
Audience segments can be targeted at the ad group level using anAdGroupCriterionor at the campaign level using aCampaignCriterion, but not at both levels simultaneously for positive targeting.
You can populate your audience list with people who have taken specific actions
on your website. If you're using conversion tracking, you can target ads to
people who previously triggered a conversion (such as a purchase) on your
website.
You can also target ads to people who have taken a particular action on your
website that you donotconsider a conversion, such as when a person adds
but then deletes an item from their shopping cart without making a purchase.
Prerequisites
In order to create and target audience segments, you first need to:
Advertisers seeking to create user lists based on mobile app behavior should
implement the Firebase SDK or work with third-party SDKs in order to track
in-app behavior.
If you're planning to build audience segments based only on visited page URLs,
you don't need to make any edits to your Google tag. If you're using custom
parameters, you need to edit your tag to include them, as detailed inAdvanced
strategies for tagging and creating remarketing
lists.
You can use the built-in remarketing parameterurl__to target a user list
based on the URLs that people have visited on your website, as demonstrated in
theVisitors to your website example.
Before creating your own custom parameters, check out the list ofpredefined parametersto see
if there's already a good fit for your use case. Using predefined parameters
makes it easier to integrate with other Google Ads remarketing features.
Create the user list
Targeting visitors who took specific actions requires setting thebasic_user_listfield of aUserListwith aBasicUserListInfoobject containing
references to the actions—whether conversions or non-conversion
actions— you are targeting.
For a complete walkthrough of an example scenario in which you target users
based on a combination of conversion and non-conversion actions, check out theSample scenario.
Visitors who triggered a conversion
A basic user list defines its membership as people who had triggered one or more
conversion actions on your website. When you create a basic user list, you
provide the resource name of theConversionActionto aUserListActionInfoobject, which is
ultimately passed to theUserList.
The following example creates a basic user list associated with two existing
conversion actions:
defmain(client:GoogleAdsClient,customer_id:str,conversion_action_ids:List[str],)->None:"""Creates a combination user list.Args:client: The Google Ads client.customer_id: The customer ID for which to add the user list.conversion_action_ids: The IDs of the conversion actions for the basicuser list."""# Get the UserListService and ConversionActionService clients.user_list_service:UserListServiceClient=client.get_service("UserListService")conversion_action_service:ConversionActionServiceClient=(client.get_service("ConversionActionService"))# Create a list of UserListActionInfo objects for the given conversion# actions. These specify the conversion actions that, when triggered, will# cause a user to be added to a UserList.user_list_action_info_list:List[UserListActionInfo]=[]forconversion_action_idinconversion_action_ids:user_list_action_info:UserListActionInfo=client.get_type("UserListActionInfo")user_list_action_info.conversion_action=(conversion_action_service.conversion_action_path(customer_id,conversion_action_id))user_list_action_info_list.append(user_list_action_info)# Create a UserListOperation and populate the UserList.user_list_operation:UserListOperation=client.get_type("UserListOperation")user_list:UserList=user_list_operation.createuser_list.name=f"Example BasicUserList #{uuid4()}"user_list.description=("A list of people who have triggered one or more conversion actions")user_list.membership_status=client.enums.UserListMembershipStatusEnum.OPENuser_list.membership_life_span=365# The basic user list info object contains the conversion action info.user_list.basic_user_list.actions.extend(user_list_action_info_list)# Issue a mutate request to add the user list, then print the results.response:MutateUserListsResponse=user_list_service.mutate_user_lists(customer_id=customer_id,operations=[user_list_operation])print("Created basic user list with resource name "f"'{response.results[0].resource_name}.'")
defadd_conversion_based_user_list(customer_id,conversion_action_ids)# GoogleAdsClient will read a config file from# ENV['HOME']/google_ads_config.rb when called without parametersclient=Google::Ads::GoogleAds::GoogleAdsClient.new# Creates the basic user list.operation=client.operation.create_resource.user_listdo|u|u.name="Example BasicUserList ##{(Time.new.to_f*100).to_i}"u.description="A list of people who have triggered one or more conversion actions"u.membership_status=:OPENu.membership_life_span=365# Creates a basic user list info object with all of the conversion actions.u.basic_user_list=client.resource.basic_user_list_infodo|info|conversion_action_ids.eachdo|conversion_action_id|# Creates the UserListActionInfo object for a given conversion action.# This specifies the conversion action that, when triggered, will cause a# user to be added to a user_list.info.actions<<client.resource.user_list_action_infodo|action|action.conversion_action=client.path.conversion_action(customer_id,conversion_action_id)endendendend# Issues a mutate request to add the user list and prints some information.response=client.service.user_list.mutate_user_lists(customer_id:customer_id,operations:[operation],)puts"Created basic user list with resource name "\"#{response.results.first.resource_name}"end
subadd_conversion_based_user_list{my($api_client,$customer_id,$conversion_action_ids)=@_;my$user_list_action_info_list=[];foreachmy$conversion_action_id(@$conversion_action_ids){# Create the UserListActionInfo object for a given conversion action. This# specifies the conversion action that, when triggered, will cause a user to# be added to a UserList.push@$user_list_action_info_list,Google::Ads::GoogleAds::V22::Common::UserListActionInfo->new({conversionAction=>Google::Ads::GoogleAds::V22::Utils::ResourceNames::conversion_action($customer_id,$conversion_action_id)});}# Create a basic user list info object with all of the conversion actions.my$basic_user_list_info=Google::Ads::GoogleAds::V22::Common::BasicUserListInfo->new({actions=>$user_list_action_info_list});# Create the basic user list.my$basic_user_list=Google::Ads::GoogleAds::V22::Resources::UserList->new({name=>"Example BasicUserList #".uniqid(),description=>"A list of people who have triggered one or more conversion actions",membershipStatus=>OPEN,membershipLifeSpan=>365,basicUserList=>$basic_user_list_info});# Create the operation.my$user_list_operation=Google::Ads::GoogleAds::V22::Services::UserListService::UserListOperation->new({create=>$basic_user_list});# Issue a mutate request to add the user list and print some information.my$user_lists_response=$api_client->UserListService()->mutate({customerId=>$customer_id,operations=>[$user_list_operation]});printf"Created basic user list with resource name '%s'.\n",$user_lists_response->{results}[0]{resourceName};return1;}
You can create a basic user list for people who took actions on your website
that you don't consider conversions by associating it with aRemarketingActioninstead of aConversionAction.
Retrieve the list
To retrieve your user list, you can issue the following Google Ads Query Language query to theuser_listresource.
With your audience segment created, the next step is to target
it.
Audience segment targeting rules
Positive (biddable) user lists cannot be set at the campaign level and the
ad group level at the same time. Positive user list criteria must be removed
from all ad groups within a campaign before one can be set for the campaign.
Positive targeting by user list is only supported for Search campaigns. For
Display campaigns,CampaignCriterionthat setsuser_listmust be
excluded.
In Search and Shopping campaigns, user list targets don't support setting
the following fields:
The process is similar to other types of targeting criteria in the API. The
following code demonstrates how you can use anAdGroupCriterionto target ads in an ad group to a user list:
deftarget_ads_in_ad_group_to_user_list(client:GoogleAdsClient,customer_id:str,ad_group_id:str,user_list_resource_name:str,)->str:"""Creates an ad group criterion that targets a user list with an ad group.Args:client: an initialized GoogleAdsClient instance.customer_id: a str client customer ID used to create an ad groupcriterion.ad_group_id: a str ID for an ad group used to create an ad groupcriterion that targets members of a user list.user_list_resource_name: a str resource name for a user list.Returns:a str resource name for an ad group criterion."""ad_group_criterion_operation:AdGroupCriterionOperation=client.get_type("AdGroupCriterionOperation")# Creates the ad group criterion targeting members of the user list.ad_group_criterion:AdGroupCriterion=ad_group_criterion_operation.createad_group_criterion.ad_group=client.get_service("AdGroupService").ad_group_path(customer_id,ad_group_id)ad_group_criterion.user_list.user_list=user_list_resource_namead_group_criterion_service:AdGroupCriterionServiceClient=(client.get_service("AdGroupCriterionService"))response:MutateAdGroupCriteriaResponse=(ad_group_criterion_service.mutate_ad_group_criteria(customer_id=customer_id,operations=[ad_group_criterion_operation]))resource_name:str=response.results[0].resource_nameprint("Successfully created ad group criterion with resource name: "f"'{resource_name}' targeting user list with resource name: "f"'{user_list_resource_name}' and with ad group with ID "f"{ad_group_id}.")returnresource_name
deftarget_ads_in_ad_group_to_user_list(client,customer_id,ad_group_id,user_list)# Creates the ad group criterion targeting members of the user list.operation=client.operation.create_resource.ad_group_criteriondo|agc|agc.ad_group=client.path.ad_group(customer_id,ad_group_id)agc.user_list=client.resource.user_list_infodo|info|info.user_list=user_listendend# Issues a mutate request to create the ad group criterion.response=client.service.ad_group_criterion.mutate_ad_group_criteria(customer_id:customer_id,operations:[operation],)ad_group_criterion_resource_name=response.results.first.resource_nameputs"Successfully created ad group criterion with resource name "\"'#{ad_group_criterion_resource_name}' targeting user list with resource name "\"'#{user_list}' with ad group with ID#{ad_group_id}"ad_group_criterion_resource_nameend
subtarget_ads_in_ad_group_to_user_list{my($api_client,$customer_id,$ad_group_id,$user_list_resource_name)=@_;# Create the ad group criterion targeting members of the user list.my$ad_group_criterion=Google::Ads::GoogleAds::V22::Resources::AdGroupCriterion->new({adGroup=>Google::Ads::GoogleAds::V22::Utils::ResourceNames::ad_group($customer_id,$ad_group_id),userList=>Google::Ads::GoogleAds::V22::Common::UserListInfo->new({userList=>$user_list_resource_name})});# Create the operation.my$ad_group_criterion_operation=Google::Ads::GoogleAds::V22::Services::AdGroupCriterionService::AdGroupCriterionOperation->new({create=>$ad_group_criterion});# Add the ad group criterion, then print and return the new criterion's resource name.my$ad_group_criteria_response=$api_client->AdGroupCriterionService()->mutate({customerId=>$customer_id,operations=>[$ad_group_criterion_operation]});my$ad_group_criterion_resource_name=$ad_group_criteria_response->{results}[0]{resourceName};printf"Successfully created ad group criterion with resource name '%s' "."targeting user list with resource name '%s' with ad group with ID %d.\n",$ad_group_criterion_resource_name,$user_list_resource_name,$ad_group_id;return$ad_group_criterion_resource_name;}
As with other types of criteria, you can assign other properties to theAdGroupCriterionobject, such as bid overrides.
Switch targeting levels
If you are switching from ad group level user list criteria to campaign level,
you must first remove the existing user list criteria from each enabled or
paused ad group under that campaign. Click the expandable elements to view
example code for each step.
First, retrieve all of the AdGroupCriteria under a given campaign.
defget_user_list_ad_group_criteria(client:GoogleAdsClient,customer_id:str,campaign_id:str)->List[str]:"""Finds all of user list ad group criteria under a campaign.Args:client: an initialized GoogleAdsClient instance.customer_id: a str client customer ID.campaign_id: a str campaign ID.Returns:a list of ad group criterion resource names."""# Creates a query that retrieves all of the ad group criteria under a# campaign.query:str=f"""SELECTad_group_criterion.criterion_idFROM ad_group_criterionWHERE campaign.id ={campaign_id}AND ad_group_criterion.type = USER_LIST"""googleads_service:GoogleAdsServiceClient=client.get_service("GoogleAdsService")search_request:SearchGoogleAdsRequest=client.get_type("SearchGoogleAdsRequest")search_request.customer_id=customer_idsearch_request.query=queryresponse:SearchGoogleAdsResponse=googleads_service.search(request=search_request)# Iterates over all rows in all pages. Prints the user list criteria and# adds the ad group criteria resource names to the list.user_list_criteria:List[str]=[]row:GoogleAdsRowforrowinresponse:resource_name:str=row.ad_group_criterion.resource_nameprint("Ad group criterion with resource name '{resource_name}' was ""found.")user_list_criteria.append(resource_name)returnuser_list_criteria
defget_user_list_ad_group_criterion(client,customer_id,campaign_id)user_list_criteria=[]# Creates a query that will retrieve all of the ad group criteria# under a campaign.query=<<~QUERYSELECTad_group_criterion.criterion_idFROMad_group_criterionWHEREcampaign.id=#{campaign_id}ANDad_group_criterion.type='USER_LIST'QUERY# Issues the search request.response=client.service.google_ads.search(customer_id:customer_id,query:query,)# Iterates over all rows in all pages. Prints the results and adds the ad# group criteria resource names to the list.response.eachdo|row|ad_group_criterion_resource_name=row.ad_group_criterion.resource_nameputs"Ad group criterion with resource name "\"'#{ad_group_criterion_resource_name}' was found"user_list_criteria<<ad_group_criterion_resource_nameenduser_list_criteriaend
subget_user_list_ad_group_criteria{my($api_client,$customer_id,$campaign_id)=@_;my$user_list_criterion_resource_names=[];# Create a search stream request that will retrieve all of the user list ad# group criteria under a campaign.my$search_stream_request=Google::Ads::GoogleAds::V22::Services::GoogleAdsService::SearchGoogleAdsStreamRequest->new({customerId=>$customer_id,query=>sprintf("SELECT ad_group_criterion.criterion_id "."FROM ad_group_criterion "."WHERE campaign.id = %d AND ad_group_criterion.type = 'USER_LIST'",$campaign_id)});my$search_stream_handler=Google::Ads::GoogleAds::Utils::SearchStreamHandler->new({service=>$api_client->GoogleAdsService(),request=>$search_stream_request});# Issue a search request and process the stream response.$search_stream_handler->process_contents(sub{# Display the results and add the resource names to the list.my$google_ads_row=shift;my$ad_group_criterion_resource_name=$google_ads_row->{adGroupCriterion}{resourceName};printf"Ad group criterion with resource name '%s' was found.\n",$ad_group_criterion_resource_name;push(@$user_list_criterion_resource_names,$ad_group_criterion_resource_name);});return$user_list_criterion_resource_names;}
defremove_existing_criteria_from_ad_group(client:GoogleAdsClient,customer_id:str,campaign_id:str)->None:"""Removes all ad group criteria targeting a user list under a campaign.This is a necessary step before targeting a user list at the campaign level.Args:client: an initialized GoogleAdsClient instance.customer_id: a str client customer ID.campaign_id: a str ID for a campaign that will have all ad groupcriteria that targets user lists removed."""# Retrieves all of the ad group criteria under a campaign.all_ad_group_criteria:List[str]=get_user_list_ad_group_criteria(client,customer_id,campaign_id)# Creates a list of remove operations.remove_operations:List[AdGroupCriterionOperation]=[]forad_group_criterion_resource_nameinall_ad_group_criteria:remove_operation:AdGroupCriterionOperation=client.get_type("AdGroupCriterionOperation")remove_operation.remove=ad_group_criterion_resource_nameremove_operations.append(remove_operation)ad_group_criterion_service:AdGroupCriterionServiceClient=(client.get_service("AdGroupCriterionService"))response:MutateAdGroupCriteriaResponse=(ad_group_criterion_service.mutate_ad_group_criteria(customer_id=customer_id,operations=remove_operations))print("Successfully removed ad group criterion with resource name: "f"'{response.results[0].resource_name}'")
defremove_existing_list_criteria_from_ad_group(client,customer_id,campaign_id)# Retrieves all of the ad group criteria under a campaign.ad_group_criteria=get_user_list_ad_group_criterion(client,customer_id,campaign_id)# Creates a list of remove operations.operations=[]ad_group_criteria.eachdo|agc|operations<<client.operation.remove_resource.ad_group_criterion(agc)end# Issues a mutate request to remove all ad group criteria.response=client.service.ad_group_criterion.mutate_ad_group_criteria(customer_id:customer_id,operations:operations,)puts"Removed#{response.results.size}ad group criteria."response.results.eachdo|result|puts"Successfully removed ad group criterion with resource name "\"'#{result.resource_name}'"endend
subremove_existing_list_criteria_from_ad_group{my($api_client,$customer_id,$campaign_id)=@_;# Retrieve all of the ad group criteria under a campaign.my$ad_group_criteria=get_user_list_ad_group_criteria($api_client,$customer_id,$campaign_id);# Create a list of remove operations.my$operations=[];foreachmy$ad_group_criterion(@$ad_group_criteria){push(@$operations,Google::Ads::GoogleAds::V22::Services::AdGroupCriterionService::AdGroupCriterionOperation->new({remove=>$ad_group_criterion}));}# Remove the ad group criteria and print the resource names of the removed criteria.my$ad_group_criteria_response=$api_client->AdGroupCriterionService()->mutate({customerId=>$customer_id,operations=>$operations});printf"Removed %d ad group criteria.\n",scalar@{$ad_group_criteria_response->{results}};foreachmy$result(@{$ad_group_criteria_response->{results}}){printf"Successfully removed ad group criterion with resource name '%s'.\n",$result->{resourceName};}}
Existing campaign level user list criteria must also be removed when switching
to ad group level user lists, and the process mirrors the preceding example.
Target ads in a campaign to a user list, using a CampaignCriterion.
deftarget_ads_in_campaign_to_user_list(client:GoogleAdsClient,customer_id:str,campaign_id:str,user_list_resource_name:str,)->str:"""Creates a campaign criterion that targets a user list with a campaign.Args:client: an initialized GoogleAdsClient instance.customer_id: a str client customer ID used to create an campaigncriterion.campaign_id: a str ID for a campaign used to create a campaigncriterion that targets members of a user list.user_list_resource_name: a str resource name for a user list.Returns:a str resource name for a campaign criterion."""campaign_criterion_operation:CampaignCriterionOperation=client.get_type("CampaignCriterionOperation")campaign_criterion:CampaignCriterion=campaign_criterion_operation.createcampaign_criterion.campaign=client.get_service("CampaignService").campaign_path(customer_id,campaign_id)campaign_criterion.user_list.user_list=user_list_resource_namecampaign_criterion_service:CampaignCriterionServiceClient=(client.get_service("CampaignCriterionService"))response:MutateCampaignCriteriaResponse=(campaign_criterion_service.mutate_campaign_criteria(customer_id=customer_id,operations=[campaign_criterion_operation]))resource_name:str=response.results[0].resource_nameprint("Successfully created campaign criterion with resource name "f"'{resource_name}' targeting user list with resource name "f"'{user_list_resource_name}' with campaign with ID{campaign_id}")returnresource_name
deftarget_ads_in_campaign_to_user_list(client,customer_id,campaign_id,user_list)# Creates the campaign criterion targeting members of the user list.operation=client.operation.create_resource.campaign_criteriondo|cc|cc.campaign=client.path.campaign(customer_id,campaign_id)cc.user_list=client.resource.user_list_infodo|info|info.user_list=user_listendend# Issues a mutate request to create the campaign criterion.response=client.service.campaign_criterion.mutate_campaign_criteria(customer_id:customer_id,operations:[operation],)campaign_criterion_resource_name=response.results.first.resource_nameputs"Successfully created campaign criterion with resource name "\"'#{campaign_criterion_resource_name}' targeting user list with resource name "\"'#{user_list}' with campaign with ID#{campaign_id}"campaign_criterion_resource_nameend
subtarget_ads_in_campaign_to_user_list{my($api_client,$customer_id,$campaign_id,$user_list_resource_name)=@_;# Create the campaign criterion.my$campaign_criterion=Google::Ads::GoogleAds::V22::Resources::CampaignCriterion->new({campaign=>Google::Ads::GoogleAds::V22::Utils::ResourceNames::campaign($customer_id,$campaign_id),userList=>Google::Ads::GoogleAds::V22::Common::UserListInfo->new({userList=>$user_list_resource_name})});# Create the operation.my$campaign_criterion_operation=Google::Ads::GoogleAds::V22::Services::CampaignCriterionService::CampaignCriterionOperation->new({create=>$campaign_criterion});# Add the campaign criterion and print the resulting criterion's resource name.my$campaign_criteria_response=$api_client->CampaignCriterionService()->mutate({customerId=>$customer_id,operations=>[$campaign_criterion_operation]});my$campaign_criterion_resource_name=$campaign_criteria_response->{results}[0]{resourceName};printf"Successfully created campaign criterion with resource name '%s' "."targeting user list with resource name '%s' with campaign with ID %d.\n",$campaign_criterion_resource_name,$user_list_resource_name,$campaign_id;return$campaign_criterion_resource_name;}
In order to collect performance data for your audience segments, issue a search
request against thead_group_audience_viewor thecampaign_audience_viewresource.
For example, you might look at theconversionsorcost_per_conversionto
determine if targeting the audience segment is actually leading to more
conversions, then adjust your bid modifiers accordingly.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-12-03 UTC."],[],[]]