How to add global negative placements

60 views
Skip to first unread message

cv

unread,
Apr 27, 2020, 10:12:28 AM4/27/20
to AdWords API and Google Ads API Forum
Hi,

I was trying to add placements as a Global Negative List.

I was doing by this.
        foreach ($placements as $placement_value) {
            $sharedCriterion = new SharedCriterion([
                'placement' => new PlacementInfo([
                    'url' => new StringValue(['value' => $placement_value])
                ]),
                'shared_set' => new StringValue(
                        ['value' => 'customers/XXXX/sharedSets/XXXX'])
            ]);

            $sharedCriterionOperation = new SharedCriterionOperation();
            $sharedCriterionOperation->setCreate($sharedCriterion);
            $sharedCriterionOperations[] = $sharedCriterionOperation;
        }


But this is not allowing me add the Placements.



Thanks,

cv

unread,
Apr 27, 2020, 10:21:16 AM4/27/20
to AdWords API and Google Ads API Forum
Hi,

I know that I can add a Youtube channel using Youtube Channel but what about User?


Thanks,

Google Ads API Forum Advisor Prod

unread,
Apr 27, 2020, 3:04:22 PM4/27/20
to chirag....@gmail.com, adwor...@googlegroups.com
Hello,

Unfortunately, it is not possible to exclude YouTube users via the API. You can use the CustomerNegativeCriterionService to exclude criteria from the customer level.

Regards,
Anthony
Google Ads API Team

ref:_00D1U1174p._5001UaSU68:ref

cv

unread,
Apr 27, 2020, 11:57:11 PM4/27/20
to AdWords API and Google Ads API Forum
Hi Anthony,

I am using new Google Ads PHP Lib(beta).

The UI can take any url, that can automatically converted to channel, so thought it might be possible using API.

So, I would only do the following criteria to exclude.
Thanks,

Google Ads API Forum Advisor Prod

unread,
Apr 28, 2020, 1:42:10 PM4/28/20
to chirag....@gmail.com, adwor...@googlegroups.com
Hello,

I will add a feature request on your behalf to have this added to the API.

cv

unread,
May 4, 2020, 9:26:04 AM5/4/20
to AdWords API and Google Ads API Forum
Hi Anthony,

I would also like to assign created SharedSet to campaigns.
For that,
I was using like this

$campaignSharedSet = new CampaignSharedSet([
                    'campaign' => new StringValue(
                            ['value' => ResourceNames::forCampaign($this->customerId, $campaignId)]
                    ),
                    'shared_set' => new StringValue(['value' => 'customers/XXXXXXXXXX/sharedSets/XXXXXXXX'])
                ]);

                $campaignSharedSetOperation = new CampaignSharedSetOperation();
                $campaignSharedSetOperation->setCreate($campaignSharedSet);

$campaignSharedSetServiceClient = $googleAdsClient->getCampaignSharedSetServiceClient();
            $response = $campaignSharedSetServiceClient->mutateCampaignSharedSets(
                    $this->customerId,
                    [$campaignSharedSetOperation]
            );

But API is giving error related to protobuf.

An uncaught Exception was encountered


Type:        Exception

Message:     Expect Google\Ads\GoogleAds\V3\Services\CampaignSharedSetOperation.

Filename:    /google-ads-php/vendor/google/protobuf/src/Google/Protobuf/Internal/GPBUtil.php

Line Number: 197

Google Ads API Forum Advisor Prod

unread,
May 4, 2020, 2:21:41 PM5/4/20
to chirag....@gmail.com, adwor...@googlegroups.com
Hi,

Could you please reply privately to author your full request and response  so I can see what the error you are facing is?

Thanks,
Reply all
Reply to author
Forward
0 new messages