facebook-java-business-sdk icon indicating copy to clipboard operation
facebook-java-business-sdk copied to clipboard

Region value is not being returned through SDK

Open luisstb opened this issue 4 years ago • 2 comments

Which SDK version are you using?

v8.0

What's the issue?

Apparently, the API seems to be inconsistent between requests to different breakdowns. Specifically working with region.

Campaign Insights supports region, but that value is not being returned in the results. This only happens using the SDK. Through api, it works.

Steps/Sample code to reproduce the issue

Requests params:

"level" -> "campaign"
"time_range" -> "{'since':'2020-12-04','until':'2020-12-10'}"
"breakdowns" -> "region"
"action_breakdowns" -> "action_type"
"fields" -> "account_name,campaign_id,campaign_name,impressions,clicks,actions,action_values,spend,date_start,buying_type,objective,reach,account_id,region"
"filtering" -> "[{'field':'ad.impressions','operator':'GREATER_THAN','value':-1}]"
"time_increment" -> "1"

Response message: (#100) region is not valid for fields param. please check https://developers.facebook.com/docs/marketing-api/reference/ads-insights/ for all valid values

If the region field is removed from "fields", the result is correct but the region value is not present

Observed Results:

  • What happened? This could be a description, log output, etc.

Region value is not being returned through SDK.

Expected Results:

  • What did you expect to happen?

Using API: Request:

curl -G \
-d "breakdowns=age,gender,region" \
-d "fields=impressions,region" \
-d "appsecret_proof=APP_SECRET" \
-d "access_token=TOKEN" \
"https://graph.facebook.com/v9.0/{CAMPAIGN}/insights"

Response:

{
	"data": [{
		"impressions": "1326",
		"region": "Alabama"
	}, {
		"impressions": "194",
		"region": "Alaska"
	}, {
		"impressions": "1113",
		"region": "Arizona"
	}, {
		"impressions": "758",
		"region": "Arkansas"
	}, {
		"impressions": "3074",
		"region": "California"
	}....
]

luisstb avatar Jan 22 '21 17:01 luisstb

Hi @luisstb , Any updates on this? I am having issues with age and gender breakdowns

RushiJeavio avatar Jun 17 '21 15:06 RushiJeavio

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jan 09 '22 02:01 stale[bot]