donglu7816 2015-07-14 05:44
浏览 46

GoogleAds PHP SoapFault - AdError.CANNOT_SET_FIELD @ operations [0] .operand.ad.url

I am using the library googleads/googleads-php-lib from github.

I am trying to create a text ad, but I am getting an error that I cannot set the URL field. The code has been working for quite some time but has suddenly stopped due to this error.

The SoapFault exception that is thrown is:

[AdError.CANNOT_SET_FIELD @ operations[0].operand.ad.url]

My code is as follows:

require_once('Google/Api/Ads/AdWords/Lib/AdWordsUser.php');
$developerToken = '*removed*';
$clientCustomerId = '*removed*';
$userAgent = 'test';
$settingsIniPath = './vendor/googleads/googleads-php-lib/src/Google/Api/Ads/AdWords/settings.ini';
$oAuth = array(
    'client_id' => '*removed*',
    'client_secret' => '*removed*',
    'refresh_token' => '*removed*',
);
$adWordsUser = new AdWordsUser(null, $developerToken, $userAgent, $clientCustomerId, $settingsIniPath, $oAuth);
$adWordsUser->SetDefaultVersion('v201409');
$adGroupId = *removed*;

$textAd = new TextAd();
$textAd->headline = 'headline text';
$textAd->description1 = 'description1 text';
$textAd->description2 = 'description2 text';
$textAd->displayUrl = 'www.example.com';
$textAd->url = 'http://www.example.com/';

$adGroupAd = new AdGroupAd($adGroupId, $textAd);
$operations = array(new AdGroupAdOperation($adGroupAd, null, 'ADD'));
$adGroupAdService = $adWordsUser->GetService('AdGroupAdService');
$result = $adGroupAdService->mutate($operations);

I am not sure what could be causing this error. Any help would be greatly appreciated.

  • 写回答

1条回答 默认 最新

  • doujionggan9570 2015-07-14 08:08
    关注

    got caught with that too. The problem seems to be that "url" is no longer supported, you have to use "targetUrls" of upgraded URLs API instead:

    http://googleadsdeveloper.blogspot.cz/2015/05/reminder-adwords-destination-urls-will.html

    评论

报告相同问题?

悬赏问题

  • ¥50 导入文件到网吧的电脑并且在重启之后不会被恢复
  • ¥15 (希望可以解决问题)ma和mb文件无法正常打开,打开后是空白,但是有正常内存占用,但可以在打开Maya应用程序后打开场景ma和mb格式。
  • ¥20 ML307A在使用AT命令连接EMQX平台的MQTT时被拒绝
  • ¥20 腾讯企业邮箱邮件可以恢复么
  • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?
  • ¥15 错误 LNK2001 无法解析的外部符号
  • ¥50 安装pyaudiokits失败
  • ¥15 计组这些题应该咋做呀
  • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?
  • ¥15 让node服务器有自动加载文件的功能