在Facebook API上创建广告获取错误_子代码1885833 [英] Creating adcreative on facebook api getting error_subcode 1885833

查看:127
本文介绍了在Facebook API上创建广告获取错误_子代码1885833的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当尝试使用api 3.1在facebook上创建广告时,出现此错误:

When trying to create an adcreative on facebook using api 3.1 i was getting this error:

[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页面帖子上找到了此解决方案

Found this solution on a Facebook page post

=重大变化:事件广告,链接广告未与有效页面相关联

=Breaking Change: Event Ads, Link Ads not Associated with Valid Page=

我们最近宣布了一项举措,以制作Facebook广告 平台对Facebook用户更加透明.进一步了解此内容

We recently announced an initiative to make the Facebook Advertising platform more transparent to Facebook users. Read more about this in

为支持该计划,我们不建议使用事件广告和链接广告 没有通过Marketing API连接到有效页面的页面.

To support this initiative, we're deprecating Event Ads and Link Ads that are not connected to a valid page from the Marketing API.

此重大更改会影响所有受支持的API版本,包括 即将推出的Marketing API版本v2.11,v2.10和v2.9,分别是 可用,但将不推荐使用.这一重大变化将需要 从2017年11月6日起生效.

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.

此重大更改的结果是,您将不再能够 创建或编辑未与广告相关联的事件广告和链接广告 有效页面.这样做的请求将返回错误: 'ErrorCode :: ADPRO2__AD_MUST_HAVE_PAGE(1885833)'.

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)'.

失败选项

以下广告选项一起使用将失败: ===活动广告=== -目标:"EVENT_RESPONSES" -广告素材字段:"body,object_id" ===链接广告=== -目标:"LINK_CLICKS" -广告素材字段:标题",正文",包含"image_file"或"image_hash"的"object_url"

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'

如果您提供有效的信息,则仍可以创建事件广告和链接广告 广告素材的"object_story_id"中的"actor_id"或 "object_story_spec"字段.

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.

有效选项

这些选项一起使用是有效的: ===活动广告=== -目标:"EVENT_RESPONSES" -广告素材字段:"object_story_id"或"object_story_spec" ===链接广告=== -目标:"LINK_CLICKS" -广告素材字段:"object_story_id"或"object_story_spec"

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'

链接来自: https://www.facebook.com/marketingdevelopers/posts/=breaking-change:-event-ads-link/1469189583195436/

编辑----

最终我使它工作了,这是各种问题的结合.主要的问题是,广告素材的设置方式不允许,facebook文档与您所允许的操作不匹配.所以这是我在php中的工作乐趣

Eventually i got it working, it was a combination of problems. the main problem was that the adcreative was set up in a way that was not allowed, facebook docs don't match to what you are allowed to do. So this is my working adcreative in 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,
    ]);

这就是我制作实际广告的方式

And this is how I create the actual ad

$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,
    ]);

这篇关于在Facebook API上创建广告获取错误_子代码1885833的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆