Hi 
I have an issue about updating a PositiveGeoTargetType in case of 
UniversalApp Campaign.
Is Google Adwords API supports 'AREA_OF_INTEREST' Type ?
When I try to update 'AREA_OF_INTEREST' as the value of 
PositiveGeoTargetType, 
The API always return 'OPERATION_NOT_PERMITTED_FOR_CAMPAIGN_TYPE' error.
I attached my codes and return message. 
It would be great to get any feedback ASAP.
Thanks. [image: 캡처.PNG]

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/bef582b5-9612-45f0-b261-573710627b3an%40googlegroups.com.
<?php 

$this->setAjaxHeader();
$this->req->setJsonResult(true);

$customerId = $this->req->request("customerId", "");
$campaignId = $this->req->request("campaignId", "", false);
$adgroupId = $this->req->request("adgroupId", "", false);
$adId = $this->req->request("adId", "", false);
$sTime = $this->getTime();
$model = Lemon_Instance::getObject("Lemon_Model", true);

if($campaignId){
        $sql = "SELECT * FROM tmp_AppPromotion_Campaign WHERE 
CustomerId='".$customerId."' and CampaignId='".$campaignId."'  ";
        $campaignRs = $model->db->exeSql($sql);

        $criterionSql = "select * from tmp_criterion where 
customerId='".$customerId."' and campaignId='".$campaignId."' and 
gubun='campaign'";
        $criterionRs = $model->db->exeSql($criterionSql);
        $campaignLanguageArr = array();
        $campaignLocationTargetArr = array();
        $campaginLocationNegativeArr = array();

        if(count($criterionRs) > 0){
                for($i=0;$i<count($criterionRs);$i++){
                        if($criterionRs[$i]['crtiereionType'] == 'language'){
                                $campaignLanguageArr[] = 
$criterionRs[$i]['language'];
                        }
                        if($criterionRs[$i]['crtiereionType'] == 
'locationTarget'){
                                $campaignLocationTargetArr[] = 
$criterionRs[$i]['locationTarget'];
                        }
                        if($criterionRs[$i]['crtiereionType'] == 
'locationNegative'){
                                $campaginLocationNegativeArr[] = 
$criterionRs[$i]['locationNegative'];
                        }
                }
        }
        if(!empty($campaignLanguageArr)){
                $languageCheck = $this->rtn_array_check($campaignLanguageArr);
                $campaignLanguage = ($languageCheck)?$campaignLanguageArr:"";
        }
        if(!empty($campaignLocationTargetArr)){
                $locationCheck = 
$this->rtn_array_check($campaignLocationTargetArr);
                $campaignLocationTarget = 
($locationCheck)?$campaignLocationTargetArr:"";
        }
        if(!empty($campaginLocationNegativeArr)){
                $negativeLanguageCheck = 
$this->rtn_array_check($campaginLocationNegativeArr);
                $campaginLocationNegative = 
($negativeLanguageCheck)?$campaginLocationNegativeArr:"";
        }

        $conversionTypeIdsSql = "SELECT * FROM tmp_SelectiveOptimization WHERE 
CustomerId = '".$customerId."' AND CampaignId = '".$campaignId."' ";
        $conversionTypeIdsRs = $model->db->exeSql($conversionTypeIdsSql);
        $conversionTypeIdsArr = array();

        if(count($conversionTypeIdsRs) > 0 && !empty($conversionTypeIdsRs)){
                for($i=0; $i<count($conversionTypeIdsRs); $i++){
                        $conversionTypeIdsArr[] = 
$conversionTypeIdsRs[$i]['ConversionTypeIds'];
                }
        }

        $CapaignName                                = 
$campaignRs[0]['CampaignName'];
        $startDate                                  = 
$campaignRs[0]['StartDate'];
        $endDate                                    = $campaignRs[0]['EndDate'];
        $endDateChk                                 = 
$campaignRs[0]['EndDateChk'];
        $location                                   = 
$campaignRs[0]['location'];
        $language                                   = $campaignLanguage;
        $positiveGeoTargetType                      = 
$campaignRs[0]['positiveGeoTargetType'];
        $negativeGeoTargetType                      = 
$campaignRs[0]['negativeGeoTargetType'];
        $budgetId                                   = 
$campaignRs[0]['budgetId'];
        $BiddingStrategyType                        = 
$campaignRs[0]['biddingStrategyType'];
        $BiddingStartegyGoalType                    = 
$campaignRs[0]['biddingStrategyGoalType'];
        $target_check                               = 
$campaignRs[0]['target_check'];
        $TargetCpaBiddingSchemeTargetCpa            = 
$campaignRs[0]['TargetCpaBiddingSchemeTargetCpa'];
        $business_action_inapp                      = 
$campaignRs[0]['business_action_inapp'];
        $target_cost_per_conversion_inapp           = 
$campaignRs[0]['target_cost_per_conversion_inapp'];
        $budgetAmount                               = 
$campaignRs[0]['budgetAmount'];
        $locationTarget                             = $campaignLocationTarget;
        $locationNegative                           = $campaginLocationNegative;

        $datas = array(
                "campaignId"                            => $campaignId,
                "customerId"                            => $customerId,
                "CampaignName"                          => $CapaignName,
                "startDate"                             => $startDate,
                "endDate"                               => $endDate,
                "endDateChk"                            => $endDateChk,
                'location'                              => $location,
                'language'                              => $language,
                'positiveGeoTargetType'                 => 
$positiveGeoTargetType,
                'negativeGeoTargetType'                 => 
$negativeGeoTargetType,
                'budget'                                => $budgetAmount,
                'budgetId'                              => $budgetId,
                'locationTarget'                        => $locationTarget,
                'locationNegative'                      => $locationNegative,
                'biddingStrategyType'                   => $BiddingStrategyType,
                'biddingStrategyGoalType'               => 
$BiddingStartegyGoalType,
                'conversionTypeIds'                     => 
$conversionTypeIdsArr,
                'target_check'                          => $target_check,
                "TargetCpaBiddingSchemeTargetCpa"       => 
$TargetCpaBiddingSchemeTargetCpa,
                'business_action_inapp'                 => 
$business_action_inapp,
                'target_cost_per_conversion_inapp'      => 
$target_cost_per_conversion_inapp
        );
        
        $params = json_encode($datas);
        print_r($params);
        $file = $this->path['google_ads_path'] . 
"DboundUpdate/SetAppPromotionCampaignUpdate.php";
        $cmd = sprintf("php $file $customerId $campaignId %s", 
escapeshellarg($params));
        $json = @shell_exec($cmd);
        $campaign_decode = json_decode($json, true);
        print_r($campaign_decode);
        exit;
?>
php SetAppPromotionCampaignUpdate.php 5073046955 11546435421 
'{"campaignId":"11546435421","customerId":"5073046955","CampaignName":"\ub514\ubcf4\ub514\ubcf444","startDate":"20201104","endDate":"20220103","endDateChk":"Y","location":"other","language":null,"positiveGeoTargetType":"AREA_OF_INTEREST","negativeGeoTargetType":"DONT_CARE","budget":null,"budgetId":null,"locationTarget":null,"locationNegative":null,"biddingStrategyType":null,"biddingStrategyGoalType":null,"conversionTypeIds":null,"target_check":null,"TargetCpaBiddingSchemeTargetCpa":null,"business_action_inapp":null,"target_cost_per_conversion_inapp":null}'
[2020-12-01T10:27:22.091126+09:00] AW_SOAP.INFO: clientCustomerId=5073046955 
operations=1 service=CampaignCriterionService method=query responseTime=291 
requestId=0005b55d073ec5da0a6260c316048863 server=adwords.google.com isFault=0 
faultMessage=  
[2020-12-01T10:27:22.777617+09:00] AW_SOAP.INFO: clientCustomerId=5073046955 
operations=4 service=CampaignCriterionService method=mutate responseTime=294 
requestId=0005b55d07493c430aa782c25401a0f8 server=adwords.google.com isFault=0 
faultMessage=  
[2020-12-01T10:27:23.422300+09:00] AW_SOAP.WARNING: clientCustomerId=5073046955 
operations=1 service=CampaignService method=mutate responseTime=229 
requestId=0005b55d0753ee220a6261421c0c1017 server=adwords.google.com isFault=1 
faultMessage=[OperationAccessDenied.OPERATION_NOT_PERMITTED_FOR_CAMPAIGN_TYPE @ 
operations[0].operand.settings[0].positiveGeoTargetType; 
trigger:'AREA_OF_INTEREST']  
[2020-12-01T10:27:23.422358+09:00] AW_SOAP.NOTICE: POST 
/api/adwords/cm/v201809/CampaignService?wsdl HTTP/1.1
Host: adwords.google.com
Connection: close
User-Agent: PHP-SOAP/7.3.18
Content-Type: text/xml; charset=utf-8
SOAPAction: ""
Content-Length: 1254
Authorization: REDACTED

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"; 
xmlns:ns1="https://adwords.google.com/api/adwords/cm/v201809"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";><SOAP-ENV:Header><ns1:RequestHeader><ns1:clientCustomerId>5073046955</ns1:clientCustomerId><ns1:developerToken>REDACTED</ns1:developerToken><ns1:userAgent>unknown
 (AwApi-PHP, googleads-php-lib/47.0.0, 
PHP/7.3.18)</ns1:userAgent><ns1:validateOnly>false</ns1:validateOnly><ns1:partialFailure>false</ns1:partialFailure></ns1:RequestHeader></SOAP-ENV:Header><SOAP-ENV:Body><ns1:mutate><ns1:operations><ns1:operator>SET</ns1:operator><ns1:operand><ns1:id>11546435421</ns1:id><ns1:name>디보디보44</ns1:name><ns1:status>PAUSED</ns1:status><ns1:endDate>20220103</ns1:endDate><ns1:settings
 
xsi:type="ns1:GeoTargetTypeSetting"><ns1:positiveGeoTargetType>AREA_OF_INTEREST</ns1:positiveGeoTargetType><ns1:negativeGeoTargetType>DONT_CARE</ns1:negativeGeoTargetType></ns1:settings><ns1:advertisingChannelType>MULTI_CHANNEL</ns1:advertisingChannelType><ns1:advertisingChannelSubType>UNIVERSAL_APP_CAMPAIGN</ns1:advertisingChannelSubType></ns1:operand></ns1:operations></ns1:mutate></SOAP-ENV:Body></SOAP-ENV:Envelope>

HTTP/1.1 500 Internal Server Error
Content-Type: text/xml; charset=UTF-8
Date: Tue, 01 Dec 2020 01:27:23 GMT
Expires: Tue, 01 Dec 2020 01:27:23 GMT
Cache-Control: private, max-age=0
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
Content-Security-Policy: frame-ancestors 'self'
X-XSS-Protection: 1; mode=block
Server: GSE
Alt-Svc: h3-29=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-Q050=":443"; 
ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; 
ma=2592000; v="46,43"
Accept-Ranges: none
Vary: Accept-Encoding
Connection: close
Transfer-Encoding: chunked

<soap:Envelope 
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";><soap:Header><ResponseHeader
 
xmlns="https://adwords.google.com/api/adwords/cm/v201809";><requestId>0005b55d0753ee220a6261421c0c1017</requestId><serviceName>CampaignService</serviceName><methodName>mutate</methodName><operations>1</operations><responseTime>229</responseTime></ResponseHeader></soap:Header><soap:Body><soap:Fault><faultcode>soap:Client</faultcode><faultstring>[OperationAccessDenied.OPERATION_NOT_PERMITTED_FOR_CAMPAIGN_TYPE
 @ operations[0].operand.settings[0].positiveGeoTargetType; 
trigger:'AREA_OF_INTEREST']</faultstring><detail><ApiExceptionFault 
xmlns="https://adwords.google.com/api/adwords/cm/v201809";><message>[OperationAccessDenied.OPERATION_NOT_PERMITTED_FOR_CAMPAIGN_TYPE
 @ operations[0].operand.settings[0].positiveGeoTargetType; 
trigger:'AREA_OF_INTEREST']</message><ApplicationException.Type>ApiException</ApplicationException.Type><errors
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:type="OperationAccessDenied"><fieldPath>operations[0].operand.settings[0].positiveGeoTargetType</fieldPath><fieldPathElements><field>operations</field><index>0</index></fieldPathElements><fieldPathElements><field>operand</field></fieldPathElements><fieldPathElements><field>settings</field><index>0</index></fieldPathElements><fieldPathElements><field>positiveGeoTargetType</field></fieldPathElements><trigger>AREA_OF_INTEREST</trigger><errorString>OperationAccessDenied.OPERATION_NOT_PERMITTED_FOR_CAMPAIGN_TYPE</errorString><ApiError.Type>OperationAccessDenied</ApiError.Type><reason>OPERATION_NOT_PERMITTED_FOR_CAMPAIGN_TYPE</reason></errors></ApiExceptionFault></detail></soap:Fault></soap:Body></soap:Envelope>
  
PHP Fatal error:  Uncaught Google\AdsApi\AdWords\v201809\cm\ApiException: 
[OperationAccessDenied.OPERATION_NOT_PERMITTED_FOR_CAMPAIGN_TYPE @ 
operations[0].operand.settings[0].positiveGeoTargetType; 
trigger:'AREA_OF_INTEREST'] in 
/home/gitlab-runner/www/adcms/vendor/google/src/Google/AdsApi/Common/Util/Reflection.php:43
Stack trace:
#0 
/home/gitlab-runner/www/adcms/vendor/google/src/Google/AdsApi/Common/Util/Reflection.php(43):
 ReflectionClass->newInstanceArgs(Array)
#1 
/home/gitlab-runner/www/adcms/vendor/google/src/Google/AdsApi/Common/AdsSoapClient.php(202):
 Google\AdsApi\Common\Util\Reflection->createInstance('Google\\AdsApi\\A...', 
Array)
#2 
/home/gitlab-runner/www/adcms/vendor/google/src/Google/AdsApi/Common/AdsSoapClient.php(164):
 
Google\AdsApi\Common\AdsSoapClient->parseApiExceptionFromSoapFault(Object(SoapFault))
#3 
/home/gitlab-runner/www/adcms/vendor/google/src/Google/AdsApi/AdWords/v201809/cm/CampaignService.php(181):
 Google\AdsApi\Common\AdsSoapClient->__soapCall('mutate', Array)
#4 /home/gitlab-runner/www/adcms/ve in 
/home/gitlab-runner/www/adcms/vendor/google/src/Google/AdsApi/Common/Util/Reflection.php
 on line 43

Reply via email to