# Facebook (Meta) Ads integration

Source: https://skro.eu/docs/integrations/facebook-meta-ads-integration

Set up Facebook (Meta) Ads tracking in Skro, configure traffic source parameters, and connect your advertising campaigns.

[Facebook (Meta) Ads](https://facebook.com) integration gives you the ability to manage and optimize all your ads through the Skro UI.

- Send conversions to Facebook to feed their AI and optimize audiences.
- Sync ad spend every 30 minutes to Skro, so you get accurate reporting.
- Check the delivery status and manage the status of Campaigns, AdSets and Ads directly from Skro UI.
- Change daily budget directly from Skro UI.
- Change bid value directly from Skro UI.
- Dynamic columns: CPM, Link CPC, Link CTR, Impressions, Link EPC and Link Clicks from Facebook to Skro in real-time.

In this guide, you will learn how to set up your campaigns in Facebook (Meta) Ads and Skro so Facebook can pass information to Skro and back with a selected tracking method. This guide does not cover all aspects and options available when creating a campaign on these two platforms. Basic knowledge regarding setting up campaigns in Facebook and Skro is required.

![Manage Facebook Ads campaigns](/images/docs/meta-campaign-reporting.png)

<Steps>

## Step 1. Set up Facebook integration [#step-1-set-up-facebook-integration]

1. Log in to your **Skro** account.

2. Navigate to **Settings** → **Integrations**.

3. In the **Traffic Sources** section click **Add**.

![Meta Integration step 1](/images/docs/meta-integration-1.png)

4. Click **Facebook** logo and you will be redirected to Facebook (Meta) Ads.

![Meta Integration step 2](/images/docs/meta-integration-2.png)

5. Sign in to the account you want to integrate.

6. Opt in your Pages and click **Continue**

![Meta Integration step 3](/images/docs/meta-integration-3.png)

7. Review the requested permissions.

8. Click **Save**.

![Meta Integration step 4](/images/docs/meta-integration-4.png)

9. Click **Got it** and you will be redirected back to Skro.

![Meta Integration step 5](/images/docs/meta-integration-5.png)

10. Choose the Facebook (Meta) Ads account you want to integrate and click **Integrate**.

<Callout type="warn">

If you want to integrate multiple ads account, then you will need to integrate them separately. The logic is that 1 integration equals 1 ad account equals 1 traffic source.

</Callout>

11. Click **Next**.

![Meta Integration step 6](/images/docs/meta-integration-6.png)

## Step 2. Set up Conversion API [#step-2-set-up-conversion-api]

If you want to send conversion info back to Facebook (Meta) Ads, then you will need to enable **Conversion API.**

**Facebook Conversion Events**

1. **Conversion Event Name** - Define all your events that you want to track with CAPI (Lead, Purchase, Subscribe). When creating a campaign in Skro, then you will need to specify which conversion event you want to track. (If you want to track multiple events, then you will need to use our Custom Conversions. For example: AddToCart, ViewContent etc.).
2. **Include Conversion Payout** - If checked, we will send conversion revenue and currency to Facebook.

**Facebook Pixels**

1. **Pixel Name** - Just give a name to your pixel.
2. **Pixel ID** - Your Facebook pixel ID what you are going to use when creating a campaign in Facebook and Skro.
3. **Conversion API Access Token** - Go to Facebook Ads Manager and click **All Tools** → **Events Manager** → Select your pixel and go to **Settings**. Scroll down and you will see Conversion API section. Click **Generate Access Token**.
4. Copy and paste the token into Skro.

Click **Save & Close**.

![Meta Integration step 11](/images/docs/meta-integration-11.png)

Your **Facebook (Meta) Ads** account is successfully integrated.

- You can turn on/off your cost sync.
- Edit, delete or renew your integration access token.
- Renewing your access token is needed because sometimes Facebook will revoke your access token for some reason and your cost sync will not work.

![Meta Integration step 12](/images/docs/meta-integration-12.png)

## Step 3. Associate integration with your traffic source [#step-3-associate-integration-with-your-traffic-source]

1. Go to **Traffic Sources** and click **Create**.

![Meta Integration step 13](/images/docs/meta-integration-13.png)

2. Click **Facebook (Meta) Ads** logo.

![Meta Integration step 14](/images/docs/meta-integration-14.png)

3. Choose and select your Facebook (Meta) integration from dropdown menu.

![Meta Integration step 15](/images/docs/meta-integration-15.png)

4. All parameters are already prefilled for you.

5. Click **Save & Close**.

The integration is ready. Continue by creating a campaign for Facebook (Meta) Ads.

## Step 4. Create a Campaign in Skro [#step-4-create-a-campaign-in-skro]

### (OPTIONAL) Add your landing page as (pre-lander) before your actual offer page. [#optional-add-your-landing-page-as-pre-lander-before-your-actual-offer-page]

1. Go to **Landings** and click **Create**.

2. Select workspace.

3. Add name.

4. Add your landing page URL and macros if needed.

5. Copy **Click to Offer URL** and add it to your landing page as CTA link.

6. Click **Save & Close**.

![Setup Skro Landing](/images/docs/meta-skro-camp-1.png)

### Add your offer(s). [#add-your-offers]

1. Go to **Offers** and click **Create**.

2. Select workspace.

3. Add name.

4. Add your offer URL and add macros if needed. Usually you need to map Skro Click ID macro for same specific parameter name to use postback for conversions.

5. Click **Save & Close**.

![Setup Skro Offer](/images/docs/meta-skro-camp-2.png)

### Create campaign [#create-campaign]

1. Go to **Ads Manager** and click **Create**.

2. Select your integrated **Traffic Source** as Facebook.

3. Select your **Conversion Event Name** and **Pixel**. These are needed to send conversion info back to Facebook (Meta).

4. Cost Model should be **Auto**.

5. Select your cost currency.

6. Click **Next**

![Setup Skro Campaign](/images/docs/meta-skro-camp-3.png)

7. Select workspace.

8. Add title to your campaign.

9. Click **Next**

![Setup Skro Campaign](/images/docs/meta-skro-camp-4.png)

10. Choose your **Destination Type**. In this example we use **flow**

11. Choose your redirect mode. In this example we use **redirect 302**

12. Select your landing.

13. Select your offer(s).

14. Click **Save**

![Setup Skro Campaign](/images/docs/meta-skro-camp-6.png)

15. Choose **Redirect** or **Direct** tracking method and select your landing page. Facebook supports both methods.

16. If you are going to use **Direct tracking method** then copy and paste Skro **Tracking Pixel** into your website between HEAD tags. If you are going to use **Redirect tracking** then you do not need to install any pixels on your landing page.

17. Copy and paste Skro **Click to offer URL** to your landing page as CTA link.

18. Copy and paste Skro **Postback URL** to your affiliate network or use JS or IMG pixel, but you will need to map Skro click ID and payout macros by yourself.

![Setup Skro Campaign](/images/docs/meta-skro-camp-7.png)

## Step 5. Create a Campaign in Facebook (Meta) Ads [#step-5-create-a-campaign-in-facebook-meta-ads]

1. There are multiple campaign types that you can create with Facebook (Meta) Ads. Campaign types determine how your ad will be promoted.

2. In order to create a Facebook (Meta) ad campaign, please follow the steps below:

3. Sign in to your Facebook (Meta) ads manager account.

4. Create a new campaign.

5. Select your campaign type, tracking event, pixel, audience, placements, budget etc.

### Direct Tracking Example [#direct-tracking-example]

The complete direct tracking URL that you have copied from Skro should look like this:

<Callout type="info">

```text
https://prelander1.com/?trck=eyJjcGlkIjoiZDdjOTllNDAtNWVjOS00NjZjLWI1MmMtZTk1YjM3NTViNDY3IiwiciI6MCwicCI6MCwibCI6MH0=&ad_id={{ad.id}}&ad_name={{ad.name}}&adset_id={{adset.id}}&adset_name={{adset.name}}&campaign_id={{campaign.id}}&campaign_name={{campaign.name}}&placement={{placement}}&site_source_name={{site_source_name}}&gender={gender}
```

</Callout>

6. On the ad level you have to provide your landing page URL as your business website. Do not include any tracking parameters at this point, provide the plain URL.

<Callout type="info">

`https://prelander1.com`

</Callout>

![Setup Facebook (Meta) Campaign](/images/docs/meta-camp-1.png)

7. Paste the part of the direct tracking URL that you have copied from Skro that starts after the **?** character in the **URL Parameters** text field.

8. If you are doing ads by gender, then you can define your gender value manually to feed Facebook Ads AI. If do not want to use this parameter then just remove it.

<Callout type="warn">

Male traffic only: `&gender=m`

</Callout>

<Callout type="warn">

Female traffic only: `&gender=f`

</Callout>

<Callout type="info">

```text
trck=eyJjcGlkIjoiZDdjOTllNDAtNWVjOS00NjZjLWI1MmMtZTk1YjM3NTViNsY3IiwiciI6MCwicCI6MCwibCI6MH0=&ad_id={{ad.id}}&ad_name={{ad.name}}&adset_id={{adset.id}}&adset_name={{adset.name}}&campaign_id={{campaign.id}}&campaign_name={{campaign.name}}&placement={{placement}}&site_source_name={{site_source_name}}&gender=f
```

</Callout>

![Setup Facebook (Meta) Campaign](/images/docs/meta-camp-2.png)

### Redirect Tracking Example [#redirect-tracking-example]

The complete **Redirect Tracking URL** that you have copied from Skro should look like this:

<Callout type="info">

```text
https://skrotrack.com/campaign/399fb9ed-fd0d-4c23-9e8d-ba10d5a84549?ad_id={{ad.id}}&ad_name={{ad.name}}&adset_id={{adset.id}}&adset_name={{adset.name}}&campaign_id={{campaign.id}}&campaign_name={{campaign.name}}&placement={{placement}}&site_source_name={{site_source_name}}&gender={gender}
```

</Callout>

6. On the ad level you have to provide your campaign tracking link. Do not include any tracking parameters at this point, provide the plain URL.

<Callout type="info">

`https://skrotrack.com/campaign/399fb9ed-fd0d-4c23-9e8d-ba10d5a84549`

</Callout>

![Setup Facebook (Meta) Campaign](/images/docs/meta-camp-1.png)

7. Paste the part of the redirect tracking URL that you have copied from Skro that starts after the **?** character in the **URL Parameters** text field. You can delete the **?** mark.

8. If you are doing ads by gender, then you can define your gender value manually to feed Facebook Ads AI. If do not want to use this parameter then just remove it.

<Callout type="warn">

Male traffic only: `&gender=m`

</Callout>

<Callout type="warn">

Female traffic only: `&gender=f`

</Callout>

<Callout type="info">

```text
ad_id={{ad.id}}&ad_name={{ad.name}}&adset_id={{adset.id}}&adset_name={{adset.name}}&campaign_id={{campaign.id}}&campaign_name={{campaign.name}}&placement={{placement}}&site_source_name={{site_source_name}}&gender=f
```

</Callout>

![Setup Facebook (Meta) Campaign](/images/docs/meta-camp-2.png)

9. When you are ready with your ad set up, then click **Publish**.

Congratulations, you have successfully set up tracking of Facebook (Meta) traffic with Skro. Each time a visitor clicks on your ad, will be directed to your landing page with Skro's tracking parameters being passed. On a landing page, the direct tracking script will launch and send an HTTPS request to Skro with information about a visit and other information passed from Facebook (Meta).

## Step 6. Additional Conversion API Parameters [#step-6-additional-conversion-api-parameters]

**Requirements:** Facebook Ad Account and Conversion API Integration.

If you need to send additional information via Facebook Conversion API, then you can use the following parameters:

- **firstName** - Using Roman alphabet a-z characters is recommended.
- **lastName** - Using Roman alphabet a-z characters is recommended.
- **email** - User email address.
- **phone** - User phone number.
- **zip** - Use lowercase with no spaces and no dash. Use only the first 5 digits for U.S. zip codes. Use the area, district, and sector format for the UK.
- **fbLoginId** - The ID issued by Meta when a person first logs into an instance of an app. This is also known as App-Scoped ID.
- **fbp** - The Facebook browser ID value is stored in the _fbp browser cookie under your domain. Example value: fb.1.1596403881668.1116446470
- **sourceDomain** - It is used if you want to hide your real source domain. By default it is used your landing or offer domain as source domain and this info is sent back to Facebook.
- **eventId** - You can send your Event ID if you want to avoid duplication. For example, if you are using Meta JS Pixel and Conversion API together and both fires the same event.

<Callout type="info">

Example postback URL with additional parameters:

```text
https://skrotrack.com/postback?clickId=ancdh2udspoc73cjodf0&payout=10&firstName=John&lastName=Toe&email=johntoe@example.com&zip=12345&fbLoginId=1.1.mylogin&fbp=fb.1.1596403881668.1116446470&sourceDomain=whitepage.com&eventId=Jdda88dsa90gf77g8fd9g
```

</Callout>

## Step 7. How to optimize Facebook (Meta) campaigns, adsets and ads? [#step-7-how-to-optimize-facebook-meta-campaigns-adsets-and-ads]

1. Go to **Ads Manager**.

2. Double-click your campaign name.

![Optimize Meta campaigns step 1](/images/docs/facebook/meta_1.png)

3. Use **Group By** select boxes and select the following values:

- Group By 1: **C5: Campaign ID**
- Group By 2: **C3: AdSet ID**
- Group By 3: **C1: Ad ID**

4. In the current view you can now optimize your Facebook campaigns directly from Skro UI. It means that you can turn ON/OFF Facebook campaigns, change campaign budget and see dynamic columns from Facebook in real-time.

![Optimize Meta campaigns step 2](/images/docs/facebook/meta_2.png)

5. Double-click your **campaign name** or use tab above the table to move into the **Adset** view.

6. Now you can manage your Facebook **AdSets**, so that you can turn ON/OFF adset, change budget and see dynamic columns from Facebook in real-time.

![Optimize Meta campaigns step 3](/images/docs/facebook/meta_3.png)

7. Double-click your **adset name** or use tabs above to table to move to the **Ads** view. Also multi-select is supported.

8. Now you can manage your Facebook **Ads**, so that that you can turn ON/OFF ads and see dynamic columns from Facebook in real-time.

![Optimize Meta campaigns step 4](/images/docs/facebook/meta_4.png)

### Manage multiple campaigns [#manage-multiple-campaigns]

1. For example, if you have multiple ad accounts and running like 50 campaigns on each. Then you can optimize all campaigns in 1 single view, if you select **1 traffic source** from toolbar.

2. Do not select any campaign from **Ads Manager** view. Just click the **C5: Campaign ID** tab (or any other tab) above the table to move into that view.

![Optimize Meta campaigns step 5](/images/docs/facebook/meta_5.png)

3. Optimize all your AdSets in one view.

![Optimize Meta campaigns step 7](/images/docs/facebook/meta_7.png)

### Tree view optimization [#tree-view-optimization]

1. Go to **Ads Manager** and select **Tree** on toolbar.

2. Double-click your campaign and you will be redirected to **Reports** view.

3. Use **Group By** select boxes and select the following values:

- Group By 1: **C5: Campaign ID**
- Group By 2: **C3: AdSet ID**
- Group By 3: **C1: Ad ID**

4. Just drill-down your campaigns and adsets and start optimizing.

![Optimize Meta campaigns with tree view step 6](/images/docs/facebook/meta_6.png)

</Steps>

## Verify the setup [#verify-the-setup]

Open the generated campaign URL and check that the visit appears in Skro. Confirm that traffic source macros resolve to actual values. If you send conversions back to the source, verify a test conversion in both systems.

<Callout title="Troubleshooting">

If data is missing, check the selected workspace, integration, campaign, and reporting date range. Compare parameter names and macro values with the examples in this guide before repeating the test.

</Callout>

## Related guides [#related-guides]

<Cards>
  <Card title="Meta Ads automation · New" href="/docs/facebook/meta-ads-automation">Create metric-based or scheduled rules with budget limits, notifications, and action logs.</Card>


<Card title="Postback URL parameters" href="/docs/postback/parameters-in-postback-urls" />

<Card title="Custom conversions" href="/docs/postback/custom-conversions" />

</Cards>
