Meta (Facebook) Ads API integration in CPV Lab | CPV One
- CPV Lab has direct Meta Ads API integration to allow getting accurate information about campaign costs.
- Together with the data tracked by CPV tracker, you can see all your performance metrics in one dashboard.
To complete the integration, you’ll need:
- A Facebook (Meta) Ads valid account
- A valid CPV Lab (opens new window) or CPV One (opens new window) license
Steps required in order to setup the Meta (Facebook) Ads Integration with CPV tracker:
1. Go to API integrations page
- Go to Sources ➡️ API Integrations from your CPV tracker
2. Click New integration
- Click to add the new integration on the Meta (Facebook) Ads image:
3. Meta (Facebook) Login
- You will be redirected to the Facebook website and ask to login in order to allow the integration.
- Enter your Meta Ads login details in the box.
- Continue with your user after login
4. Manage the integration
Once you save your Meta Ads API integration in CPV Lab | CPV One, you'll be redirected to the Integration Settings page, where you can configure key details for how the integration behaves.
Integration Name- A custom name to help you easily identify this specific integration with Google Ads Ads.
Cost Synchronization Method - Select how you get the costs from Meta Ads:
- Exact Total Cost - you will get exact same cost per campaign as in Meta Ads.
- this method will get the exact cost from Meta and distribute it over all the visitors clicking the ads from that campaign
- it may happen that some visitors to get a different CPC than the one in Meta in this case.
- Exact CPC - you will get the exact CPC for each ad as in Meta Ads
- this will get the exact CPC value from Meta Ads
- in case there are lost clicks (like the campaign was started in Meta before setting it up in CPV Lab), the total cost from Meta Ads will not match the total cost from CPV.
- Exact Total Cost - you will get exact same cost per campaign as in Meta Ads.
The Active status - shows if that API connection is active or not
Each Meta Ads API integration will allow syncronization for costs and to get conversions from the tracker
Accounts to synchronize
- On the Integration page you will see a list with all the Accounts available under the current integration (under the account connected before).
- You can choose the accounts you want to get campaigns syncronized for
How to use this section:
- Select the accounts for which you want to synchronize campaign costs from Meta Ads with CPV Lab or CPV One.
- Click Save to apply your selections and finish later.
- Or click Save & Match to immediately proceed to the Campaign Matching screen, where you can link your Google Ads campaigns with the corresponding campaigns in CPV Lab | CPV One.
5. Match Campaigns
To synchronize cost data accurately, CPV Lab needs to know which campaigns from Meta (Facebook) Ads should be linked to the corresponding campaigns in your CPV Lab tracker.
This is done on the Match screen, where you manually associate campaigns from each platform.
How to Match Campaigns:
- Select a campaign from Meta Ads using the dropdown menu.
- Select the corresponding campaign in CPV Lab that you want to associate with it.
- Click the Match button to create the link.
- A new matching record will appear in the table below.
- Repeat the steps for each campaign you want to match.
Managing Your Matches
- To remove a match, click the
Delete
icon in theActions
column. - After completing all desired matchings, click Save Matchings to confirm and activate the associations.
6. Integration Status
- By default the integration is set to “Active” and to Synchronize Costs and Pass Conversions to Meta Ads.
- You should leave all these checked in order to take advantage of all the Facebook Ads integration features.
7. Setup Cron Job (only for CPV Lab users)
As CPV Lab is a self-hosted ad tracker, you need to do an extra step in order to start the API integration beteen CPV Lab and Meta (Facebook) Ads.
- Setup a CRON job that will run the actual integration like this:
- Frequency: once per hour
- Command:
cd /home/<server-name>/public_html/; php cron-api-integrations.php
- Now the setup is complete and the CRON job will automatically synchronize CPC values for each keyword once per hour.
Tracking cost in CPV Lab | CPV One
- After the API connection is established, you need to run your Meta campaign.
- Cost date will get automatically updated in the cost fields for that campaign in all CPV reports.
- There may be an initial delay (up to 24 hours) before the costs appear inside campaigns after the integration is created. But after that costs will be updated automatically without delays.
Additional Notes
Number of matched campaigns
You can see the number of matched campaigns and imported keywords in the API integrations page by clicking on the Details button next to your already created integration:
Pass Conversions to Meta (Facebook) Ads
- In CPV Lab there are 2 methods to pass conversions from the tracker to Meta Ads
- By using the API integration
- By using the passing conversion to Meta Ads method described here
- Please note that this mehod is not using your API credentials.
You may also find useful: