I need to create a custom audience with multi keys of users such as:
+-----------+------+-----+----------------------+------------+
| EXTERN_ID | FN | LN | EMAIL | PHONE |
+-----------+------+-----+----------------------+------------+
| 12345 | John | Doe | john.doe@example.com | 1234567890 |
+-----------+------+-----+----------------------+------------+
I can create a custom audience with the below given code:
from facebook_business.adobjects.adaccount import AdAccount
from facebook_business.adobjects.customaudience import CustomAudience
from facebook_business.api import FacebookAdsApi
access_token = '<ACCESS TOKEN>'
app_secret = '<APP SECRET>'
app_id = '<APP ID>'
id = '<ACCNT_ID>'
FacebookAdsApi.init(access_token=access_token)
fields = [
]
params = {
'name': 'TEST',
'subtype': 'CUSTOM',
'description': 'Internal Data',
'customer_file_source': 'USER_PROVIDED_ONLY',
}
print(AdAccount(id).create_custom_audience(
fields=fields,
params=params,
))
But, how to add multi-key user values to the created audience? I'm pretty new to Python and Facebook SDK. Any help will be really appreciated.