Access Additional Standard Event Parameters using FB Graph API Explorer

393 views Asked by At

I've installed Facebook Pixel on my website, and it records purchases made on my site. The script on my site is the normal purchase standard event:

fbq('track', 'Purchase', {value: '0.00', currency: 'USD'});

Except that the 'value' is dynamic and changes for each order. I want to access these additional parameters using the FB Insights API (accessed through the Graph API Explorer).

Right now, my query looks like this:

act_1020149xxxxxxxxxxx/insights?level=ad&action_report_time=conversion&default_summary=true&fields=actions,spend,account_id,campaign_name,ad_name,adset_name,impressions&time_range[since]=2015-11-01&time_range[until]=2015-12-01

This returns data that looks like this:

{
  "data": [
    {
      "actions": [
        {
          "action_type": "link_click",
          "value": 19
        },
        {
          "action_type": "offsite_conversion.fb_pixel_purchase",
          "value": 1
        },
        {
          "action_type": "offsite_conversion.fb_pixel_view_content",
          "value": 19
        },
        {
          "action_type": "post_like",
          "value": 88
        },
        {
          "action_type": "page_engagement",
          "value": 107
        },
        {
          "action_type": "post_engagement",
          "value": 107
        },
        {
          "action_type": "offsite_conversion",
          "value": 20
        }
      ],
      "spend": 5.16,
      "account_id": "10201496xxxxxxxxxx",
      "campaign_name": "Link Clicks to Website (CPC)",
      "ad_name": "[2015/11/27] New Arrivals",
      "adset_name": "Custom Audience - Visitors or Lookalike - Visitors",
      "impressions": "2634",
      "date_start": "2015-11-01",
      "date_stop": "2015-12-01"
    }, ...

As you can see, the query returns purchases made on the site (offsite_conversion.fb_pixel_purchase) that came from the ad. How can I extend this query to also include the 'value' and 'currency' of each purchase, as captured in the standard event code embedded on my website.

If this isn't possible, then what part of the API should I use to find that data on purchases that I'm looking for?

1

There are 1 answers

0
Viktor Kärnstrand On

You need to add the 'action_values' field to get the purchase value. The currency is the one you have registered with you account. If you report different currencies for different purchases (pixel fires) I would suppose that facebook convert the values to your currency.