I am trying to get Facebook Conversion and Conversion Value Using the Facebook API. The result i am getting is this :
actions: [
{
action_type: "onsite_conversion.post_save",
value: "29"
},
{
action_type: "like",
value: "1"
},
{
action_type: "link_click",
value: "1594"
},
{
action_type: "post",
value: "12"
},
{
action_type: "post_reaction",
value: "168"
},
{
action_type: "landing_page_view",
value: "1290"
},
{
action_type: "offsite_conversion.fb_pixel_add_payment_info",
value: "19"
},
{
action_type: "offsite_conversion.fb_pixel_add_to_cart",
value: "96"
},
{
action_type: "offsite_conversion.fb_pixel_initiate_checkout",
value: "14"
},
{
action_type: "offsite_conversion.fb_pixel_purchase",
value: "1"
},
{
action_type: "post_engagement",
value: "1803"
},
{
action_type: "page_engagement",
value: "1804"
},
{
action_type: "add_payment_info",
value: "19"
},
{
action_type: "omni_add_to_cart",
value: "96"
},
{
action_type: "omni_initiated_checkout",
value: "14"
},
{
action_type: "omni_purchase",
value: "1"
},
{
action_type: "add_to_cart",
value: "96"
},
{
action_type: "initiate_checkout",
value: "14"
},
{
action_type: "purchase",
value: "1"
}
],
Is there a way I can only get purchase number and purchase conversion value instead of this long array or a syntax where I can get specific values only. I checked the facebook api parameters website but there is no documentation of the things i need. I even checked other post on stack overflow but I didn’t find anything about this.
2
Answers
I scanned the docs and I think that’s the only way to get the conversion value.
You can filter the fields that you want from the entire actions(will give the count for example conversions, add_to_cart) & action_values(will give the value/amount generated from the conversions, add_to_cart for example conversion_value/conversion_amount, add_to_cart_value)by using action_breakdowns & filtering as below:
to get Conversions(omni_purchase), add_to_cart(omni_add_to_cart)
fields = ad_name, actions
action_breakdowns = ‘action_type’
filtering = ‘[{"field": "action_type", "operator": "IN", "value": ["omni_purchase", "omni_add_to_cart", "add whatever fields you need"]}]’
======================================================================
to get Conversion_value(omni_purchase)
fields = ad_name, action_values
action_breakdowns = ‘action_type’
filtering = ‘[{"field": "action_type", "operator": "IN", "value": ["omni_purchase"], "add whatever fields you need"}]’