0

I am trying to run a Responsive ad example using adwords api library (php) but it is giving me the following error

Fatal error: Uncaught exception 'Google\AdsApi\AdWords\v201702\cm\ApiException' with message '[OperationAccessDenied.OPERATION_NOT_PERMITTED_FOR_CAMPAIGN_TYPE @ operations[0].operand.ad; trigger:'SEARCH']' in C:\xampp\htdocs\adfollower\app\Utils\adfollower\src\Google\AdsApi\Common\Util\Reflection.php:39 Stack trace: #0 C:\xampp\htdocs\adfollower\app\Utils\adfollower\src\Google\AdsApi\Common\Util\Reflection.php(39): ReflectionClass->newInstanceArgs(Array) 
    #1 C:\xampp\htdocs\adfollower\app\Utils\adfollower\src\Google\AdsApi\Common\AdsSoapClient.php(162): Google\AdsApi\Common\Util\Reflection->createInstance('Google\\AdsApi\\A...', '[OperationAcces...') 
    #2 C:\xampp\htdocs\adfollower\app\Utils\adfollower\src\Google\AdsApi\Common\AdsSoapClient.php(126): Google\AdsApi\Common\AdsSoapClient->parseApiExceptionFromSoapFault(Object(SoapFault)) 
    #3 C:\xampp\htdocs\adfollower\app\Utils\adfollower\src\Google\AdsApi\AdWords\v201702\cm\AdGroupAdService.php(189): Google\AdsApi\Common\AdsSoapClient->__soapCall('mutate', Array) 
    #4 C:\xampp\ht in C:\xampp\htdocs\adfollower\app\Utils\adfollower\src\Google\AdsApi\Common\Util\Reflection.php on line 39 
1

2 Answers 2

2

The error indicates that you are trying to add a creative to a campaign that is not compatible with its type.

In your specific scenario, you are adding a Responsive Ad to a Search Network Campaign, but this type of creative can only be used in a Display Network Campaign.

The solution is to create a new Display campaign with the proper targetting settings and update the affected campaign ID in your code.

Sign up to request clarification or add additional context in comments.

1 Comment

Yes It worked fine for me I created a new campaign of Display Network
1

From the error above, it looks like your access details you are providing is incorrect as its giving a permissions error.

You can find an example here: https://github.com/googleads/googleads-php-lib/tree/master/examples/AdWords

Otherwise can you please paste your code (without your access details) so we can see how you are implementing it.

2 Comments

Actually I am running this example: github.com/googleads/googleads-php-lib/blob/master/examples/… other examples are running fine but this specific example is giving me the error
I am using a test mcc account for this

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.