Data parser for FB API to work with Keitaro/Binom/Voluum/etc.
Clone APIFB to to trackers installation folder:
/var/www/keitaro/var/www/binomAs a result, APIFB should be available at http://YOUR_TRACKER_IP/apifb/stats.php
Apply 0777 permissions to the apifb folder and its files.
Empty all the logs using the Dashboard: http://YOUR_TRACKER_IP/apifb/stats.php
Click Clear on each log. Last Cleared date should appear. If not - check file permissions.
Add traffic source to the tracker:
Keitaro:
Select Facebook.com as a template. Rename to APIFB and enable postbacks for lead and sale events.
Link: http://127.0.0.1/apifb/{status}.php?sub_id_10={sub_id_10}&sub_id_11={sub_id_11}&sub_id_12={sub_id_12}&sub_id_13={sub_id_13}&date={date:U}&external_id={subid}&client_ip_address={ip}&client_user_agent={user_agent}&ct={city}&st={region}&country={country_name}&name={sub_id_14}&phone={sub_id_15}&revenue={conversion_revenue}
Parameters Setup:
| Name | Parameter | Placeholder |
| ---- | --------- | ----------- |
| External ID | (none) | (none) |
| ---- | --------- | ----------- |
| (none) | sub_id_6 | (none) |
| ---- | --------- | ----------- |
| FBP | sub_id_8 (fbp) | (none) |
| Lead's Email | sub_id_9 (email) | (none) |
| FB Click ID | sub_id_10 (fbclid) | (none) |
| Pixel ID | sub_id_11 (pixel) | Your Pixel ID |
| Access Token | sub_id_12 (token) | Access Token for your Pixel |
| Event URL | sub_id_13 (domain) | Link to your white page or {domain} |
| Lead's Name | sub_id_14 (name) | (none) |
| Lead's Phone | sub_id_15 (phone) | (none) |
Binom:
Select Facebook as a template. Rename to APIFB and select Send all in Advanced settings > S2S postback mode.
Link: http://127.0.0.1/apifb/binom.php?sub_id_10={externalid}&sub_id_11={t7}&sub_id_12={t8}&sub_id_13={domain}&external_id={clickid}&client_ip_address={ip}&client_user_agent={user_agent}&ct={city}&st={region}&country={country_code}&name={t9}&phone={t10}&revenue={payout}
Parameters Setup:
| Description | Parameter | Placeholder | Name |
| ---- | --------- | ----------- | ------ |
| External ID | fbclid | (none) | |
| ---- | --------- | ----------- | ------ |
| Token 7 | pixel | Your Pixel ID | Pixel ID |
| Token 8 | token | Access Token for your Pixel | Access Token |
| Token 9 | name | (none) | Lead's Name |
| Token 10 | phone | (none) | Lead's Phone |
Voluum:
Select Facebook as a template. Rename to APIFB and enable Traffic source postback URL per event type under Passing conversion info to traffic source menu.
Link for Lead/reg events: http://IP_WHERE_APIFB_IS_INSTALLED/apifb/lead.php?sub_id_10={externalid}&sub_id_11={var9}&sub_id_12={var10}&sub_id_13={trackingdomain}&external_id={click.id}&client_ip_address={ip}&client_user_agent={useragent}&ct={city}&st={region}&country={country}
Link for Sale/dep events: http://IP_WHERE_APIFB_IS_INSTALLED/apifb/sale.php?sub_id_10={externalid}&sub_id_11={var9}&sub_id_12={var10}&sub_id_13={trackingdomain}&external_id={click.id}&client_ip_address={ip}&client_user_agent={useragent}&ct={city}&st={region}&country={country}&revenue={payout}
Per latest customers' compains, it is recommended to put Pixel ID and Access Token DIRECTLY into the link.
Parameters Setup:
| Name | TS Parameter | TS Token | VLM token |
| ---- | --------- | ----------- | ------ |
| External ID 1 | fbclid | (none) | {externalid} |
| ---- | --------- | ----------- | ------ |
| Pixel ID | pixel | Your Pixel ID | {var9} |
| Access Token | token | Access Token for your Pixel | {var10} |
The installation is complete. You may test it now.
Put this code inside the API file for your aff. network:
$kt = "XXXXX" // Your Postback Token (Maintenance > Postback URL);
$tmp = [
'subid' => $_POST['subid'],
'sub_id_8' => $_POST['fbp'],
'sub_id_14' => $_POST['name'],
'sub_id_15' => $_POST['phone'],
'status' => 'lead',
];
file_get_contents("http://127.0.0.1/" . $kt . "/postback?" . http_build_query($tmp));
Make sure to check that the parameters names are correct and correspond to the landing ones. Afterwards, add the code right before the redirect to the Thank you page.