At a glance: Use Meta Ads Web campaigns to attribute web-to-app conversions from Meta Ads
Overview
AppsFlyer supports integration with Meta Ads (metaweb_int
) for User Acquisition web-based campaigns, allowing you to report attribution and conversion data directly through Meta's Conversion API (CAPI). Meta can then utilize this data to optimize ad targeting, measure performance, and build custom audiences.
Note
At present, the integration with Meta Web does not support sending re-engagement postbacks to CAPI.
Prerequisites
Before activating the Meta Ads integration, make sure that you have a business account in Meta Business Manager.
How to create a Meta Web Ads Campaign
This article contains information and steps on how to set up a web campaign in Meta Ads for Mobile, PC, and console apps with AppsFlyer. The setup involves defining the integration between Meta Ads and AppsFlyer and setting the campaign configuration on both platforms.
The setup process includes the following mandatory steps:
- Set up Meta Web Ads integration in AppsFlyer (Required)
- Set up AppsFlyer integration in Meta Ads (Required)
And the following optional steps:
- Create a landing page with OneLink Smart Script (Optional)
- Create a landing page with OneLink Smart Banners (Optional)
Set up Meta Web Ads integration in AppsFlyer
Start with activating the Meta Ads integration and setting the postbacks AppsFlyer sends to CAPI.
1. Activate the Meta Web Ads integration
To activate the Meta Web Ads integration:
- In AppsFlyer, from the side menu, go to Collaborate > Partner Marketplace.
- Search for Meta Web and select it.
- Click Set up integration. You’re directed to the Active Integrations setup page.
- In the Integration tab, turn on Activate Partner. Note: The toggle must stay on (activated) for as long as you work with the partner.
- Turn off Advanced Privacy (if you are setting an iOS app integration).
-
Fill in the Pixel ID field. You can retrieve
the pixel ID from your Meta ads Manager:
- From the Ads manager side menu, go down to All tools > Events Manager. Note: Make sure you have the correct business selected from the drop-down on the top right.
- From the Events Manager side menu, select Data sources. You'll see a list of your pixels. If you don’t have a pixel for the selected business, you can create one through the same view.
-
Copy the pixel ID showing under the pixel name.
and paste it into the
Pixel ID field in AppsFlyer.
- Fill the Access Token field. To retrieve the access token, follow these instructions
- Turn on Limit Meta Ads’ use of users’ personal information (CCPA) to enable compliance with data protection laws. Note: Complying with CCPA privacy regulations limits the data coming from Meta Ads users based in California.
2. Set in-app event postbacks
Installs are currently the only events that trigger automatic
default
postbacks to Meta Ads. For other event types, you can create
custom
postbacks by mapping AppsFlyer events to Meta Ads events, which
can
be viewed in the Meta Events Manager.
To set in-app events postbacks perform the following:
- Turn on In-app event postbacks.
- If required, set the In-app event postback window (read more about in-app event postback window configuration in general in this article).
- Click Add event to add an event to the list.
- In the AppsFlyer event column, select the event name from the drop-down box. AppsFlyer receives the event's name either from the SDK integrated into your app or from server-to-server events.
- In the mapped to partner event column, select from the dropdown box the most suitable pre-defined partner event or select CUSTOM.
- In the For Users From column, select This Partner Only to ensure that in-app event postbacks are sent exclusively for events performed by users who originated from this partner.
-
In the including column, select whether
events will be sent with their revenue values. See
Data to include in the postbacks.
Note
If you are setting a purchase event, set the including column to Values and revenue. Selecting any other option will cause the postback to fail.
- [Optional] Click the Add condition icon to set conditions for an event.
- Click Save integration.
-
[Optional] After saving the integration, while remaining
on the
configuration page, you can integrate more of your apps with
the partner:
- From the top-left corner, click the app name under the partner name to open the list of apps.
- Select a different app from the drop-down list.
- Repeat the integration steps for the selected app.
Set up AppsFlyer integration in Meta Ads
Perform the next steps in Meta Ads Manager.
1. Set the campaign type, objective, and goals
- Log in to Meta Ads and create a campaign.
- In Campaign objective select one of the following:
- Sales: This lets Meta optimize towards a specific event (your main KPI).
- Traffic: This lets Meta optimize towards ad clicks. This should only be used if you don’t have other KPIs or if the volume of other KPI events is too low.
- [Optional] If you want to add a custom objective to the above options perform the following:
- In Meta Ads, select the custom event that you want to set as a campaign objective and mark it as a conversion action in Meta Ads.
- In AppsFlyer, in the Meta Web integration page, under In-app event postbacks map an AppsFlyer event to a custom partner event (under the mapped to partner event column) and name it with the same name as the conversion action in Meta Ads.
Note
To learn more about the Meta Campaign objectives, see the Meta documentation.
- In Conversion location select Website.
- In Pixel enter the same pixel ID you entered for
metaweb_int
in the AppsFlyer Partner Marketplace. To learn more about the Meta Pixel, see the Meta documentation (a login is required). - Click Next.
2. Set destination URL
-
Under Destination, in the Website URL field, enter the URL that serves as the destination for your ad. The URL should be for one of the following:
-
Web landing page: Using a landing page is recommended when:
- You have an app on multiple platforms.
- You want to use the landing page to give more information about your advertised product.
- You want to use the landing page to collect more data.
For all these use cases create a landing page with a Smart Script or a Smart Banner.
-
AF attribution links: Using AF attribution links (OneLink, single platform or cross-platform) is recommended when you want the user to be redirected directly to the store to download the app without first visiting a landing page.
Important!
Sometimes, the use of AF attribution links may lead to errors. If this occurs, ask your Meta representatives for a solution, or simply use a Web landing page as the destination URL.
-
- Click Build a URL parameter to add the URL parameters to the URL (whether it is a landing page URL or an AF attribution link).
-
Under Custom parameters, click Add parameter
- Map the AppsFlyer parameters to their Meta values.
-
If your destination URL is a landing page, a OneLink attribution link, or a single platform attribution link, map the following AF parameters to their Meta counterparts:
AF Parameter Mapped Meta value pid
metaweb_int
c
{{campaign.name}}
af_siteid
{{site_source_name}}
af_c_id
{{campaign.id}}
af_adset
{{adset.name}}
af_adset_id
{{adset.id}}
af_ad
{{ad.name}}
af_ad_id
{{ad.id}}
An example of the resulting URL should be:
https://app.appsflyer.com/{app_id}?pid=metaweb_int&c={{campaign.name}}&af_siteid={{site_source_name}}&af_c_id={{campaign.id}}&af_adset={{adset.name}}&af_adset_id={{adset.id}}&af_ad={{ad.name}}&af_ad_id={{ad.id}}&af_r={https://Add-your-store-url.com}
- If your app’s APK is NOT hosted in Google Play Store, add the
af_r
parameter and map to it the store URL, e.g,https://Add-your-store-url.com
- If your app’s APK is NOT hosted in Google Play Store, add the
-
If your destination URL is a PC or a console store, create the link by following the instructions in the table below. For additional information see: CTV, PC, and console platform direct attribution links
Attribution link structure Base URL engagements.appsflyer.com/v1.0/c2s/click/app/ Mandatory path parameters - platform
Example: steam - app_id
Example: 123456
Mandatory query parameters - af_media_source
- af_campaign_id
- af_r
Other parameters See all parameters URL structure https://engagements.appsflyer.com/v1.0/c2s/click/app/{platform}/{app_id}?af_media_source={media_source}&af_campaign_id={campaign_id}&af_r={app_store_url}
Map the following AppsFlyer parameters to their Meta counterparts:
AF Parameter Mapped Meta value af_media_source
metaweb_int
af_campaign
{{campaign.name}}
af_siteid
{{site_source_name}}
af_campaign_id
{{campaign.id}}
af_adset
{{adset.name}}
af_adset_id
{{adset.id}}
af_ad
{{ad.name}}
af_ad_id
{{ad.id}}
An example of cross-platform URL:
https://engagements.appsflyer.com/v1.0/c2s/click/app/steam/123456?af_media_source=metaweb_int&af_campaign_id={{campaign.id}}&af_campaign={{campaign.name}}&af_adset={{adset.name}}&af_adset_id={{adset.id}}&af_ad={{ad.name}}&af_ad_id={{ad.id}}&af_r=https%3A%2F%2Fstore.steampowered.com%2Fapp%2F440%2FTest_app2%2F%3Futm_term%3Dhello
- platform
Note
Meta adds the
fbclid={{fbclid}}
to the destination URL automatically when the ad is clicked -
Note
For a comprehensive guide on the AF link parameters, see Attribution link parameters.
3. Select tracked events
Use the Tracking section to select the conversion events promoted by your ad (setting up of the events is done via the Event Manager).
Important!
Make sure not to choose App Events, otherwise Meta will claim those conversions using the SRN API, which can cause reporting and optimization misalignments.
Create a landing page with OneLink Smart Script
User journey: The user clicks on a Meta ad and is directed to your mobile website. They land on a page with CTA buttons urging them to download your app from one or more platforms. Clicking the button redirects the user to the store.
End-to-end data flow
- The Meta ad URL includes the the
pid=metaweb_int
parameter. When the user clicks on the ad anfbclid
parameter is automatically appended to the clicked URL. - The User is redirected to the URL destination - a landing page containing a Smart Script.
- When the landing page loads, Smart Script fires an impression to AppsFlyer containing the incoming URL parameters. The impression will allow view-through attribution from the web landing page. To learn about impressions and view-through attribution, see here.
- Smart Script generates the outgoing URLs for the CTA buttons on the page based on the incoming URL parameters, including the
fbclid
parameter. The buttons can lead to:- Google Play and App Store via a OneLink attribution link.
- Multiple platform stores (e.g., CTV, Epic and Steam). In this use case, Smart Script generates a single platform attribution link for each platform, leading to the specified platform's store.
- Downloading an APK file to the user's device.
- When the user clicks the CTA button, the click is fired and registered in AppsFlyer.
- The user is redirected to the store and downloads the app.
- When the user opens the app, the install event is registered in AppsFlyer.
- AppsFlyer attributes the install based on probabilistic modeling or deterministically if an install referrer is available.
- A postback containing the
fbclid
parameters and other event parameters is generated and sent to Meta via the CAPI API. Meta uses thefbclid
parameter to identify the specific click while the other parameters help optimize the campaign.
Set up a Smart Script landing page
To set up your smart script Meta Ads campaigns perform the following:
- Set up the template for the campaign’s OneLink attribution links. For more information, see How to create OneLink templates.
- Create a smart script. For more information, see How to create a OneLink Smart Script.
Note
The instructions below focus on the specific steps required to set up a Meta Ads campaign with Smart Script. For a comprehensive guide on how to set up Smart Script campaigns see the How to create a OneLink Smart Script section of the OneLink Smart Script V2 setup article.
- Make sure all relevant URL parameters are appended to the incoming URL. To review the parameters appended to the incoming URL, open Meta Ads Manager and check the URL parameters set during the creation of the destination URL. For more information see: Set destination URL.
- Map the incoming URL parameters required for the Meta Ads campaign to the outgoing URL parameters that will be sent to AppsFlyer when the user clicks the CTA button:
-
PID: Make sure that Smart Script takes the
pid=metaweb_int
parameter value from the incoming URL and maps it to the corresponding parameters in the outgoing URL. -
FBCLID: The
fbclid
parameter is essential for successfully sending in-app events postbacks to Meta. The outgoing URL FBCLID parameter mapping depends on your Smart Script version:- Version 2.8.1 and above: The
fbclid
parameter is forwarded automatically to the outgoing URL parameter when present in the incoming URL, eliminating the need for manual mapping. - Version 2.8.0 and below: The
fbclid
parameter should be mapped manually in the URL parameter mapping section of the Smart Script page:- In Mapping for, select Custom parameter.
- In Outgoing URL parameter and Incoming URL parameters enter fbclid.
Note
To display in AppsFlyer raw data reports, the incoming
fbclid
parameter must also be mapped (in addition to the outgoingfbclid
parameter) to one of the outgoingaf_sub[1-5]
parameters. For more information, see Facebook FBCLID. - Version 2.8.1 and above: The
-
PID: Make sure that Smart Script takes the
Set up a Smart Script cross-platform landing page
To set up your smart script Meta Ads campaigns for cross-platform landing pages perform the following:
- Set up the template for the campaign’s OneLink attribution links. For more information, see How to create OneLink templates.
- Enable your OneLink template for cross-platform attribution, see here.
- Make sure all relevant URL parameters are appended to the incoming URL. To review the parameters appended to the incoming URL, open Meta Ads Manager and examine the URL parameters you set when you built the destination URL. For more information, see Set destination URL.
- Decide for each incoming parameter the outgoing parameter to which it will be mapped. For example
af_site_id
in the incoming URL will be mapped toaf_site_id
in the outgoing URL. - Decide on the default value for the mandatory outgoing parameters that cannot be empty.
- Send your developer the following information:
- Your incoming - outgoing parameter mapping. The developer will create a script that generates an outgoing direct URL based on the incoming - outgoing parameter mapping.
- The parameters default values. The script will populate the outgoing URL parameters with the default values whenever there are no corresponding incoming URL parameter values.
- If you are using a OneLink attribution link, send the domain and template ID to your developer. The developer uses this to create the outgoing OneLink URL. For example:
yourbrand.onelink.me/A1b2
or Branded domain example:click.yourbrand.com/A1b2
- Send your developer the following Dev Hub links:
- Instruction and code examples on how to create the outgoing direct URLs to the non mobile platforms.
- A demo and instruction for creating a cross platform landing page.
- Remind your developer to include the incoming
fbclid
parameter in the outgoing URL.Note
To display in AppsFlyer raw data reports, the incoming
fbclid
parameter must also be mapped (in addition to the outgoingfbclid
parameter) to one of the outgoingaf_sub[1-5]
parameters.
Create a landing page with OneLink Smart Banners
User journey: The user clicks on a Meta ad and is directed to your mobile website. They land on a page and a Smart Banner is displayed with a CTA to download the app from the app store.
End-to-end data flow
- The Meta ad URL includes the the
pid=metaweb_int
parameter. When the user clicks on the ad anfbclid
parameter is automatically appended to the clicked URL. - The User is redirected to the URL destination - a landing page containing a Smart Banner.
- When the landing page loads, the Smart Banner fires an impression event to AppsFlyer, which includes the incoming URL parameters. This impression enables view-through attribution for the landing page. To learn about impressions and view-through attribution, see here.
- The Smart Banner generates the outgoing URL for the CTA button on the banner. The outgoing URL is based on the incoming URL parameters including the
fbclid
parameter. The Smart banner can generate only OneLink-based links. - When the user clicks the Smart Banner CTA button the click is fired and registered in AppsFlyer.
- The user is redirected to the store and downloads the app.
- When the user opens the app, the install event is registered in AppsFlyer.
- AppsFlyer attributes the install based on probabilistic modeling or deterministically if the install referrer is available.
- A postback containing the
fbclid
parameters and other event parameters is generated and sent to Meta via the CAPI API. Meta uses thefbclid
parameter to identify the specific click while the other parameters help optimize the campaign.
Set up a Smart Banners landing page
To set up your Smart Banners Meta Ads campaigns perform the following:
- Set up the template for the campaign’s OneLink attribution links. For more information, see How to create OneLink templates.
- Create a Smart Banner.
Note
The instructions below focus on the specific steps required to set up a Meta Ads campaign with Smart Banners. For a comprehensive guide on how to set up Smart Banners campaigns, see the setup section of the Smart Banners—mobile web-to-app (for marketers) article.
- Set the Smart Banner parameters for Meta Ads campaigns:
- Make sure all relevant URL parameters are appended to the incoming URL. Most importantly the
pid=metaweb_int
andfbclid
are available in the incoming URL to allow the Smart Banner to collect them. These two parameters are necessary for attribution and for sending postbacks to Meta Ads. To review the parameters that are appended to the incoming URL, open Meta Ads Manager and review the URL parameters that you set when you built the destination URL, see: Set destination URL.
- Make sure all relevant URL parameters are appended to the incoming URL. Most importantly the
Frequently Asked Questions (FAQ)
Why am I seeing installs and in-app events attributed to Meta Ads (facebook_int) instead of Meta Web (metaweb_int)"
When you had set up the Tracked event in Meta Ads, you had set it to an App event instead of a Web event. Make sure to set it to Web event.
Traits and Limitations
Trait | Remarks |
---|---|
Cost data | Cost data cannot be retrieved from Meta Ads (metaweb_int ) for web-based campaigns. Instead, it must be sent via Cost Import using the upload file by email method. This limitation also applies to ROI360 subscribers. |
View-through attribution | Currently View-through attribution is not supported for metaweb_int . |