Binom Documentation

Go to navigation

Facebook

Facebook is a major traffic source, but it’s not always convenient to work with. Facebook doesn’t support automatic costs distribution. We came up with an API integration that allows Binom syncing costs automatically.

How it works


access_token will connect a Facebook account to a campaign in Binom. Every 30 minutes Binom goes through the connected accounts and gets costs in terms of the {{ad.id}} token and updates the costs. To make the integration work you need to do the following:

— Connect a Facebook account to a campaign in Binom
— Pass the {{ad.id}} token from Facebook to Binom

If you can not pass the {{ad.id}} token, sync the costs of the whole account, like this:

In this case Binom will get the costs per day of the whole account and distribute it among all the clicks per that day.

To minimize the number of side queries in Facebook, Binom only goes through the accounts with clicks. For example, if a campaign got 0 clicks from 15:00 to 24:00, Binom will not ask the accounts connected to that campaign.

Sometimes it may take a while to have the Facebook costs updated, so Binom updates the statistics of active campaigns for the previous day three times a day.

Getting Access token


1) Open Meta for Developers: https://developers.facebook.com/ and log in to the account, where you plan to run your ads

2) Press Create App

3) Choose Other or None type of the app

4) You can now copy the ID of your app

5) Add Marketing API for your app

6) Get to the Marketing API => Tools section

7) Check "read_insights" andd "ads_read", press "Get Token" and copy the token that was generated

8) Get to the Access Token Debugger: https://developers.facebook.com/tools/debug/accesstoken/ and check the token to make sure that it is valid for at least for two months

In case if the period of validity is less than two months, there should be a link next to the date that will allow you to generate a new token with the maximal period of validity.

9) You can additionally secure your account from being banned by using the same proxy you used during the app creation process when you are going to create the integration in the tracker. We recommend that you use the same User Agent and coockie of the browser that was used for creating a Developer account. You can get the User Agent and the coockie inside of any header of the request to FB through the developer tools that you can get access to by pressing F12 and clicking on the Network tab

Adding Proxy


By default Binom will send queries to Facebook from a server it’s installed on. Facebook sees those queries as logging in. Sometimes Facebook considers it suspicious if logging in is performed from different devices and can change access_token. To make things worse, the device you’re using may affect the quality of the account. To avoid it, use proxy.

Go to Traffic Sources > Accounts > Proxies.

Specify your proxy settings. Keep in mind that most of the mobile proxies have two additional timeouts. The first one is the time a proxy provider needs to change the IP. The second one is the time that proxy provider prevents the IP from changing (i.e. how often you can get Change URL). This leads to the limit of the accounts which can be connected to a certain proxy. If you reach that limit, Binom might not have enough time to go through all the accounts.

Using proxy is not obligatory.

Adding Facebook account


If Facebook has more than one account connected to access_token, specify the one you need in the Facebook ID field:

Keep in mind that as soon as you add access_token a query is passed to Facebook, so make sure to set up Proxy first and only then add access_token. Ignore a warning in the Access token field if you don’t use proxy.

Comments

Other than updating Facebook costs, once every 30 minutes Binom will also check if your Facebook ads belonging to that account received any comments.



Depending on the action chosen, Binom can do one of the following:

  • — Leave comments be (default option);
  • — Hide comments;
  • — Delete comments.

Please note that there are limits on certain actions in Facebook. These limits may depend on your account quality and other inside FB criteria. Binom will create a queue of requests with your chosen action and execute these for as long as Facebook accepts these requests (i.e. requests are within the FB limit).

Setting up a campaign


After adding a Facebook account to Binom you need to connect it to a campaign. Go to the campaign settings, open Integrations and add your account:

You must also specify Traffic Source with the ad.id token for Token 1:

It needs to be done so that Binom could update the costs referring to the ad.id token. Click Load from template and select Facebook to load the settings.

Those were the final steps. In the end you can make sure that Facebook has the {{ad.id}} token specified: