How to get user list id in get campaign

65 views
Skip to first unread message

Tarun Jain

unread,
Jul 11, 2018, 6:20:38 AM7/11/18
to AdWords API and Google Ads API Forum
Hi, 

I want to get Adwords UserList ID which associate (with campaign or campaign group) in campaign.service.get(). I am not able to get what is field name that I pass to field parameter of campaign.get().

So how can I achieve the same.

Thanks

Sreelakshmi Sasidharan (AdWords API Team)

unread,
Jul 11, 2018, 11:19:42 AM7/11/18
to AdWords API and Google Ads API Forum
Hi Tarun, 

To get the AdWordsUserList associated with a campaign as a CriterionUserList, you can use the CampaignCriterionService.get() and filter with the campaign Id. You can look for the attributes userListIduserListName etc., in the API response. You could check the GetCampaignTargetingCriteria sample in Java client library to get all the campaign level targeting criterion. Samples in other languages can also be found here

Thanks,
Sreelakshmi, AdWords API Team
Message has been deleted

Tarun Jain

unread,
Jul 12, 2018, 5:38:34 AM7/12/18
to AdWords API and Google Ads API Forum
Hi Sreelakshmi ,

Please confirm me for updating/add email in userList we have to use AdwordsUserListService.Mutate() service or  CampaignCriterionService.mutate()

Sreelakshmi Sasidharan (AdWords API Team)

unread,
Jul 12, 2018, 2:59:13 PM7/12/18
to adwor...@googlegroups.com
Hi Tarun, 

About getting the UserListId and UserListName via the CampaignCriterionService.get(). Please find the available selector fields for CampaignCriterionService here. You could try an API call with the SOAP request as given below: 

 <soapenv:Body>
            <serviceSelector>
                <fields>UserListId</fields>
                <fields>UserListName</fields>
                <fields>CampaignId</fields>
                <fields>CriteriaType</fields>
                <predicates>
                    <field>CriteriaType</field>
                    <operator>IN</operator>
                    <values>USER_LIST</values>
                </predicates>
                <predicates>
                    <field>CampaignId</field>
                    <operator>IN</operator>
                    <values>734382460</values>
                </predicates>
                <paging>
                    <startIndex>0</startIndex>
                    <numberResults>100</numberResults>
                </paging>
            </serviceSelector>
        </get>
    </soapenv:Body>

To add or update a email in an existing user list, you will need to use AdwordsUserListService.mutateMembers(). Please check this section of the python code sample for reference to add members to a user list. Please let me know if you have any additional questions. 
Reply all
Reply to author
Forward
0 new messages