Hi Teja,
I am trying to implement block ip functionality using Ads API however I
could not find the steps of the code that needs to be written. I am trying
to follow this example (
https://github.com/googleads/google-ads-php/blob/master/examples/Targeting/AddCampaignTargetingCriteria.php)
however I am unable to make it work. Could you please guide me here and let
me know the steps so that I can write the code to do it? I have written
following code and I am not sure if I am on the right track:
$campaignResourceName = ResourceNames::forCampaign($adwords_user_id,
$adwords_campaign_id);
$ipBlock = new IpBlockInfo();
$ipBlock->setIpAddress($ipAddress);
$campaignCriterion = new CampaignCriterion([
// Creates a keyword with BROAD match type.
'keyword' => new KeywordInfo([
'text' => new StringValue(['value' => $adwords_campaign_name]),
'match_type' => KeywordMatchType::BROAD
]),
// Sets the campaign criterion as a negative criterion.
'negative' => new BoolValue(['value' => true]),
'campaign' => new StringValue(['value' => $campaignResourceName])
]);
$operation = new CampaignCriterionOperation();
$operation->setOperator('ADD');
$operation->setOperand($campaignCriterion);
$operations[] = $operation;
$campaignCriterionServiceClient =
$googleAdsClient->getCampaignCriterionServiceClient();
$response
=$campaignCriterionServiceClient->mutateCampaignCriteria($adwords_user_id,
$operations);
I look forward to hear from you soon.
Thanks,
Amrender
On Monday, 8 July 2019 20:09:38 UTC+5:30, adsapiforumadvisor wrote:
>
> Hello Amrender,
>
> To analyze further, could you please share the complete request and
> response log containing request id? Also please specify or share the guide
> that you followed to create OAuth credentials. You could use *reply
> privately to the author option* while sharing the information requested.
>
> Regards,
> Sai Teja, Google Ads API Team
>
>
> ref:_00D1U1174p._5001UAqLBq:ref
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
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
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/adwords-api/48120e92-d335-455a-a488-abd6981f3237%40googlegroups.com.