我正在寻找一些好的资源来自动化 Facebook 广告的完整分析流程,例如创建受众列表、创建活动和创建自定义事件集,因为我们的业务有完整的离线销售周期。我尝试了 curl 方法来获取 Facebook 报告仪表板中的数据,但我正在寻找可以每天自动化代码的好资源。
curl \
-F 'access_token=SYSTEM_USER_ACCESS_TOKEN' \
-F 'upload_tag=store_data' \
-F 'data=[ \
{
match_keys: {"phone": ["HASH1","HASH2"], "email": ["HASH3","HASH4"]},
currency: "USD",
value: 16,
event_name: "Purchase",
event_time: 1456870902,
contents: [
{id: "A", quantity: 1},
{id: "B", quantity: 2},
{id: "C", quantity: 1}
]
custom_data: {
event_source: "in_store"
},
},
{
match_keys: {"lead_id": "12345"},
event_name: "Lead",
event_time: 1446336000,
contents: [
{id: "A", quantity: 1},
{id: "B", quantity: 2},
{id: "C", quantity: 1}
]
custom_data: {
event_source: "email",
action_type: "sent_open_click",
email_type: "email_type_code",
email_provider: "gmail_yahoo_hotmail",
}
},
]'
https://graph.facebook.com/VERSION/OFFLINE_EVENT_SET_ID/events
我从这个链接https://developers.facebook.com/docs/marketing-api/offline-conversions/
需要使用 Python 的 facbook_business 或 facebook-sdk 执行此操作。