TargetAutomation.IndividualSetting is not parsed correctly
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
Research direction
Start by tracing how SavedAudience.getFieldTargeting() parses Targeting.getFieldTargetingAutomation().getFieldIndividualSetting(), focusing on the Object value returned for geo. Reproduce the example against v22.0 or higher and verify that the resulting AdSet targeting sends {"geo":1} rather than {"geo":1.0} and is accepted.
Written by the indexing model from the issue text.
Description
When retrieving a SavedAudience in v22.0 or higher, the IndividualSetting field is an Object type and is not parsed correctly. Specifically, the geo field's value is parsed as 1.0 instead of 1. When this SavedAudience object is then used to create an AdSet, the request is rejected because the value is invalid.
This example:
final SavedAudience savedAudience = new SavedAudience(120218882502790414L, context).get().requestTargetingField().execute();
final Targeting fieldTargeting = savedAudience.getFieldTargeting();
final Object fieldIndividualSetting = fieldTargeting.getFieldTargetingAutomation().getFieldIndividualSetting();
System.out.println(fieldIndividualSetting);
outputs
{geo=1.0}
And when using that targeting field on an AdSet request:
AdAccount.APIRequestCreateAdSet adSetToCreate = adAccount.createAdSet()
.setName("adset")
...
.setTargeting(fieldTargeting).execute()
The debug output shows that {geo=1.0} is being sent in the targeting parameter (this is from a request using a different saved audience but ends in the same result)
18:04:02.921 [main] INFO c.s.p.m.api.MetaPostBoosterApi -- ========Start of API Call========
18:04:02.922 [main] INFO c.s.p.m.api.MetaPostBoosterApi -- Post: https://graph.facebook.com/v23.0/act_213324006957203/adsets
...
18:04:02.922 [main] INFO c.s.p.m.api.MetaPostBoosterApi -- Content-Disposition: form-data; name="targeting"
18:04:02.922 [main] INFO c.s.p.m.api.MetaPostBoosterApi -- {"age_max":65,"age_min":18,"age_range":[18,65],"genders":[0],"geo_locations":{"cities":[{"country":"US","distance_unit":"mile","key":"2525495","name":"Austin","radius":25,"region":"Texas","region_id":"3886"},{"country":"US","distance_unit":"mile","key":"2526105","name":"Cedar Park","radius":25,"region":"Texas","region_id":"3886"},{"country":"US","distance_unit":"mile","key":"2527173","name":"Georgetown","radius":25,"region":"Texas","region_id":"3886"},{"country":"US","distance_unit":"mile","key":"2528026","name":"Lakeway","radius":25,"region":"Texas","region_id":"3886"},{"country":"US","distance_unit":"mile","key":"2528104","name":"Leander","radius":25,"region":"Texas","region_id":"3886"},{"country":"US","distance_unit":"mile","key":"2529681","name":"Round Rock","radius":25,"region":"Texas","region_id":"3886"},{"country":"US","distance_unit":"mile","key":"2530714","name":"West Lake Hills","radius":25,"region":"Texas","region_id":"3886"}],"location_types":["home","recent"]},"publisher_platforms":["facebook"],"targeting_automation":{"advantage_audience":1,"individual_setting":{"geo":1.0}}}
Manually changing the value to {"geo":1} gives a successful result.
- Dominant language
- Java
- Stars
- 473
- Forks
- 344
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from facebook/facebook-java-business-sdk
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
facebook/facebook-java-business-sdk#499 · 1 comment ·
-
No methods for get or set FieldThreadsUserId in Ad or AdSetPossibly taken @arnabnandy7 claimed this 122 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
facebook/facebook-java-business-sdk#493 · 5 comments · 2 reactions ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
All issues in facebook/facebook-java-business-sdk
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
EpssMirrorTask leaks temp file on failed download and has no request timeoutPossibly taken @someshhh-45 claimed this today. Opendefect in triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
DependencyTrack/dependency-track#7845 ·
Maintainers usually reply within 1 day
-
[Bug]: WriteFileTool shows "Error reading file" snippet for relative paths when baseDir is setPossibly taken @ShryukGrandhi claimed this today. Open
Difficulty 2/5 Under an hour Newbie friendliness 86/100
agentscope-ai/agentscope-java#3917 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
apache/maven-checkstyle-plugin#735 ·
Maintainers usually reply within 1 day