Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Several fields not available in java object AdsInsights #384

Open
garuna-m6 opened this issue May 23, 2022 · 0 comments
Open

Several fields not available in java object AdsInsights #384

garuna-m6 opened this issue May 23, 2022 · 0 comments

Comments

@garuna-m6
Copy link

Which SDK version are you using?

com.facebook.business.sdk:facebook-java-business-sdk:13.0.0

What's the issue?

hourly_stats_aggregated_by_advertiser_time_zone is not a field that can be requested or parsed from response.

Steps/Sample code to reproduce the issue

String[] FIELDS = new String[]{ "account_id" , "account_name" , "campaign_id" , "campaign_name" , "adset_id" , "adset_name" , "date_start" , "date_stop" , "actions" , "canvas_avg_view_percent" , "canvas_avg_view_time" , "cost_per_inline_link_click" , "cost_per_inline_post_engagement" , "cpm" , "cpp" , "ctr" , "estimated_ad_recall_rate" , "estimated_ad_recallers" , "frequency" , "impressions" , "inline_link_clicks" , "inline_post_engagement" , "objective" , "reach" , "spend" , "unique_link_clicks_ctr" , "video_30_sec_watched_actions" , "video_p100_watched_actions" , "video_p25_watched_actions" , "video_p50_watched_actions" , "website_ctr" };

AdReportRun asyncRequest = new AdAccount(accountId, context).getInsightsAsync() .setLevel(AdsInsights.EnumLevel.VALUE_ADSET) .setTimeRange("{'since':'" + date + "','until':'" + date + "'}") .setBreakdowns(Arrays.asList(AdsInsights.EnumBreakdowns.VALUE_HOURLY_STATS_AGGREGATED_BY_ADVERTISER_TIME_ZONE)) .setActionReportTime(AdsInsights.EnumActionReportTime.VALUE_IMPRESSION) .requestFields(Arrays.asList(FIELDS)) .execute();

List<AdsInsights> apiResponse = asyncRequest.fetch().getInsights() .requestFields(Arrays.asList(FIELDS)) .requestField("hourly_stats_aggregated_by_advertiser_time_zone") .execute() .withAutoPaginationIterator(true).stream().collect(Collectors.toList());

Observed Results:

  • The response if mapped to AdsInsights , hence several fields are removed
    {"account_id":"...","account_name":".....,"adset_id":"....","adset_name":"....","campaign_id":"...","campaign_name":"...","cpm":"8...","ctr":"...","date_start":"....date_stop":"....","impressions":"...","inline_link_clicks":"..","inline_post_engagement":"..","objective":"..","spend":".."}

Expected Results:

  • AdsInsights should have all the fields in the pojo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant