尝试使用 api 3.1 在 facebook 上创建广告时出现此错误:
[2018-09-10 10:45:47] local.INFO: array (
'message' => 'Invalid parameter',
'type' => 'OAuthException',
'code' => 100,
'error_subcode' => 1885833,
'is_transient' => false,
'error_user_title' => 'Ad Must Be Associated With a Facebook Page',
'error_user_msg' => 'Ads and ad creatives must be associated with a Facebook Page. Try connecting your ad or ad creative to a Page and resubmit your ad.',
'fbtrace_id' => 'FUMJg2Q2z1e',
)
最佳答案
在 Facebook 页面帖子上找到了这个解决方案
=Breaking Change: Event Ads, Link Ads not Associated with Valid Page=
We recently announced an initiative to make the Facebook Advertising platform more transparent to Facebook users. Read more about this in
To support this initiative, we're deprecating Event Ads and Link Ads that are not connected to a valid page from the Marketing API.
This breaking change impacts all supported API versions, including the upcoming Marketing API version v2.11, and v2.10 and v2.9, which are available, but will be deprecated. This breaking change will take effect the week of Nov. 6, 2017.
As a result of this breaking change, you will no longer be able to create or edit Event Ads and Link Ads that are not connected to a valid page. Requests to do so will return the error: 'ErrorCode::ADPRO2__AD_MUST_HAVE_PAGE (1885833)'.
失败的选项
The following ad options used together will fail: ===Event Ads=== - Objective: 'EVENT_RESPONSES' - Creative fields: 'body, object_id' === Link Ads === - Objective: 'LINK_CLICKS' - Creative fields: 'title', 'body', 'object_url' containing 'image_file' or 'image_hash'
You can still create Event Ads and Link Ads if you provide a valid 'actor_id' in the ad creative's 'object_story_id' or 'object_story_spec' fields.
有效选项
These options used together are valid: === Event Ads === - Objective: 'EVENT_RESPONSES' - Creative fields: 'object_story_id' or 'object_story_spec' === Link Ads === - Objective: 'LINK_CLICKS' - Creative fields: 'object_story_id' or 'object_story_spec'
编辑----
最终我让它工作了,这是一个问题的组合。主要问题是广告的设置方式是不允许的,Facebook 文档与您被允许执行的操作不符。所以这是我在 php 中的工作广告
$data = file_get_contents($imageUrl);
$data = [
'bytes' => base64_encode($data),
'access_token' => $this->accessToken,
];
$response = $this->client->request('POST',
"act_{$accountId}/adimages", [
'form_params' => $data,
]);
$response = $this->readStream($response)->images->bytes;
$link = (object)[
'link' => $linkUrl,
];
$signUp = (object)[
'type' => "SIGN_UP",
'value' => $link,
];
$linkData = (object)[
'call_to_action' => $signUp,
'link' => $objectUrl,
'image_hash' => $response->hash,
'message' => $body,
];
$objectStory = (object)[
'link_data' => $linkData,
'page_id' => $pageId,
];
$data = (object)[
'name' => 'system-generated-' . $accountId,
'title' => $title,
'object_story_spec' => $objectStory,
'access_token' => $this->accessToken,
];
$response = $this->client->request('POST',
"act_{$accountId}/adcreatives", [
'form_params' => $data,
]);
这就是我制作实际广告的方式
$creative = (object)[
'creative_id' => $creativeId,
];
$data = (object)[
'name' => $name,
'creative' => $creative,
'adset_id' => $adSetId,
'status' => "PAUSED",
'access_token' => $this->accessToken,
];
$response = $this->client->request('POST',
"act_{$accountId}/ads", [
'form_params' => $data,
]);
关于php - 在 facebook api 上创建广告得到 error_subcode 1885833,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52273304/
出于纯粹的兴趣,我很好奇如何按顺序创建PI,而不是在过程结果之后生成数字,而是让数字在过程本身生成时显示。如果是这种情况,那么数字可以自行产生,我可以对以前看到的数字实现垃圾收集,从而创建一个无限系列。结果只是在Pi系列之后每秒生成一个数字。这是我通过互联网筛选的结果:这是流行的计算机友好算法,类机器算法:defarccot(x,unity)xpow=unity/xn=1sign=1sum=0loopdoterm=xpow/nbreakifterm==0sum+=sign*(xpow/n)xpow/=x*xn+=2sign=-signendsumenddefcalc_pi(digits
关闭。这个问题是opinion-based.它目前不接受答案。想要改进这个问题?更新问题,以便editingthispost可以用事实和引用来回答它.关闭4年前。Improvethisquestion我想在固定时间创建一系列低音和高音调的哔哔声。例如:在150毫秒时发出高音调的蜂鸣声在151毫秒时发出低音调的蜂鸣声200毫秒时发出低音调的蜂鸣声250毫秒的高音调蜂鸣声有没有办法在Ruby或Python中做到这一点?我真的不在乎输出编码是什么(.wav、.mp3、.ogg等等),但我确实想创建一个输出文件。
我正在使用这个:4.times{|i|assert_not_equal("content#{i+2}".constantize,object.first_content)}我之前声明过局部变量content1content2content3content4content5我得到的错误NameError:wrongconstantnamecontent2这个错误是什么意思?我很确定我想要content2=\ 最佳答案 你必须用一个大字母来调用ruby常量:Content2而不是content2。Aconstantnamestart
使用带有Rails插件的vim,您可以创建一个迁移文件,然后一次性打开该文件吗?textmate也可以这样吗? 最佳答案 你可以使用rails.vim然后做类似的事情::Rgeneratemigratonadd_foo_to_bar插件将打开迁移生成的文件,这正是您想要的。我不能代表textmate。 关于ruby-使用VimRails,您可以创建一个新的迁移文件并一次性打开它吗?,我们在StackOverflow上找到一个类似的问题: https://sta
我对最新版本的Rails有疑问。我创建了一个新应用程序(railsnewMyProject),但我没有脚本/生成,只有脚本/rails,当我输入ruby./script/railsgeneratepluginmy_plugin"Couldnotfindgeneratorplugin.".你知道如何生成插件模板吗?没有这个命令可以创建插件吗?PS:我正在使用Rails3.2.1和ruby1.8.7[universal-darwin11.0] 最佳答案 随着Rails3.2.0的发布,插件生成器已经被移除。查看变更日志here.现在
如何使用RSpec::Core::RakeTask初始化RSpecRake任务?require'rspec/core/rake_task'RSpec::Core::RakeTask.newdo|t|#whatdoIputinhere?endInitialize函数记录在http://rubydoc.info/github/rspec/rspec-core/RSpec/Core/RakeTask#initialize-instance_method没有很好的记录;它只是说:-(RakeTask)initialize(*args,&task_block)AnewinstanceofRake
关闭。这个问题需要detailsorclarity.它目前不接受答案。想改进这个问题吗?通过editingthispost添加细节并澄清问题.关闭8年前。Improvethisquestion为什么SecureRandom.uuid创建一个唯一的字符串?SecureRandom.uuid#=>"35cb4e30-54e1-49f9-b5ce-4134799eb2c0"SecureRandom.uuid方法创建的字符串从不重复?
我克隆了一个rails仓库,我现在正尝试捆绑安装背景:OSXElCapitanruby2.2.3p173(2015-08-18修订版51636)[x86_64-darwin15]rails-v在您的Gemfile中列出的或native可用的任何gem源中找不到gem'pg(>=0)ruby'。运行bundleinstall以安装缺少的gem。bundleinstallFetchinggemmetadatafromhttps://rubygems.org/............Fetchingversionmetadatafromhttps://rubygems.org/...Fe
我是Google云的新手,我正在尝试对其进行首次部署。我的第一个部署是RubyonRails项目。我基本上是在关注thisguideinthegoogleclouddocumentation.唯一的区别是我使用的是我自己的项目,而不是他们提供的“helloworld”项目。这是我的app.yaml文件runtime:customvm:trueentrypoint:bundleexecrackup-p8080-Eproductionconfig.ruresources:cpu:0.5memory_gb:1.3disk_size_gb:10当我转到我的项目目录并运行gcloudprevie
我正在阅读SandiMetz的POODR,并且遇到了一个我不太了解的编码原则。这是代码:classBicycleattr_reader:size,:chain,:tire_sizedefinitialize(args={})@size=args[:size]||1@chain=args[:chain]||2@tire_size=args[:tire_size]||3post_initialize(args)endendclassMountainBike此代码将为其各自的属性输出1,2,3,4,5。我不明白的是查找方法。当一辆山地自行车被实例化时,因为它没有自己的initialize方法