Facebook Attribution API by custom source

Viewed 127

I am using Facebook Attribution API to collect attribution data using the Facebook graph API. I am able to make GET requests and get responses from the API but I have some trouble to build my request parameters.

If you are familiar with Facebook, there is a page available at https://business.facebook.com/attribution where you get informations about all of your different sources channels. In my case I have around 10 different sources channels listed bellow: enter image description here

What I am trying to achieve is to get the net_media_cost for each of those channels. However, the official documentation of the Attribution API does not say anything about this. Maybe it's not possible, but I guess the Attribution API should be able to do it.

If you check the bottom of the documentation, there is a source channel but it's a generic channel type and not accurate enough for what I am looking for (google generic vs google paid for example) enter image description here

This is the request I am doing when using the source_channel from the documentation. The same from the Conversion Metrics by Attribution Model on the Attribution API documentation:

https://graph.facebook.com/v9.0/?
    ids=<BUSINESS_UNIT_ID>
    &fields=conversion_events
        .filter_by({"ids":["<CONVERSION_EVENT_ID>"]})
        .metric_scope({
            "filters":{
                "click_lookback_window":"2419200",
                "view_lookback_window":"86400",
                "visit_configuration":"include_paid_organic"
            },
            "time_period":"last_thirty_days"
        })
    {id,name,cost_per_1k_impressions,cost_per_click,cost_per_visit,net_media_cost,report_click_through_rate,report_clicks,report_impressions,report_visits,last_touch_convs,last_touch_convs_per_1k_impress,last_touch_convs_per_click,last_touch_convs_per_visit,last_touch_cpa,last_touch_revenue,last_touch_roas,total_conversions,
     metrics_breakdown
        .dimensions(["source_channel"])
        {source_channel,cost_per_1k_impressions,cost_per_click,cost_per_visit,net_media_cost,report_click_through_rate,report_clicks,report_impressions,report_visits,last_touch_convs,last_touch_convs_per_1k_impress,last_touch_convs_per_click,last_touch_convs_per_visit,last_touch_cpa,last_touch_revenue,last_touch_roas}
}
&access_token=<TOKEN>

This is the result:

{
  "<business_unit_id>: {
    "conversion_events": {
      "data": [
        {
          "id": "<custom_conversion_id>",
          "name": "Total Device",
          "cost_per_1k_impressions": 298883073.80651,
          "cost_per_click": 7611028.5055993,
          "cost_per_visit": 2292374.9356985,
          "net_media_cost": 10227213000000,
          "report_click_through_rate": 0.039269735172667,
          "report_clicks": 1343736,
          "report_impressions": 34218107,
          "report_visits": 4461405,
          "last_touch_convs": 16041,
          "last_touch_convs_per_1k_impress": 0.46878689110417,
          "last_touch_convs_per_click": 0.011937612745361,
          "last_touch_convs_per_visit": 0.0035955041068901,
          "last_touch_cpa": 637567046.94221,
          "last_touch_revenue": 5752967.9242927,
          "last_touch_roas": 5.6251570435588e-7,
          "total_conversions": 23156,
          "metrics_breakdown": {
            "data": [
              {
                "source_channel": 3,
                "cost_per_click": 0,
                "cost_per_visit": 0,
                "net_media_cost": 0,
                "report_clicks": 1154015,
                "report_impressions": 0,
                "report_visits": 1071516,
                "last_touch_convs": 10801,
                "last_touch_convs_per_click": 0.0093594970602635,
                "last_touch_convs_per_visit": 0.010080110796292,
                "last_touch_cpa": 0,
                "last_touch_revenue": 3243197.5881846
              },
              {
                "source_channel": 1,
                "cost_per_visit": 0,
                "net_media_cost": 0,
                "report_clicks": 0,
                "report_impressions": 0,
                "report_visits": 920001,
                "last_touch_convs": 4434,
                "last_touch_convs_per_visit": 0.0048195599787392,
                "last_touch_cpa": 0,
                "last_touch_revenue": 2165112.2343256
              },
              {
                "source_channel": 2,
                "cost_per_1k_impressions": 298883073.80651,
                "cost_per_click": 53906594.420228,
                "cost_per_visit": 95867239.714663,
                "net_media_cost": 10227213000000,
                "report_click_through_rate": 0.0055444621761221,
                "report_clicks": 189721,
                "report_impressions": 34218107,
                "report_visits": 106681,
                "last_touch_convs": 806,
                "last_touch_convs_per_1k_impress": 0.023554780514305,
                "last_touch_convs_per_click": 0.0042483436203689,
                "last_touch_convs_per_visit": 0.0075552347653284,
                "last_touch_cpa": 12688849875.931,
                "last_touch_revenue": 344658.10178253,
                "last_touch_roas": 3.3700100093988e-8
              },
              {
                "source_channel": 0,
                "cost_per_visit": 0,
                "net_media_cost": 0,
                "report_clicks": 0,
                "report_impressions": 0,
                "report_visits": 2363207,
                "last_touch_convs": 0,
                "last_touch_convs_per_visit": 0,
                "last_touch_revenue": 0
              }
            ]
          }
        }
      ]
    },
    "id": "318429215527453"
  }
}

The result of that request has everything I am looking for expect that the source_channel is the one from the official documentation and I would need to have it spliced based on my own attribution channels.

0 Answers
Related