facebook / facebook-php-business-sdk

PHP SDK for Meta Marketing API
https://developers.facebook.com/docs/business-sdk
Other
833 stars 516 forks source link

When fetching Insights in Ad Account data like ad_name, ad_id, adset_id, adset_name are Empty #444

Closed twocngdagz closed 6 years ago

twocngdagz commented 6 years ago
$account = new AdAccount('act_' . $this->account_id);
        $fields = array(
            'spend',
            'clicks',
            'impressions',
            'campaign_name',
            'campaign_id',
            'inline_link_clicks',
            'actions',
            'ad_name',
            'ad_id',
            'adset_id',
            'adset_name',
            'account_id',
            'account_name',
        );

        $param = $this->filters;
        $param['level'] = 'campaign';

        $cursor = $account->getInsights($fields, $param);

Sample Output:

Array
(
    [account_currency] =>
    [account_id] => **[I remove this]**
    [account_name] => **[I remove this]**
    [action_values] =>
    [actions] => Array
        (
            [0] => Array
                (
                    [action_type] => offsite_conversion.fb_pixel_lead
                    [value] => 57
                )

            [1] => Array
                (
                    [action_type] => landing_page_view
                    [value] => 1114
                )

            [2] => Array
                (
                    [action_type] => link_click
                    [value] => 1742
                )

            [3] => Array
                (
                    [action_type] => offsite_conversion
                    [value] => 57
                )

            [4] => Array
                (
                    [action_type] => page_engagement
                    [value] => 1748
                )

            [5] => Array
                (
                    [action_type] => post_engagement
                    [value] => 1748
                )

            [6] => Array
                (
                    [action_type] => post_reaction
                    [value] => 6
                )

        )

    [ad_id] =>
    [ad_name] =>
    [adset_id] =>
    [adset_name] =>
    [buying_type] =>
    [call_to_action_clicks] =>
    [campaign_id] =>**[I remove this]**
    [campaign_name] => COV-02: 1% LAL COV Appliers _TST_AUD (Mobile)
    [canvas_avg_view_percent] =>
    [canvas_avg_view_time] =>
    [canvas_component_avg_pct_view] =>
    [clicks] => 1690
    [cost_per_10_sec_video_view] =>
    [cost_per_action_type] =>
    [cost_per_estimated_ad_recallers] =>
    [cost_per_inline_link_click] =>
    [cost_per_inline_post_engagement] =>
    [cost_per_outbound_click] =>
    [cost_per_total_action] =>
    [cost_per_unique_action_type] =>
    [cost_per_unique_click] =>
    [cost_per_unique_inline_link_click] =>
    [cost_per_unique_outbound_click] =>
    [cpc] =>
    [cpm] =>
    [cpp] =>
    [ctr] =>
    [date_start] => 2018-05-01
    [date_stop] => 2018-05-01
    [estimated_ad_recall_rate] =>
    [estimated_ad_recallers] =>
    [frequency] =>
    [impressions] => 38797
    [inline_link_click_ctr] =>
    [inline_link_clicks] => 1742
    [inline_post_engagement] =>
    [mobile_app_purchase_roas] =>
    [objective] =>
    [outbound_clicks] =>
    [outbound_clicks_ctr] =>
    [place_page_name] =>
    [reach] =>
    [relevance_score] =>
    [social_clicks] =>
    [social_impressions] =>
    [social_reach] =>
    [social_spend] =>
    [spend] => 579.54
    [total_action_value] =>
    [total_actions] =>
    [total_unique_actions] =>
    [unique_actions] =>
    [unique_clicks] =>
    [unique_ctr] =>
    [unique_inline_link_click_ctr] =>
    [unique_inline_link_clicks] =>
    [unique_link_clicks_ctr] =>
    [unique_outbound_clicks] =>
    [unique_outbound_clicks_ctr] =>
    [unique_social_clicks] =>
    [video_10_sec_watched_actions] =>
    [video_30_sec_watched_actions] =>
    [video_avg_percent_watched_actions] =>
    [video_avg_time_watched_actions] =>
    [video_p100_watched_actions] =>
    [video_p25_watched_actions] =>
    [video_p50_watched_actions] =>
    [video_p75_watched_actions] =>
    [video_p95_watched_actions] =>
    [website_ctr] =>
    [website_purchase_roas] =>
)
ellentao commented 6 years ago

Hey, thanks for your comment! This is actually an api issue. Please report the issue on Devsite Bug Report channel: https://developers.facebook.com/support/bugs/ Thanks!

edbizarro commented 6 years ago

Same problem here