Binom Documentation

К навигации

Facebook

Facebook is the major traffic source, but it’s not always convenient to work with it. 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


To get access_token, please go to Facebook, open the developer mode of your browser (F12), go to the Console tab and execute:

            
              window.__accessToken
            
          
The response will be your access token.

Another way of getting it is go to the Networks tab and follow the link: https://www.facebook.com/adsmanager

Then enter access_token in the search field and copy the value you’ll get.

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.

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: