madhabkirank / google-api-adwords-php

Automatically exported from code.google.com/p/google-api-adwords-php
0 stars 0 forks source link

Unsuppossed OPERATION_NOT_SUPPORTED error #29

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. add new campaign, and get the campaignId (this step done successfuly)
2. when add campaign targeting got this OPERATION NOT SUPPORTED error.
Below are the code for Add campaign Targeting :

$this->user->SetClientId($clientId);
            // Start Campaign Targeting Service Operation
            $campaignTargetService =
$this->user->GetCampaignTargetService($this->VERSION,$this->ENDPOINT);

            // Create Network Target List
            foreach($networks as $network){
                if($network == 'GOOGLE_SEARCH'){
                    $googleNetworkTarget = new NetworkTarget();
                    $googleNetworkTarget->networkCoverageType = 'GOOGLE_SEARCH';
                    $targetList[] = $googleNetworkTarget;
                }
                if($network == 'SEARCH_NETWORK'){
                    $searchNetworkTarget = new NetworkTarget();
                    $searchNetworkTarget->networkCoverageType = 'SEARCH_NETWORK';
                    $targetList[] = $searchNetworkTarget;
                }
                if($network == 'CONTENT_CONTEXTUAL'){
                    $contextualNetworkTarget = new NetworkTarget();
                    $contextualNetworkTarget->networkCoverageType = 'CONTENT_CONTEXTUAL';
                    $targetList[] = $contextualNetworkTarget;
                }

            }

            $networkTargetList = new NetworkTargetList();
            $networkTargetList->targets = $targetList;
            $networkTargetList->campaignId = $campaignId;

            // Create operations
            $networkTargetOperation = new CampaignTargetOperation(); 
            $networkTargetOperation->operand = $networkTargetList;
            $networkTargetOperation->operator = 'ADD';

            $operations[] = $networkTargetOperation;

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

Using adword v2009, operating system mac.

Every others API was successfull, only this particular
CampaignTargetService got OPERATOR_NOT_SUPPORTED.

Original issue reported on code.google.com by hudars...@gmail.com on 20 May 2010 at 4:27

GoogleCodeExporter commented 8 years ago
The CampaignTargetService only supports the SET operator.  An example of how to 
use 
this service is included with the library:

http://code.google.com/p/google-api-adwords-
php/source/browse/trunk/examples/v200909/SetCampaignTargets.php

Original comment by api.ekol...@gmail.com on 20 May 2010 at 1:53