Web サイトに Facebook Pixel をインストールしましたが、サイトでの購入が記録されます。私のサイトのスクリプトは、通常の購入標準イベントです。
fbq('track', 'Purchase', {value: '0.00', currency: 'USD'});
ただし、「値」は動的であり、注文ごとに変化します。FB Insights API (Graph API Explorer からアクセス) を使用して、これらの追加パラメーターにアクセスしたいと考えています。
現在、私のクエリは次のようになっています。
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
これにより、次のようなデータが返されます。
{
"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"
}, ...
ご覧のとおり、このクエリは、広告からサイト (offsite_conversion.fb_pixel_purchase) で行われた購入を返します。このクエリを拡張して、各購入の「値」と「通貨」も含めるにはどうすればよいですか。これは、私の Web サイトに埋め込まれた標準イベント コードで取得されます。
これが不可能な場合、探している購入に関するデータを見つけるには、API のどの部分を使用すればよいですか?