Facebook and RedTrack


Intro
Both Facebook and Instagram have the same ad-managing interface (Facebook Ads Manager).
Our API Facebook integration enables you to:
- Pass all conversion data, including extra conversions, back to Facebook and link it to campaigns for better optimization.
- Automatically pause non-converting creatives and campaigns on Facebook, eliminating manual work.
- Keep cost data updated in real time.
There are limited cases when Facebook allows you to use the redirect link (e.g. RedTrack campaign tracking URL) but we as a service provider do not recommend it and cannot guarantee the safety of your tracking campaigns.
For all of your Facebook campaigns, no-redirect tracking with a custom tracking domain is better to be used.
Parameters sent to Facebook upon conversion creation
The following parameters are sent to Facebook when a conversion is created in RedTrack:
Parameter | Description |
FB click id | Facebook click ID, identifies the Facebook click that led to the conversion. Taken from sub 20 of the traffic channel. |
Browser id | Facebook browser ID, used to identify a user’s browser for Facebook tracking. Taken from sub 19 of the traffic channel. |
External id | External identifier for deduplication and attribution. Pulled from rtclickid. |
Email | Hashed email address taken from the parameter assigned the Email role in the Offer Source. |
Phone | Hashed phone number taken from the parameter assigned the Phone role in the Offer Source. |
FirstName | Hashed first name taken from the parameter assigned the First Name role in the Offer Source. |
LastName | Hashed last name taken from the parameter assigned the Last Name role in the Offer Source. |
Birthday | Hashed birth date taken from the parameter assigned the Birthday role in the Offer Source. |
Gender | Gender value taken from the parameter assigned the Gender role in the Offer Source. |
Zip | Postal code value taken from the parameter assigned the Zip role in the Offer Source. |
IP | IP address of the user at the time of the click, sourced from RedTrack click data. |
UserAgent | Browser user agent string captured during the click. |
City | Hashed city name derived from geolocation based on the click IP. |
CityUnhashed | Plain text city name derived from IP geolocation during the click. |
Country | Hashed country name based on IP geolocation at click time. |
CountryUnhashed | Plain text country name from IP geolocation at click time. |
State USA | Hashed U.S. state name based on click IP geolocation. |
State USAUnhashed | Plain text USA state name based on click IP geolocation. |
Currency | Currency for the transaction taken from click data. |
Event ID | Unique event identifier used for event tracking. Can come from either rtclickid or an assigned role. |
Event Name | Describes the type of conversion event (e.g., Purchase, Lead), based on conversion type. |
Event Time | Timestamp of the conversion event in UTC, based on the conversion’s created_at time. |
Event Source Url | URL of the page where the event occurred, defined in the offer form’s pixel settings. |
ActionSource | Describes the source of the event action (e.g., website, app), set in the offer form’s pixel settings. |
Revenue | Monetary value of the conversion taken from the conversion data. |
Content Category | Hashed value indicating the category of the content or product, based on the assigned Content Category role in the Offer Source. |
Content IDs | Product or content identifiers involved in the event, taken from the Content IDs role in the Offer Source. |
Product Name | Name or title of the product/content involved in the conversion, taken from the Product Name role in the Offer Source. |
Contents | Detailed list or array of products/content involved in the conversion, taken from the Contents role in the Offer Source. |
OrderID | Unique order identifier for the transaction, sourced from either the order ID or rtclickid. |
SubscriptionID | Identifier for a subscription or recurring event, based on rtclickid. |
Integration
1. Add a custom tracking domain
1. Add a CNAME record pointing to your RedTrack default domain in your domain registrar.
2. On the left menu go to Tools → Domains → Create new domain.
3. The default domain is stated right on the top and looks like smth.rdtk.io.
4. Add the integrated domain to your RedTrack account and activate the Free SSL option.
2. Add the offer/website you are promoting
This is the target destination link where you plan to run the traffic: it can be an affiliate offer, a direct link to your website, or the shop.
1. Add the offer source: New from template/New from scratch → find the affiliate network you work with/add your custom name → Save.
2. Add the offer link: Offers → New → choose the offer source from the list, add the offer URL → save the changes.
For example: &affsub={clickid} where {clickid} is RedTrack parameter
More info on offer source and offer in RT can be found here.
1. Go to Brands → New → Add your brand (it is the name of your shop or your website).
2. On the same page, add the purchase data parameters – Name/Description is what you will see in reports – Roles define their use with CAPI.
3. Go to Websites → New → Add your website URL (this is your e-commerce shop/website link).
4. Follow the suggested steps to generate the scripts. You will need it later for your e-commerce platform.
More info on e-commerce platform integration is here.
3. Add Facebook traffic channel
1. Go to Traffic Channels → New from template → find Facebook → Add → Save:


The following parameters and their roles are essential for the API cost integration:
{{ad.id}} should always be with Aid role
{{adset.id}} should always be with Gid role
{{campaign.id}} should always be with Cid role


2. In the added template go to Facebook API Integration → Connect Facebook → verify your ad account:


4. Create a campaign in RedTrack
1. Create a campaign in RedTrack.
Campaigns → New → Fill in the info in all the sections and tabs:
- General: Give it the name, and choose the traffic channel, tracking domain, and cost-tracking method.
- Funnels: Choose the type of funnel you are using and add the elements from the drop-downs.
- S2S postback: This field will be filled in automatically based on the data you have added to your traffic channel settings.
- Auto update costs: Do not forget to turn the toggle on if you are working with the API-integrated traffic channel
2. For Facebook tracking you will need to use the tracking script as we highly recommend working with no-redirect tracking. You will have to use our script on the page code, and choose the one that works best for you:
Simple script (one landing page, one traffic channel)
It is generated automatically once you save the campaign and is available under the no-redirect tab.
Advanced script (one landing page, multiple traffic channels)
2.1. Create a campaign for the organic traffic. With the same setup as for the paid traffic:
2.2. Tools → Scripts → New → Fill in the mandatory fields and save the changes
– default – choose this one if you plan to work with your website (e.g. e-com store) where a visitor can click on any link or visit any tab while the target action is tracked always on some other page no matter what the visitor path was before.
– /click support – use it when you lead the visitor from your landing page to a 3rd party offer and use domain.com/click CTA link format.
– /pre-click support – same as /click support but for a prelanding page with domain.com/preclick CTA link.
Title – give your script a name.
Domain – choose a custom tracking domain that will be used in that script.
Default campaign – organic traffic campaign created within step 2.1
Attribution – set the attribution model you want to use:
– First click – first recorded inbound click.
– Last click– last recorded inbound click.
– Last paid click – last recorded inbound click with tracking parameters.
Note: we always recommend using Last paid click attribution, since that in the most accurate way measures which marketing touchpoint a customer last clicked on or engaged with before purchasing, and gives it 100% of the credit.
Attribution window – set the attribution window, the period for the first click, and last paid click models.
Cookie domain – the root domain to place a cookie. This is the root domain of your website
2.3. Once you save the changes, the ready-to-use script will be generated, copy it
You will need to add the tracking parameters later on the Facebook side. The parameters depend on the type of script you have chosen before and can be taken from the “universal script” (advanced) or “no-redirect” (simple) tab within campaign settings:

1. Create a campaign in RedTrack.
Campaigns → New → Fill in the info in all the sections and tabs:
- General: Give it the name, and choose the traffic channel, tracking domain, and cost-tracking method.
- Funnels: Choose the type of funnel you are using and add the elements from the drop-downs.
- S2S postback: This field will be filled in automatically based on the data you have added to your traffic channel settings.
- Auto update costs: Do not forget to turn the toggle on if you are working with the API-integrated traffic channel
2. For Facebook you will need to use our universal tracking script.
The universal tracking script is created automatically once you’ve added the Website and can be taken from your RT account → Scripts. The script should be placed on the page code or for your e-commerce store/website (check out the precise e-commerce guide for details).
The tracking parameters are to be copied from the campaign settings and saved for later:

5. Verify the domain for Facebook
Due to the new Facebook policy, you should now verify the domain you will be using for your Facebook campaign. This is an action that should be done on your Facebook account.
– via meta tag
– via the uploaded HTML file
– via DNS record
For the domain verification procedure details on Facebook, check out the following guides:
– Domain verification in Meta Business Manager
– Methods of domain verification on Facebook
The steps below will demonstrate the DNS record management method.
1. Business Manager → Brand Safety and Suitability → Domains → Add → Create a new domain:

2. Paste your domain → Add:

Correct: website.com.
Incorrect: www.website.com or https://website.com.
3. Select the target domain → choose the DNS verification method:

4. Copy your unique TXT value:

5. Go to your domain registrar → open DNS settings and add a new record with the following values:
- Host: @
- Points to: your unique TXT record from point 4
- TTL: the lowest possible
6. Give it some time for the data replication to happen (approximately 1 hour), then verify the domain in your Facebook domain settings:


7. Associate the domain with your page:


8. Get back to RedTrack → settings of the added Offer (for Affiliates)/ Website (for Advertisers) → CAPI (Maximize signals) → add the values for Default Action source and Default Event URL → Save changes to the template:
- In the Default Action source select from the drop-down the type of the conversion to be set for Facebook API.
- In the Default Event URL add the verified domain. The domain should be secure, use the following link format: https://your.domain.com.

6. Generate the Conversion API Key
Your Facebook account → Events Manager→ pixel settings → Settings → Create Access Token:

7. Find and copy your FB pixel
You can find your unique pixel ID in the Facebook campaign settings → Tracking:

8. Add the pixel to RedTrack
There are 2 ways of adding your FB pixel to RedTrack:
- Via Offer/Website form, in which case all conversions associated with this offer will be sent to that pixel.
- Via FB traffic channel, in which case only conversions attributed to this traffic channel will be sent to that pixel.
Decide on the way and act accordingly:
Go to the settings of the added Facebook traffic channel → Facebook default data source (pixel) → add the the pixel, token and Default conversion name (if needed) → Save changes to the template:

– If the field remains empty, the default conversion is sent with the event under the name Purchase.
– If the field is filled in, the default conversion is sent with the name specified in that field.
Go to the settings of the added Offer/Website → CAPI (Maximize signals) → Add your Meta (FB) pixels to send the conversions with the Meta (FB) conversion API → add the the pixel, token and other needed values → Save changes to the template:

Aside from the mandatory fields like Pixel ID and Conversion API key for that pixel you can also set up the default values for the action source, event URL, and default event name to let the system use them for all your pixels:
- Action source: we recommend using the Website option
- Event URL: the domain verified for Facebook. Use the “https://domain.name” URL structure.
- Default Event Name: this field is not available in the offer form but can be set in the Facebook traffic channel template. If you’ve already added the Pixel ID and API key in the offer form, you don’t need to enter them again in the traffic channel form. You only need to go there to set the Default Event Name.

– If the field remains empty, the default conversion is sent with the event under the name Purchase.
– If the field is filled in, the default conversion is sent with the name specified in that field.
9. Set up the conversion events for Facebook
Setting up the events
– We recommend keeping a Purchase name for one of your conversions so that you do not need to make any adjustments on the Facebook side since Facebook knows this name very well and will optimize the traffic better for a Purchase than a custom name (Sale, Conversion, etc.).
1. Add conversion events you want to track with RedTrack.
Tools → Conversion tracking → Conversion type → add the events you want to track → Save.
The system will automatically send your conversion types to Facebook exactly as you name them.
2. Now you can match the events in one of 2 ways:
– If you added your pixel in the Offer form, you should match your events in the Offer form.

Go to the added Facebook traffic channel template → Facebook default data source (pixel) → enable the Custom Conversion Matching toggle → match the events → Save changes to the template:

Go to the added Offer form → CAPI → enable the Custom Conversion Matching toggle → match the events → Save changes to the form:

Configuring conditional revenue for Facebook CAPI
RedTrack allows you to customize the revenue values sent to Facebook via the Conversions API (CAPI) based on the set Payout value. This feature enables more accurate revenue reporting and optimization in your Facebook Ads campaigns.
Configure the conditional revenue in the same place where you add your Facebook Pixel and API key. This ensures consistency across the pixel, event, and revenue data sent to Meta.
To set it up go to the template where you added your Pixel ID, API key, and matched the events → act accordingly:
Facebook traffic channel → Facebook default data source (pixel) → navigate to the Payout type field next to Default Event name or/and Custom Conversion Type (depending on your setup) → choose the Payout type from the drop-down and assign the Value for it → Save changes:

– None: RedTrack will send the full revenue amount associated with the conversion event.
– Numeric: RedTrack will send this fixed amount as the revenue.
– Percentage: RedTrack will calculate and send the specified percentage of the revenue.
Example
Let’s break down the revenue configuration from the screenshot:

Once the Lead conversion type is triggered, regardless of the actual payout value associated with the conversion (e.g., whether it’s $100 or $10), RedTrack will send exactly 35 as the revenue value for this Lead event to Facebook via the Conversion API.
Offer/Website template → CAPI (Maximize Signals) → Add your Meta (FB) pixels to send the conversions with the Meta (FB) conversion API → navigate to the Payout type field next to Default Action source or/and Custom Conversion Type → choose the Payout type from the drop-down and assign the Value for it → Save changes:

– None: RedTrack will send the full revenue amount associated with the conversion event.
– Numeric: RedTrack will send this fixed amount as the revenue.
– Percentage: RedTrack will calculate and send the specified percentage of the revenue.
Example
Let’s break down the revenue configuration from the screenshot:

Once the Lead conversion type is triggered, regardless of the actual payout value associated with the conversion (e.g., whether it’s $100 or $10), RedTrack will send exactly 35 as the revenue value for this Lead event to Facebook via the Conversion API.
1. Add conversion events you want to use.
Tools → Conversion tracking → Conversion type → add the events you want to track → Save.
The system will automatically send your conversion types to Facebook exactly as you name them.
If you are using non-standard names for the events you send to Facebook (something apart from Purchase, ViewContent, InitiateCheckout, Lead), you need to set them up on Facebook, too:
2. Events Manager → Custom conversions → Create custom conversion:


3. Fill in the fields in the pop-up window:

- Name: give your custom conversion a name
- (optional) Description: add a description to distinguish your custom conversion from others in the list
- Data source: select the data source
- Action source: select the action source to which your custom conversions are attributed (it should match with the one you will set inside RedTrack)
- Event: select the event URL
Refer to this article to learn more about standard event categories on Facebook.
- Rules: set the rules by URL or event parameters. You can select the parameters that you currently send with the event you selected. If you don’t see the parameter you want to choose, update your pixel or Conversions API setup to send the parameter with your event.
For example, if you create a custom conversion using a purchase event and type in Product A, Product B and Product C in the content_id parameter value, the custom conversion measures when someone purchases product A, B or C.
Rules that follow the AND condition.
For example, if you create 3 separate rules for content_id equals A, content_id equals B, and content_id equals C, the custom conversion measures when all 3 events occur.
Refer to this article for more info about Rules within this setup.
- (optional) Enter a conversion value: click to check the box next to Enter a conversion value, then enter your value. Only use this field if the events in your custom conversion don’t have a conversion value.
▸ Filtering events in Meta Events Manager
▸ Best practices for custom conversion setup in Meta Events Manager
▸ How to edit custom conversions in Meta Events Manager
▸ How to delete custom conversions in Meta Events Manager
4. Once you’ve created your custom conversion, to activate it, navigate to the page of your website it’s referencing to trigger it. Then get back to the Events Manager → Custom conversions tab and see if the added conversion changed its status to Active:

10. (if you haven’t done it yet) Create an ad on Facebook
Ads Manager → Create Ad → create a new campaign or use an existing campaign → set up campaign parameters → copy paste your LP URL/Website URL (the link without tracking parameters) under the website URL → add additional tracking parameters (universal script or tracking parameters (UTMs)) in the “URL parameters” section
– If you need to be sure you receive the correct names, add them to the tracking parameters manually or analyze the data by IDs instead:
cmpid=5f92a30bc860ee0001fa9996&sub1={{ad.id}}&sub2={{adset.id}}&sub3={{campaign.id}}&sub4=myad&sub5=myadset&sub6=mycampaign&sub7={{placement}}&sub8={{site_source_name}}
– If there are already some UTM parameters in the URL parameters field, you do not have to delete them, just append the parameters taken from your campaign in RedTrack to the already existing parameters with the help of the ampersand symbol: “&”.
Use this tutorial to help you add your LP URL and tracking parameters properly in Facebook Ads Manager.
11. (optional) Warm up your Facebook account with test conversions
To start running a live campaign, you need to make sure everything is up and running. And at this point, we will need to warm up your account with some fake conversions.
1. Once you’re done with the integration and have created a Facebook campaign, you need to run some live clicks from Facebook.
We will need them for conversion generation. To find your clicks, go to Logs → Clicks:

2. Tools → Conversion tracking → copy the link from the S2S conversion tracking field:

3. Put the clickid from step 1 instead of the replace_me part in the postback URL you copied within step 2.
4. Paste the link to the browser and press enter. You should get this successful message:

5. The conversion will appear in your RedTrack account. Do the same with different click ids within a day. You will need approximately 20 conversions to warm up the account.
Facebook needs a bit more time to attribute the conversions to your campaigns. It can take 48 to 72 hours to see the data.
12. Set up the automation
Set up the automation.
- Use this guide to help set up rules.
- Use this guide for setting up the auto-update cost feature.
13. Increase the event match quality
If you work with an affiliate offer, having a 10/10 match quality is impossible. There is a list of parameters Facebook wants to receive, but only half of them can be covered by any third-party tool. This causes the match quality to be at a low level. And it’s not something you should struggle with.
However, RedTrack has a feature that can help you to improve the event match quality with Facebook. It does not take any additional values from Facebook, but if you have them on your website/affiliate network side (for example, order ID at Shopify) or store them on your side, you can send them to RedTrack and then to Facebook to increase the event match quality.
For the cases where you do not work with any offer source and promote your offers, this feature can be used only if you store the data on your side and have the technical capabilities to add this data to the conversion triggered.
1. Make RedTrack identify and accept this data with a postback first.
Offer sources / Brands → Additional parameters → add the required parameters, macro, name and assign the roles → Save changes to the template:

◉ Macro/Token where you have to insert {r} or {replace}.
◉ Role where you assign your parameters a certain role. The list of supported roles can be viewed in the dropdown:

Data in the following columns is OPTIONAL but useful:
◉ Parameter: that’s where you give your parameter a name, but can leave it empty and in the tracking URL your parameters will be called sub1,2,3 etc.
◉ Name / Description: that’s the name you’ll see in the reports instead of sub1,2,3. For your convenience you can customize these names as you wish.
2. The added parameters will be appended to the Postback URL which you should copy:

3. Paste it to your offer source S2S postback settings as usual (or in any other postback option you use on your side).
Once the conversion postback containing those values is sent to RedTrack, we will grab it → attribute it to the appropriate campaign → send it to Facebook with the specified role.
Troubleshooting
Possible errors
Sometimes, Facebook can disconnect your account randomly for security reasons (you will notice that almost immediately since the cost data stops coming at that point). All you need to do in that case is to reconnect.
“One or more of your Purchase events is missing a value and currency parameter. This may affect your return on ad spend calculation.”
If you have the value optimization on, some conversions still do not get the value. We always send the currency and value by default. This issue can be observed with test conversions. So it’s essential to send all values during the test.
Most probably, you are using Conversion API and pixel at the same time (for example, send the same data from RedTrack and your website or use RedTrack CAPI and some other system CAPI). In this case, you might see both server and pixel type under the event in your Facebook account.
Use only the RedTrack Conversion API to solve the issue.
Another reason can be a duplicate from a pixel or Conversion API without any unique event value, Facebook can recognize. What can be done? Check out this guide.
Conversion attribution may differ due to the FB algorithms (for example, they can be sent to different adsets if Facebook considers attributing some particular conversion to another adset)
Facebook has a 7-day attribution window. If there are less than 7 days between click and conversion, Facebook will attribute it. If the conversion is older than seven days, FB can exclude it from your statistics.
You cannot do anything with the conversion attribution.
Make sure you have followed the Facebook integration guide, verified your domain, and added it to your RedTrack offer settings.
Cost update issues
Here is what you need to check on your side:
1. The traffic channel should be connected from the Facebook template. No error is shown.
If it is not connected or you are not sure, re-connect it.
2. The correct account is connected.
3. The dynamic parameters such as campaign id, adset id and ad id are received by RedTrack (Logs → Clicks → check sub values).
If there are no parameters in click logs, that means we are not receiving them from Facebook. Either these are your test clicks, or you need to check the Facebook campaign settings to have the parameters string in place.
4. The correct roles are assigned to the dynamic parameters;
For the cost update to work properly, the following roles should be obligatory assigned to the Facebook ids in your traffic channel settings:

5. Check the cost model you use in the campaign settings (should be CPC) and if the Auto-update cost toggle is on inside the campaign settings.
What you can check to understand why the cost data is incomplete (higher or lower than the one you have on Facebook):
1. The first thing you need to compare is the IDs. RedTrack takes the cost data per ID (campaign, adset or ad, depending on your subscription level), so if some of the ID is missing, its cost data will not be taken to your RedTrack report.
Check if all IDs are received in RedTrack (campaign report → group by (target ID used for the cost update) → check the list). If not, check this campaign, adset or ad in Facebook and ensure the dynamic parameters are added to pass the ID.
2. Check if the correct roles are assigned to the Facebook IDs in RedTrack. This can be checked in your traffic channel settings:

3. Check if the time zones match in your RedTrack account setting and in Facebook.
If the timezones of your traffic channel and RedTrack don’t match or the timezone within your ad accounts in the traffic channel do not match (for the cases when you run traffic from different ad accounts to one RedTrack campaign), the cost data matching is impossible.

4. Check the cost logs in RedTrack: if costs stopped coming for some time and caused this discrepancy, you might need to reconnect Facebook.
5. Make sure the currency matches in both systems.
Lost events
Sometimes, you might need to check if there are events coming to Facebook and how they come to understand if anything goes wrong.
Business Manager → Data Sources → Datasets → choose the pixel → Open in Event Manager:

Your events are displayed under the Review:
