maraujo / pySocialWatcher

Social Watcher on Facebook Marketing API
MIT License
108 stars 49 forks source link

"Update the value of the location_types field" #38

Open cknotz opened 2 months ago

cknotz commented 2 months ago

Hi,

first, thanks for creating this package!

I was just trying to get the MWE from the World Bank to run (https://worldbank.github.io/connectivity_mapping/intro.html), and immediately ran into this error message:

'{"error":{"message":"Invalid parameter","type":"OAuthException","code":100,"error_data":{"blame_field_specs":[["targeting"]]},"error_subcode":1870199,"is_transient":false,"error_user_title":"Update the value of the location_types field","error_user_msg":"All location targeting will now reach people living in or recently in the locations that you selected. Please remove all values from the location_types field.","fbtrace_id":"XXXXXXXX"}}'

It seems Facebook has changed how people's locations are targeted: https://www.facebook.com/business/help/365561350785642?id=176276233019487

I'd fix it myself, but am pretty much a newbie when it comes to Python. Do you maybe have a fix for this?

Thanks again in any case, Carlo

maraujo commented 2 months ago

Hi, I don't want to let you without any reply; I am honestly glad to know about your interest in using this tool. Unfortunately, Facebook has changed several parts of the API since I stopped supporting this library. My suggestion, if you're not a Python expert, to find out how to change this library to fix this issue is to check people who have recently updated forks of this repository or recently published papers using this repository, so they might have already fixed it.

cknotz commented 2 months ago

Hi! Many thanks and I understand. It seems Facebook have their own library now, so I will try to make that work.

sibeleker commented 1 month ago

Hi! Many thanks and I understand. It seems Facebook have their own library now, so I will try to make that work.

Hi @cknotz. Which Facebook library are you using instead of pysocialwatcher? I'd appreciate it, because I used pysocialwatcher quite a while but can't make it work anymore. Many thanks to @maraujo for all the work he did :)

cknotz commented 1 month ago

This one: https://github.com/facebook/facebook-python-business-sdk (i.e., facebook_business). I managed to get audience sizes for some attributes, but haven't been able yet to target that specifically to what I need. Proper targeting is currently still a bit above my pay grade (+ lack of time...). Their documentation is moderately helpful: https://developers.facebook.com/docs/marketing-api/audiences/reference/basic-targeting/