Closed czmarcos closed 6 years ago
Solved
Conversion values can be extracted through actions and actions_values fields:
https://developers.facebook.com/docs/marketing-api/reference/ad-campaign/insights/
Is it possible you could provide an example how to use this in the facebook php ad sdk?
Sure, use the getInsights endpoint and add the ACTIONS field.
https://developers.facebook.com/docs/marketing-api/reference/ad-campaign/insights/
Quick example:
$params = array(
'time_range' => array(
'since' => $today,
'until' => $today,
),
'level' => 'adset',
'limit' => '500'
);
$fields = array(
AdsInsightsFields::ADSET_NAME,
AdsInsightsFields::ADSET_ID,
AdsInsightsFields::CAMPAIGN_NAME,
AdsInsightsFields::CAMPAIGN_ID,
AdsInsightsFields::ACTIONS
);
$insights = $account->getInsights($fields, $params);
foreach ($insights as $insight) {
// here you have the list of all actions of your adset (eg: clicks, conversions, add_to_cart, purchases, engagements, lead, etc)
$insight->{AdsInsightsFields::ACTIONS};
}
thx!
Is there any endpoint where I can retrieve conversion values of adsets for custom conversions like Leads, AddToCart, AddPaymentInfo, etc...?