我的任务是获取每次点击成本、展示次数、覆盖面、总支出等的估算。 我正在尝试使用reachFrequencyPrediction API,但在执行请求后出现以下错误:
您无权开展覆盖面和频率活动。
我尝试在 Facebook 广告文档上搜索,但没有找到使用它所需的权限。
我已阅读使用此功能的限制https://developers.facebook.com/docs/marketing-api/reachandFrequency/#restrictions,我似乎对此没有任何问题。
我已经附上了我的代码,也许我做错了什么。
/**
* Method that creates the campaign and returns its id
* Finally these estimates will be saved through the controller ReportController@store_meta
*/
public function crea_simulazione(StoreMetaReportRequest $request)
{
echo "<pre>";
// var_dump($request->all());die;
$campaign = new Campaign(null, $this->account->id);
$campaign->setData([
CampaignFields::NAME => "Campagna " . uniqid(),
CampaignFields::OBJECTIVE => $request->input('obiettivo'),
CampaignFields::SPECIAL_AD_CATEGORIES => array(),
]);
$campaign->create([
Campaign::STATUS_PARAM_NAME => Campaign::STATUS_PAUSED
]);
echo "Campagna creata: " . $campaign->id . "\n";
$fieldsAdSet = [
'name' => "Ad Set " . uniqid(),
'type_budget' => $request->input('type_budget'),
'budget' => $request->input('importo'),
'targeting' => $request->input('tags'),
'luogo' => $request->input('paese_ads'),
'age_min' => $request->input('min_eta'),
'age_max' => $request->input('max_eta'),
'start_ads' => $request->input('start_ads'),
'end_ads' => $request->input('end_ads'),
'genere' => $request->input('genere'),
'page_id' => $request->input('pagina_facebook'),
'billing_event' => $request->input('obiettivo'),
'opt_goal' => $request->input('optimization_goal'),
'country_code' => $request->input('country_ads'),
'region_code' => $request->input('region_ads'),
'tags_values' => $request->input('tags_values')
];
$tags = [];
foreach ($fieldsAdSet['tags_values'] as $key => $value) {
$tags[] = ['id' => $value['id'], 'name' => $value['value']];
}
$fields = array(
AdSetFields::NAME => $fieldsAdSet['name'],
// AdSetFields::OPTIMIZATION_GOAL => $fieldsAdSet['billing_event'],
// AdSetFields::BILLING_EVENT => $fieldsAdSet['opt_goal'],
//inserisco questi due però sono da togliere e sostituire con quello che viene fornito da fronted.
AdSetFields::OPTIMIZATION_GOAL => AdSetOptimizationGoalValues::REACH,
AdSetFields::BILLING_EVENT => AdSetBillingEventValues::IMPRESSIONS,
AdSetFields::BID_AMOUNT => 2,
AdSetFields::DESTINATION_TYPE => AdSetDestinationTypeValues::WEBSITE,
AdSetFields::DAILY_BUDGET => intval($fieldsAdSet['budget']) * 100,
AdSetFields::CAMPAIGN_ID => $campaign->id,
AdSetFields::TARGETING => (new Targeting())->setData(array(
TargetingFields::GEO_LOCATIONS => array(
'cities' => array(
array(
'key' => '1188733',
'radius' => 20,
'distance_unit' => 'kilometer'
),
),
),
TargetingFields::USER_OS => array('iOS', 'Android', 'Windows'),
TargetingFields::INTERESTS => $tags,
TargetingFields::AGE_MIN => $fieldsAdSet['age_min'],
TargetingFields::AGE_MAX => $fieldsAdSet['age_max'] - 20,
TargetingFields::GENDERS => $fieldsAdSet['genere'] == 'all' ? [1, 2] : [$fieldsAdSet['genere']]
)),
);
/**
* I define the type of campaign.
* If the budget type is daily then the spending limit that Facebook will set is daily with the aim of keeping it lower and lower.
* While if it's lifetime you're telling Facebook to optimize the AdSet to get the lowest possible cost without daily budget limits.
*/
if ($fieldsAdSet['type_budget'] == 'day') {
$fields[AdSetFields::DAILY_BUDGET] = $fieldsAdSet['budget'] * 100; // Converto in centesimi perché altrimenti non lo accetta
$fields[AdSetFields::BID_STRATEGY] = AdSetBidStrategyValues::LOWEST_COST_WITH_BID_CAP;
} else if ($fieldsAdSet['type_budget'] == 'lifetime') {
$fields[AdSetFields::BID_AMOUNT] = $fieldsAdSet['budget'] * 100; // Converto in centesimi perché altrimenti non lo accetta
$fields[AdSetFields::BID_STRATEGY] = AdSetBidStrategyValues::LOWEST_COST_WITHOUT_CAP;
}
$this->reachfrequency($fieldsAdSet['billing_event'],$fields,$campaign->id);
echo "End reach frequency\n";
die;
}
public function reachfrequency($obbiettivo,$arr,$idCamapagna)
{
$a = [
'budget' => $arr[AdSetFields::DAILY_BUDGET],
'day_parting_schedule' => [[
'start_minute' => 360,
'end_minute' => 1440,
'days' => array(0, 1, 2, 3, 4, 5, 6)
]],
'destination_id' => "1730870867215691", // Page id - Brain computing
'frequency_cap' => 2,
'interval_frequency_cap_reset_period' => 48,
'objective' => $obbiettivo,
'optimization_goal' => $arr[AdSetFields::OPTIMIZATION_GOAL],
'prediction_mode' => 1,
'reach' => 1000000,
'start_time' => (new DateTime('+1 day'))->getTimestamp(),
'end_time' => (new DateTime('+8 day'))->getTimestamp(),
'target_spec' => [
'geo_locations' => [
'countries' => ['IT'],
],
'age_min' => 18,
'age_max' => 65,
],
'campaign_group_id' => $idCamapagna,
];
$esito = Api::instance()->call('/' . env('FACEBOOK_ACCOUNT_ID_SANBOX') . "/reachfrequencypredictions", RequestInterface::METHOD_POST, $a);
var_dump($esito);
die;
}
我正在使用 SandBox 帐户,这可能是原因吗?
覆盖范围和频率活动的授权是指在 Facebook 和 TikTok 等广告平台上使用该特定活动购买类型所需的权限或资格。以下是我们可以从搜索结果中收集到的信息: 在 TikTok 广告管理器上,覆盖范围和频率 (R&F) 是一种广告活动购买类型,允许广告商控制其覆盖的受众以及他们在投放前看到广告消息的次数。
不过,目前仅适用于符合条件的客户,广告商需要联系其销售代表以获取更多信息。
在 Facebook 上,符合条件的广告商可以使用覆盖范围和频率活动,他们可以选择这种购买类型来实现特定的营销目标,例如品牌知名度。
但搜索结果中并未提及具体的授权要求或资质。 值得注意的是,覆盖范围和频率活动的授权或资格可能会因平台和具体广告目标而异。广告商应联系相应平台或其销售代表,了解有关授权流程和要求的更多信息。 访问 www.creationinfused.com