I want to enabled the "Observation" setting to see how a campaign is doing 
against a specific Audience List.

I added the Audience list as campaign criteria using the following code:
  
        operation = self.client.get_type("CampaignCriterionOperation")
        campaign_criterion = operation.create
        campaign_service = self.client.get_service("CampaignService")
        campaign_criterion.campaign = 
campaign_service.campaign_path(self.account_id, self.campaign.id)

        user_list_info = self.client.get_type("UserListInfo")
        user_list = self.get_user_list(user_list_name)
        user_list_info.user_list = user_list.resource_name 
        campaign_criterion.user_list = user_list_info

        response = (
            campaign_criterion_service.mutate_campaign_criteria(
                customer_id=self.account_id, operations=[operation]
            )
        )

However, when I query for the target_restrictions, the array is empty.
Is this expected?
        target_restrictions = campaign.targeting_setting.target_restrictions
        print(f"restrictions length: {len(target_restrictions)}")

To enable observation, would I create a new target_restriction?

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Google Ads API and AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/de758be3-907c-4f79-85f4-a8fbb3141052n%40googlegroups.com.
  • ta... 'Chris Sun' via Google Ads API and AdWords API Forum
    • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum

Reply via email to