1、create page
2、List your pages
FB.api('/me/accounts');
所有主管表单属于Facebook页面。复制并储存网页编号,以建立潜在客户表单和广告。要确保使用日志功能复制完整ID以在终端中打印ID。
3、creating a lead form 创建销售线索表单 参考文档
var form_name = 'My form';
var policy_url = 'https://developers.facebook.com/policy/';
var policy_link_text = 'https://developers.facebook.com/policy/';
//当用户点击您广告中的“查看网站”按钮时要转到的网址
var follow_up_action_url = 'https://www.facebook.com/Ktv%E6%9C%80%E5%8F%97%E6%AC%A2%E8%BF%8E%E4%B8%AD%E6%96%87%E6%AD%8C%E6%9B%B2-239193819844030/?skip_nax_wizard=true';
var endpoint = '/239193819844030/leadgen_forms';
var params = {
name: form_name,
privacy_policy: {
url: policy_url,
link_text: policy_link_text,
},
follow_up_action_url: follow_up_action_url,
questions: [
{
type: 'FULL_NAME',
},
{
key: 'programing_lenguage',
label: 'Favorite programing lenguage',
type: 'CUSTOM',
},
],
};
FB.api(endpoint, 'POST', params);
4、List the page's form 列出页面包含的所有表单
FB.api('/239193819844030/leadgen_forms');
5、managing and testing the form
#Create a sample lead
FB.api('/1768660863385323/test_leads', 'POST', {name: 'test_form'});
#List sample leads
FB.api('/1768660863385323/test_leads');
#List your leads
FB.api('/1768660863385323/leads');
6、https://developers.facebook.com/graph-academy/lead-ads/5/(最后一步)