Re: IPBLOCK Adwords api php

2019-01-09 Thread 'Dhanya Sundararaju (AdWords API Team)' via AdWords API and Google Ads API Forum
Hi,

In order for us to track issues better, could you please elaborate your 
question in a new thread? 

Regards,
Dhanya, AdWords API Team

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/d0e3f728-8372-4df6-8249-9ba88cfd91ba%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: IPBLOCK Adwords api php

2019-01-09 Thread rajit bansal
Can u recode this in structural Approach?

On Wednesday, 19 July 2017 21:22:58 UTC+5:30, Shwetha Vastrad (AdWords API 
Team) wrote:
>
> Hi, 
>
> You can use the PHP code snippet below to add a negative IpBlock criterion 
> to your campaign.
>
> class AddIpBlock {
>
>   const CAMPAIGN_ID = 'YOUR_CAMPAIGN_ID';
>
>   public static function runExample(AdWordsServices $adWordsServices,
>   AdWordsSession $session, $campaignId, $locationFeedId) {
> $campaignCriterionService =
> $adWordsServices->get($session, CampaignCriterionService::class);
>
> $campaignCriteria = [];
>
> // Add a negative campaign criterion.
> $ipBlock = new IpBlock();
> $ipBlock->setIpAddress('IpAddress');
> $negativeCriterion = new NegativeCampaignCriterion();
> $negativeCriterion->setCampaignId($campaignId);
> $negativeCriterion->setCriterion($ipBlock);
>
> $operation = new CampaignCriterionOperation();
> $operation->setOperator(Operator::ADD);
> $operation->setOperand($negativeCriterion);
> $operations[] = $operation;
>
> $result = $campaignCriterionService->mutate($operations);
>
> // Print out some information about added campaign criteria.
> foreach ($result->getValue() as $campaignCriterion) {
>   printf(
>   "Campaign targeting criterion with ID %d and type '%s' was 
> added.\n",
>   $campaignCriterion->getCriterion()->getId(),
>   $campaignCriterion->getCriterion()->getType());
> }
>   }
>
>   public static function main() {
> // Generate a refreshable OAuth2 credential for authentication.
> $oAuth2Credential = (new OAuth2TokenBuilder())
> ->fromFile()
> ->build();
>
> // Construct an API session configured from a properties file and the 
> OAuth2
> // credentials above.
> $session = (new AdWordsSessionBuilder())
> ->fromFile()
> ->withOAuth2Credential($oAuth2Credential)
> ->build();
> self::runExample(
> new AdWordsServices(), $session, intval(self::CAMPAIGN_ID));
>   }
> }
>
> AddIpBlock::main();
>
> Regards,
> Shwetha, AdWords API Team.
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/4f50aa00-5f15-43ff-be69-31959ffa8fa3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: IPBLOCK Adwords api php

2018-03-26 Thread 'Dhanya Sundararaju (AdWords API Team)' via AdWords API Forum
Hi,

In order for us to track issues better, could you please elaborate your 
question in a new thread as this thread is quite old? 

Regards,
Dhnaya, AdWords API Team

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords 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 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/3ef389d6-30d5-4314-9f4e-53feddaf8f91%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: IPBLOCK Adwords api php

2018-03-25 Thread eitsec
REMOVE is not working

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords 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 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/9a71d1b5-4aa4-4c8c-9b7d-252535462185%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: IPBLOCK Adwords api php

2017-07-19 Thread 'Shwetha Vastrad (AdWords API Team)' via AdWords API Forum
Hi, 

You can use the PHP code snippet below to add a negative IpBlock criterion 
to your campaign.

class AddIpBlock {

  const CAMPAIGN_ID = 'YOUR_CAMPAIGN_ID';

  public static function runExample(AdWordsServices $adWordsServices,
  AdWordsSession $session, $campaignId, $locationFeedId) {
$campaignCriterionService =
$adWordsServices->get($session, CampaignCriterionService::class);

$campaignCriteria = [];

// Add a negative campaign criterion.
$ipBlock = new IpBlock();
$ipBlock->setIpAddress('IpAddress');
$negativeCriterion = new NegativeCampaignCriterion();
$negativeCriterion->setCampaignId($campaignId);
$negativeCriterion->setCriterion($ipBlock);

$operation = new CampaignCriterionOperation();
$operation->setOperator(Operator::ADD);
$operation->setOperand($negativeCriterion);
$operations[] = $operation;

$result = $campaignCriterionService->mutate($operations);

// Print out some information about added campaign criteria.
foreach ($result->getValue() as $campaignCriterion) {
  printf(
  "Campaign targeting criterion with ID %d and type '%s' was 
added.\n",
  $campaignCriterion->getCriterion()->getId(),
  $campaignCriterion->getCriterion()->getType());
}
  }

  public static function main() {
// Generate a refreshable OAuth2 credential for authentication.
$oAuth2Credential = (new OAuth2TokenBuilder())
->fromFile()
->build();

// Construct an API session configured from a properties file and the 
OAuth2
// credentials above.
$session = (new AdWordsSessionBuilder())
->fromFile()
->withOAuth2Credential($oAuth2Credential)
->build();
self::runExample(
new AdWordsServices(), $session, intval(self::CAMPAIGN_ID));
  }
}

AddIpBlock::main();

Regards,
Shwetha, AdWords API Team.

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords 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 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/d3e4493f-49df-4b0f-bc89-b3700c9f0944%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: IPBLOCK Adwords api php

2017-07-18 Thread SK. MOHTASIM BILLAH
Hi,

I am a asp.net developer and I am trying to develop the same thing (ip 
block) from my application.I am using .net client library and I can run the 
usual campaigns like campaign add, retrieve, keywords retrieve etc. If you 
were able to solve the issue then can you help me with the code. PHP or 
asp.net, either one will do if you can provide me.

Thanks
SK. Mohtasim Billah

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords 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 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/8bb76b74-1b4b-4c0e-ab0e-5c6acf30b5de%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: IPBLOCK Adwords api php

2017-02-06 Thread 'Shwetha Vastrad (AdWords API Team)' via AdWords API Forum
Hi,

Could you provide the error that you encounter when you perform this 
operation? Using the above program, you'll encounter the 
CampaignCriterionError.CONCRETE_TYPE_REQUIRED 
.
 
You need to create a concrete criterion of type IpBlock 

 
and then provide this to NegativeCampaignCriterion 
.
 
This example 

 shows 
how to add a negative keyword criterion at the campaign level. You need to 
add the negative IpBlock criterion in a similar fashion. Could you try this 
out and let me know if it works?

Regards,
Shwetha, AdWords API Team.

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords 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 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/9d1e1de9-3f1b-4e9b-9c84-b1f6dbe34b90%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Ipblock adwords api php???

2017-02-06 Thread 'Shwetha Vastrad (AdWords API Team)' via AdWords API Forum
Hi,

IpBlock is a negative criterion that should be applied at the campaign 
level. You need to use CampaignCriterionService 

 to 
retrieve your CampaignCriterion. The predicates, fields, etc. of a selector 
are protected variables in the PHP client library. This is the reason you 
encounter errors when you execute your program. You need to use the 
corresponding setters to populate these fields as shown here 
.
 
Could you try this out and let me know if it works? 

Regards,
Shwetha, AdWords API Team.

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords 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 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/6446745b-5f6e-498c-ae57-dbfbf0d075ed%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Ipblock adwords api php???

2017-02-06 Thread manager
Hello
i write this code but its not correct.
Any ideas??? Or is the other way???


*Fatal error*: Cannot access protected property

use Google\AdsApi\AdWords\AdWordsServices;
use Google\AdsApi\AdWords\AdWordsSession;
use Google\AdsApi\AdWords\AdWordsSessionBuilder;
use Google\AdsApi\AdWords\v201609\cm\AdGroupCriterionOperation;
use Google\AdsApi\AdWords\v201609\cm\AdGroupCriterionService;
use Google\AdsApi\AdWords\v201609\cm\AdGroupCriterion;
use Google\AdsApi\AdWords\v201609\cm\AdGroupCriterionServiceInterface;
use Google\AdsApi\AdWords\v201609\cm\AdGroupCriterionReturnValue;
use Google\AdsApi\AdWords\v201609\cm\Criterion;
use Google\AdsApi\AdWords\v201609\cm\Operator;
use Google\AdsApi\AdWords\v201609\cm\Selector;
use Google\AdsApi\AdWords\v201609\cm\Predicate;
use Google\AdsApi\AdWords\v201609\cm\Placement;
use Google\AdsApi\Common\OAuth2TokenBuilder;


class Updateip {
const campaignId = '';
protected $selector;
  public static function runExample(
 AdWordsServices $adWordsServices,
  AdWordsSession $session) {
// Get the AdGroupCriterionService.

$adGroupCriterionService =
$adWordsServices->get($session, AdGroupCriterionService::class);

  $selector = new Selector();

$selector->predicates[] = new Predicate('CampaignId', 'IN', 
array($campaignId));
$selector->predicates[] = new Predicate('CriteriaType', 'IN', 
array('IP_BLOCK'));
$selector->predicates[] = new Predicate('ipAddress', 'IN', 
array('10.10.10.10'));
$page = $campaignCriterionService->get($selector);
print_r($page);

  }

  public static function main() {
// Generate a refreshable OAuth2 credential for authentication.
$oAuth2Credential = (new OAuth2TokenBuilder())
->fromFile()
->build();

// Construct an API session configured from a properties file and the 
OAuth2
// credentials above.
$session = (new AdWordsSessionBuilder())
->fromFile()
->withOAuth2Credential($oAuth2Credential)
->build();


 self::runExample(
new AdWordsServices(), $session);
  }
}

Updateip::main();



Thanks 
MK

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords 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 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/9d8ac14e-e383-44f6-a4ca-e9857e5ad750%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


IPBLOCK Adwords api php

2017-02-06 Thread manager

HI all  
I want to block IP but somwhere i have 
problem at code. Can you help me please???
Here is the code

class UpdateKeyword {
const campaignId = '367448090';

 public static function runExample(AdWordsServices $adWordsServices,
  AdWordsSession $session, $campaignId) {
$campaignCriterionService = $adWordsServices->get($session, 
CampaignCriterionService::class);
  $negativeCampaignCriterion = new 
NegativeCampaignCriterion($campaignId,"IsNegative", "IpBlock");

 $negativeCampaignCriterion->Id = "222";
  $negativeCampaignCriterion->ipAddress="10.10.10.10";
 

  // Create operations.
  $operation = new CampaignCriterionOperation();
  $operation->setoperand ($negativeCampaignCriterion);
$operation->setOperator(Operator::ADD);
$operations[] = $operation;

  // Add campaign criteria.
$campaignCriterion =
$campaignCriterionService->mutate($operations)->getValue()[0];

  }

  public static function main() {
// Generate a refreshable OAuth2 credential for authentication.
$oAuth2Credential = (new OAuth2TokenBuilder())
->fromFile()
->build();

// Construct an API session configured from a properties file and the 
OAuth2
// credentials above.
$session = (new AdWordsSessionBuilder())
->fromFile()
->withOAuth2Credential($oAuth2Credential)
->build();


self::runExample(
new AdWordsServices(), $session, intval(self::campaignId));
  }
}

UpdateKeyword::main();

thanks

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords 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 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/ae0e06a3-273c-4206-89a6-d6bde6af52b5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.