0
votes

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 
2

2 Answers

2
votes

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.

1
votes

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.