Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Region value is not being returned through SDK

Open
#331 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
java
Domain
api

Research direction

No source file or test is named. Start by comparing the SDK request and response handling with the provided curl request for the Campaign Insights region breakdown; done means the SDK can request region and returns region values without the invalid-fields error, with coverage for the reported parameters.

Written by the indexing model from the issue text.

Description

Stale
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"
	}....
]
Dominant language
Java
Stars
472
Forks
343
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from facebook/facebook-java-business-sdk

All issues in facebook/facebook-java-business-sdk

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.