{"id":3966,"date":"2021-05-10T06:01:24","date_gmt":"2021-05-10T06:01:24","guid":{"rendered":"https:\/\/www.leadshook.com\/help\/?p=3966"},"modified":"2025-07-21T11:25:26","modified_gmt":"2025-07-21T11:25:26","slug":"how-to-setup-the-facebook-conversions-api","status":"publish","type":"post","link":"https:\/\/www.leadshook.com\/help\/how-to-setup-the-facebook-conversions-api\/","title":{"rendered":"How to Setup the Facebook Conversions API"},"content":{"rendered":"\n<p>In this article, you&#8217;ll learn how to setup the Facebook&#8217;s new <a href=\"https:\/\/www.facebook.com\/business\/help\/2041148702652965\" target=\"_blank\" rel=\"noreferrer noopener\">Conversions API<\/a>.<\/p>\n\n\n\n<p>We have included videos, sample scripts\/code and a sample decision tree.  Please import it into your LeadsHook account.<\/p>\n\n\n\n<h2 class=\"wp-block-heading has-vivid-red-color has-text-color\">&gt;&gt;&gt; Warning! Please Update the Pixel IDs from the Base Pixel AND Serverside API Call from the Sample Decision Tree Provided Below &lt;&lt;&lt;<\/h2>\n\n\n\n<h2 class=\"wp-block-heading\">Assumptions<\/h2>\n\n\n\n<p class=\"has-medium-font-size\"><strong><span style=\"color:#cf2e2e\" class=\"tadv-color\">This guide will help you setup Facebook&#8217;s Conversation API.  It is provided without our free support because setups vary from business to business and the steps required to complete these steps are for a technical audience.  <\/span><\/strong><\/p>\n\n\n\n<p><strong>UPDATE: <\/strong>20 August 2021: Add a check so Facebook cookies are only saved AFTER cookies have dropped.<\/p>\n\n\n\n<p><strong>25th July 2021: Update saving of event ids into custom fields (please see video below)<\/strong><\/p>\n\n\n\n<p><strong>10 July 2020 Update: The above decision tree has been updated with a new Webhook node for ViewContent serverside API call.<\/strong><\/p>\n\n\n\n<p>We have added updates to LeadsHook so a lot of complexity has been removed.<\/p>\n\n\n\n<p>We do offer paid help if required or please post in the LeadsHook Users group for additional help from our amazing &#8216;technie&#8217; users.<\/p>\n\n\n\n<p>We&#8217;re assuming you already know or have your Facebook pixel setup.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Background<\/h2>\n\n\n\n<p>With the introduction of <a href=\"https:\/\/www.facebook.com\/business\/help\/331612538028890\" target=\"_blank\" rel=\"noreferrer noopener\">Apple&#8217;s new iOS updates<\/a> (from v. 14.5+), there are severe limitations on tracking.  One of these limitations is the length of time a cookie is kept alive.  As a result conversion numbers are not correctly reported.<\/p>\n\n\n\n<p>This &#8216;new&#8217; conversions API from Facebook (in reality it&#8217;s not actually new).  Conversions API has been provided for a few years.  The iOS update has made it much more important for conversions.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Summary of Setup Process<\/h2>\n\n\n\n<ol class=\"wp-block-list has-medium-font-size\">\n<li>LeadsHook: Save browser information into custom fields<\/li>\n\n\n\n<li>LeadsHook: Save customer information into custom fields (part of decision tree).<\/li>\n\n\n\n<li>LeadsHook: Format data<\/li>\n\n\n\n<li>LeadsHook: Hash data<\/li>\n\n\n\n<li>LeadsHook: Update clientside events for deduplication<\/li>\n\n\n\n<li>Facebook: Setup FB Conversions API<\/li>\n\n\n\n<li>FaceBook: Build API URL, Insert API Token, API Version and Pixel ID<\/li>\n\n\n\n<li>LeadsHook: Send data to Facebook<\/li>\n\n\n\n<li>IF Embedding, Add function to YOUR website to pass cookie values to LeadsHook<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">What&#8217;s so Special About this Conversions API?<\/h2>\n\n\n\n<p>With the limitations on pixels, under certain circumstances, conversion data does not get back to Facebook.  This conversions API reports the same conversions using an API.  It&#8217;s also referred to as serverside API.  Basically the conversion information is sent directly to facebook from a server and not from the browser.  <\/p>\n\n\n\n<p>The advantage is Apple can&#8217;t block serverside API communications because the message to Facebook is sent via a &#8216;back-channel&#8217;, i.e. an API call directly from LeadsHook servers to Facebook&#8217;s servers.<\/p>\n\n\n\n<p>Any serverside Conversions API is much more robust solution.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Do I Still Need my FaceBook Pixel?<\/h2>\n\n\n\n<p><strong>Short Answer<\/strong>: YES<\/p>\n\n\n\n<p><strong>Long Answer<\/strong>: You need to pass some information from Facebook so it knows which campaign, adset, ad (and a bunch of other info Facebook tracks) resulted in a conversion.<\/p>\n\n\n\n<p>All the serverside API is doing is sending these details back to Facebook so it can match the conversion.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Dealing with Potentially Duplicate Conversions<\/h2>\n\n\n\n<p>Now, this creates a problem.  Pixel based conversions are NOT dead (they&#8217;re just not as reliable).  <\/p>\n\n\n\n<p><strong><span style=\"color:#cf2e2e\" class=\"tadv-color\">What happens if the pixel sends a conversion AND the serverside API also sends a conversion.  This will record 2 conversions which is obviously overstating your conversions.  The technical term is called <a href=\"https:\/\/developers.facebook.com\/docs\/marketing-api\/conversions-api\/deduplicate-pixel-and-server-events\/\" target=\"_blank\" rel=\"noreferrer noopener\">DEDUPLICATION<\/a>.  We&#8217;ll be going through this below in Step 7<\/span><\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Steps for Setting Up Your Facebook Conversions API<\/h2>\n\n\n\n<p>Please watch these 2 videos which explains the whole process&#8230;<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-vimeo wp-block-embed-vimeo wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe src=\"https:\/\/player.vimeo.com\/video\/563282122?h=a1ae72b24c&amp;dnt=1&amp;app_id=122963\" width=\"980\" height=\"551\" frameborder=\"0\" allow=\"autoplay; fullscreen; picture-in-picture\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>Video which explains Event IDs &amp; Event Time<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-vimeo wp-block-embed-vimeo wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe src=\"https:\/\/player.vimeo.com\/video\/578870487?h=a497daa6f9&amp;dnt=1&amp;app_id=122963\" width=\"980\" height=\"551\" frameborder=\"0\" allow=\"autoplay; fullscreen; picture-in-picture\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-vimeo wp-block-embed-vimeo wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe src=\"https:\/\/player.vimeo.com\/video\/589398762?h=7687523c05&amp;dnt=1&amp;app_id=122963\" width=\"980\" height=\"551\" frameborder=\"0\" allow=\"autoplay; fullscreen; picture-in-picture\" allowfullscreen><\/iframe>\n<\/div><figcaption class=\"wp-element-caption\">19 Aug 2021: Capture Cookie Values AFTER Cookie Has Dropped<\/figcaption><\/figure>\n\n\n\n<p class=\"has-medium-font-size\"><strong><span style=\"color:#cf2e2e\" class=\"tadv-color\">Download the decision here:<\/span><\/strong> <a href=\"https:\/\/www.leadshook.com\/help\/wp-content\/uploads\/2021\/08\/facebook-conversions-api-v6-19-aug-2021_2021-08-19.zip\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/www.leadshook.com\/help\/wp-content\/uploads\/2021\/08\/facebook-conversions-api-v6-19-aug-2021_2021-08-19.zip<\/a><\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">#0: Warning!  Setup Can Be Difficult<\/h2>\n\n\n\n<p>Hopefully this article will reduce the time you spend on this setup.<\/p>\n\n\n\n<p>As of May 2020, Facebook documents regarding serverside setup has some inconsistencies.  <\/p>\n\n\n\n<p>One of the inconsistencies is what their serverside API conversions tool says is required is different to what is explained in one of their more technical documents.  One of the event parameters, &#8220;action_source&#8221; is not listed as a parameter in the conversions API conversions tool but is required in the pixel helper&#8230;<\/p>\n\n\n\n<p>We have included this parameter in the sample setup (see below)<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img fetchpriority=\"high\" decoding=\"async\" width=\"2278\" height=\"2442\" src=\"https:\/\/www.leadshook.com\/help\/wp-content\/uploads\/2021\/05\/image-2.png\" alt=\"\" class=\"wp-image-3976\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1684\" height=\"1308\" src=\"https:\/\/www.leadshook.com\/help\/wp-content\/uploads\/2021\/05\/image-4.png\" alt=\"\" class=\"wp-image-3980\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">#1: Passing the Right Parameters to Facebook<\/h2>\n\n\n\n<p>The match rate of your conversion API calls is dictated by the quality of the params you need to send.<\/p>\n\n\n\n<p>The data sent to Facebook has 4 different categories of parameters&#8230;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"2276\" height=\"978\" src=\"https:\/\/www.leadshook.com\/help\/wp-content\/uploads\/2021\/05\/image-15.png\" alt=\"\" class=\"wp-image-4016\"\/><\/figure>\n\n\n\n<p>See the complete list of parameters here: <a href=\"https:\/\/developers.facebook.com\/docs\/marketing-api\/conversions-api\/parameters\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/developers.facebook.com\/docs\/marketing-api\/conversions-api\/parameters<\/a><\/p>\n\n\n\n<p>There are a minimum number of parameters needed for an event to be accepted.<\/p>\n\n\n\n<p>For a better match, you can send more info especially about your customers and leads.<\/p>\n\n\n\n<p>There are params you need to send that helps with deduplication. <\/p>\n\n\n\n<p>This article will give examples using &#8216;ViewContent&#8217; and &#8216;Lead&#8217; events but you can use any other standard event as well.  Please see the complete list of <a href=\"https:\/\/developers.facebook.com\/docs\/facebook-pixel\/reference#standard-events\" target=\"_blank\" rel=\"noreferrer noopener\">standard events<\/a> and their required parameters here: <a href=\"https:\/\/developers.facebook.com\/docs\/facebook-pixel\/reference#standard-events\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/developers.facebook.com\/docs\/facebook-pixel\/reference#standard-events<\/a><\/p>\n\n\n\n<p>Here is a comprehensive list of parameters you can pass, what they mean and where do you get them from.  You&#8217;ll also see numbers\/letter and associated scripts below.  These scripts are designed to grab and save the data into various custom fields.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"2358\" height=\"912\" src=\"https:\/\/www.leadshook.com\/help\/wp-content\/uploads\/2021\/05\/image-10.png\" alt=\"\" class=\"wp-image-3998\"\/><\/figure>\n\n\n\n<p class=\"has-vivid-red-color has-text-color\"><strong><span style=\"font-weight: bold; color: rgb(207, 46, 46);\" class=\"tadv-color\">TIP! Please ensure you have setup custom fields for ALL of the variables you want to pass in your api call.<\/span><span style=\"color:#cf2e2e\" class=\"tadv-color\"> And,  ensure the you are correctly formatting the values of our parameters.<\/span>  E.g. Event time is a NUMBER is not wrapped in inverted commas &#8221; &#8220;.<\/strong><\/p>\n\n\n\n<p>TIP! When you import the sample decision tree above your LeadsHook account will auotmatically create all of the fields that we have used in the sample decision tree.  If you are using the SAME custom fields then you do not need to setup any additional custom fields.<\/p>\n\n\n\n<p>LeadsHook automatically provides quite a few of the custom fields you need for your serverside setup.  Please watch the video above for more details.<\/p>\n\n\n\n<p>Here are list of custom fields you&#8217;ll need&#8230; <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"2558\" height=\"1664\" src=\"https:\/\/www.leadshook.com\/help\/wp-content\/uploads\/2021\/06\/2021-06-16_02-39-29-1.jpg\" alt=\"\" class=\"wp-image-4137\"\/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>EVENT_TIME<\/strong>: Use _c_eventtime<\/h4>\n\n\n\n<h4 class=\"wp-block-heading\">EVENT_ID: Use _c_eventid<\/h4>\n\n\n\n<h4 class=\"wp-block-heading\">EVENT_SOURCE_URL: Use _c_eventurl<\/h4>\n\n\n\n<h4 class=\"wp-block-heading\">CLIENT_USER_AGENT: Use _c_useragent<\/h4>\n\n\n\n<h4 class=\"wp-block-heading\">CLIENT_IP_ADDRESS: Use ip_address<\/h4>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"2574\" height=\"816\" src=\"https:\/\/www.leadshook.com\/help\/wp-content\/uploads\/2021\/05\/image-9.png\" alt=\"\" class=\"wp-image-3996\"\/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">FBC COOKIE and FBCLID: Add fbclid custom field &amp; Node Level Script<\/h4>\n\n\n\n<p>Note: Grab this from the cookie and fbclid from the url parameters.  Since LeadsHook automatically grabs urls params as long as the custom field exists, create a custom field called &#8216;fbclid&#8217;.<\/p>\n\n\n\n<p>Please create a new ANSWER text field called &#8216;fbclid&#8217;&#8230;<\/p>\n\n\n\n<p><strong><span style=\"color:#cf2e2e\" class=\"tadv-color\">TIP! Also add the script provided under FBP COOKIE VALUE and save the _fbc cookie into its own custom field in addition to fbclid url param method shown below.  Only 1 is needed for the conversion API.<\/span><\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"2626\" height=\"850\" src=\"https:\/\/www.leadshook.com\/help\/wp-content\/uploads\/2021\/05\/image-11.png\" alt=\"\" class=\"wp-image-3999\"\/><\/figure>\n\n\n\n<p>FBC Cookie: Save cookie into using this LeadsHook function, DT.grabCookie(&#8216;custom_field&#8217;,&#8217;cookie_variable&#8217;)<\/p>\n\n\n\n<p>Add this to any node level script BEFORE your API call to Facebook using a Webhook Node.  In our sample decision tree, we added it to the first node.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;script&gt;\n  (function check_fbq () {\n    if (typeof fbq === 'undefined') setTimeout(check_fbq, 100)\n    DT.grabCookie('fbc', '_fbc')\n    console.log(\"fbc function fired &#91;value: \" + getCookie('_fbc') + \"]\")\n  })();\n&lt;\/script&gt;<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">FBP COOKIE VALUE: Add Node Level Script<\/h4>\n\n\n\n<p>FBP Cookie: Save cookie into using this LeadsHook function, DT.grabCookie(&#8216;custom_field&#8217;,&#8217;cookie_variable&#8217;)<\/p>\n\n\n\n<p>Add this to any node level script BEFORE your API call to Facebook using a Webhook Node.  In our sample decision tree, we added it to the first node.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;script&gt;\n (function check_fbq () {\n    if (typeof fbq === 'undefined') setTimeout(check_fbq, 100)\n    DT.grabCookie('fbp', '_fbp')\n    console.log(\"fbp function fired &#91;value: \" + getCookie('_fbp') + \"]\")\n  })();\n&lt;\/script&gt;<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">#2 Formatting Parameter Values<\/h2>\n\n\n\n<p>Please ensure you are sending the parameters in the right format.  When sending customer data, you need to use lowercase.  This includes email addresses.<\/p>\n\n\n\n<p>Above every text editor block inside LeadsHook, you&#8217;ll see find an easy way to find case filters list&#8230;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1956\" height=\"1198\" src=\"https:\/\/www.leadshook.com\/help\/wp-content\/uploads\/2021\/05\/image-13.png\" alt=\"\" class=\"wp-image-4005\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"2694\" height=\"1658\" src=\"https:\/\/www.leadshook.com\/help\/wp-content\/uploads\/2021\/05\/image-14.png\" alt=\"\" class=\"wp-image-4006\"\/><\/figure>\n\n\n\n<p><strong><span style=\"color:#cf2e2e\" class=\"tadv-color\">TIP! You can convert any custom field value using any of one of the 16 cases listed above.  For the Facebook conversion api, add lowercase filter to all of your custom fields as follows&#8230;<\/span><\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{custom_field:lowercase}\n{first_name:lowercase}\n{email:lowercase}<\/code><\/pre>\n\n\n\n<p>The sample decision tree and code provided below contains more examples.  <\/p>\n\n\n\n<p>The complete list of Customer Information parameters and formatting requirements here: <a href=\"https:\/\/developers.facebook.com\/docs\/marketing-api\/conversions-api\/parameters\/customer-information-parameters\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/developers.facebook.com\/docs\/marketing-api\/conversions-api\/parameters\/customer-information-parameters<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Phone Special Formatting Requirements<\/h3>\n\n\n\n<p>Phone numbers need to be formatted so they do not contain any spaces, brackets or any special characters like &#8216;+&#8217;.<\/p>\n\n\n\n<p><span style=\"color:#cf2e2e\" class=\"tadv-color\"><strong>Example<\/strong>: This phone in different formats:<\/span><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><span class=\"tadv-color\" style=\"color:#cf2e2e\">+1(415)963 9564<\/span><\/li>\n\n\n\n<li><span class=\"tadv-color\" style=\"color:#cf2e2e\">0011 1 415 963 9563<\/span><\/li>\n\n\n\n<li><span class=\"tadv-color\" style=\"color:#cf2e2e\">+1415 963 9564<\/span><\/li>\n\n\n\n<li><span class=\"tadv-color\" style=\"color:#cf2e2e\">415-963-9563<\/span><\/li>\n\n\n\n<li><span class=\"tadv-color\" style=\"color:#cf2e2e\">415 963 9563<\/span><\/li>\n\n\n\n<li><span class=\"tadv-color\" style=\"color:#cf2e2e\">(415) 963 9563<\/span><\/li>\n<\/ul>\n\n\n\n<p><span style=\"color:#cf2e2e\" class=\"tadv-color\">&#8230; needs be &#8216;cleaned&#8217; so the final number is <\/span><br><br><span style=\"color:#cf2e2e\" class=\"tadv-color\"><strong>14159639564<\/strong><\/span><\/p>\n\n\n\n<p>Transforming phone numbers into the correct format is really easy inside LeadsHook.  You can use filters to transform the data.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"2572\" height=\"1630\" src=\"https:\/\/www.leadshook.com\/help\/wp-content\/uploads\/2021\/06\/2021-06-16_02-57-13.jpg\" alt=\"\" class=\"wp-image-4138\"\/><\/figure>\n\n\n\n<p>Use the following filters to transform your phone number into the format required by Facebook<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>raw|international|no_leading_plus<\/code><\/pre>\n\n\n\n<p class=\"has-medium-font-size\"><strong><span style=\"color:#cf2e2e\" class=\"tadv-color\">Please note!  You are not done yet &#8211; you still need to add HASH filter before Facebook will accept your API calls.<\/span><\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">#3: How to Hash Your Customer Information Parameters Before Sending to Facebook<\/h2>\n\n\n\n<p>Hashing information inside LeadsHook is super easy.  In fact we provide you with 5 different hash filters.  Facebook requires customer information to be hashed using SHA256.  <\/p>\n\n\n\n<p>You can hash any custom field data for Facebook add the following filter&#8230;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sha256<\/code><\/pre>\n\n\n\n<p><strong><span style=\"color:#cf2e2e\" class=\"tadv-color\">TIP! Use can use this testing tool to confirm your hashed values: <a href=\"https:\/\/emn178.github.io\/online-tools\/sha256.html\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/emn178.github.io\/online-tools\/sha256.html<\/a><\/span><\/strong><\/p>\n\n\n\n<p>Your final API call will contain custom fields with case filters, data formatting filters and hashing filters.  Here are some examples&#8230;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Email hashed: {email|sha256}\nPhone formatted &amp; hashed: {phone_number|raw|international|no_leading_plus|sha256}\nFirst name, lowercase &amp; hashed: {first_name:lowercase|sha256}\nLast name, lowercase &amp; hashed: {last_name:lowercase|sha256}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">#4: Facebook Pixel Setup &amp; Check<\/h2>\n\n\n\n<p>This article will not go through basic of setting up a pixel.  It&#8217;s assumed you already know how to do this.<\/p>\n\n\n\n<p>You can turn on advanced matching as shown below.  We&#8217;ll be using manual matching because it offers more flexibility and works in more usecases.  <\/p>\n\n\n\n<p>In case you&#8217;re working in a regulated vertical then you don&#8217;t be able to do this.  You can still manually set this up as you&#8217;ll see in Step 4.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><strong>Use manual Advanced Matching if your business is in a regulated vertical:<\/strong> We don&#8217;t allow businesses in regulated verticals to use Automatic Advanced Matching.<\/p>\n<cite>https:\/\/www.facebook.com\/business\/help\/930861050579797 <\/cite><\/blockquote>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"2188\" height=\"1096\" src=\"https:\/\/www.leadshook.com\/help\/wp-content\/uploads\/2021\/05\/image.png\" alt=\"\" class=\"wp-image-3973\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">#5: Facebook Conversions API Setup<\/h2>\n\n\n\n<p>Serverside URL Format: <\/p>\n\n\n\n<p><a href=\"https:\/\/graph.facebook.com\/{API_VERSION}\/{PIXEL_ID}\/events?access_token={TOKEN}\" rel=\"nofollow\">https:\/\/graph.facebook.com\/{API_VERSION}\/{PIXEL_ID}\/events?access_token={TOKEN}<\/a><\/p>\n\n\n\n<p>Here&#8217;s how to get the values for API_VERSION, PIXEL_ID and TOKEN&#8230;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"4346\" height=\"2554\" src=\"https:\/\/www.leadshook.com\/help\/wp-content\/uploads\/2021\/05\/image-12.png\" alt=\"\" class=\"wp-image-4003\"\/><\/figure>\n\n\n\n<p>Your after you add in the values of the variables from your account, it should look something like this&#8230;<\/p>\n\n\n\n<p><a href=\"https:\/\/graph.facebook.com\/v10.0\/12345679891234567\/events?access_token=ecewocon38dy82dh423h2444f44wcehwche48c843\">https:\/\/graph.facebook.com\/v10.0\/12345679891234567\/events?access_token=<\/a><a href=\"https:\/\/graph.facebook.com\/v10.0\/12345679891234567\/events?access_token=ecewocon38dy82dh423h2444f44wcehwche48c843\" rel=\"nofollow\">ecewocon38dy82dh423h2444f44wcehwche48c843<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">#6: Deduplication Setup<\/h2>\n\n\n\n<p>Deduplication is just a fancy way to saying if you&#8217;re sending data via the pixel, i.e. the clientside events like ViewContent, Lead AND also sending this same information via the serverside API then you are sending duplicate conversion data.<\/p>\n\n\n\n<p>Facebook has provided a way to remove any duplicated and its quite easy because we have already done the work above. \ud83d\ude42 <\/p>\n\n\n\n<p>Video on De-duplicates&#8230;<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-vimeo wp-block-embed-vimeo wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe src=\"https:\/\/player.vimeo.com\/video\/547577841?h=049c135c13&amp;dnt=1&amp;app_id=122963\" width=\"980\" height=\"551\" frameborder=\"0\" allow=\"autoplay; fullscreen; picture-in-picture\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>METHOD 1 (Recommended by Facebook)<\/strong><\/h3>\n\n\n\n<p>Send event name and event id.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>METHOD 2<\/strong><\/h3>\n\n\n\n<p>Send event name, fbp pixel value, and\/or an external id.<\/p>\n\n\n\n<p>We already have the event name and fbp pixel value.  For external ID, we recommend you use LeadsHook, lead_id because it&#8217;s easy and does the job.  But you are free to use any other id as well.  All you need to do is hash it before sending it to Facebook.<\/p>\n\n\n\n<p>We recommend sending all: <strong><em> Event name, event id, fbp pixel and an external id<\/em><\/strong>.  Marked below in yellow on the left hand side under &#8220;Serverside Conversions&#8221;).<\/p>\n\n\n\n<p>You need to make one final small adjustment to your clientside events.  Marked below in yellow on the right hand side under &#8220;Clientside Conversions.<\/p>\n\n\n\n<p><strong><span style=\"color:#cf2e2e\" class=\"tadv-color\">IMPORTANT!  Please be sure to use the same event id value for both of your serverside and clientside events as shown below.<\/span><\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"2610\" height=\"1092\" src=\"https:\/\/www.leadshook.com\/help\/wp-content\/uploads\/2021\/05\/image-16.png\" alt=\"\" class=\"wp-image-4020\"\/><\/figure>\n\n\n\n<p><strong><span style=\"color:#cf2e2e\" class=\"tadv-color\">NOTE:<\/span> <span style=\"color:#cf2e2e\" class=\"tadv-color\">For Deduping your external Thank you Page events like Lead. You will need to pass event ID via the exit URL parameter as shown below. Take note, it should be the same exact Event ID with the event you are trying to deduplicate.<\/span><br><\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1799\" height=\"852\" src=\"https:\/\/www.leadshook.com\/help\/wp-content\/uploads\/2021\/09\/Capture.png\" alt=\"\" class=\"wp-image-4411\"\/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>const queryString = window.location.search;\n\nconst urlParams = new URLSearchParams(queryString);\n\nconst eventID = urlParams.get('eventID')\n\nconsole.log(eventID);\n<\/code><\/pre>\n\n\n\n<p><strong><span style=\"color:#cf2e2e\" class=\"tadv-color\">You will also need to add the code above to your page, so it will grab the URL parameter being passed so the pixel code can use the value and send to Facebook. You can add it before the pixel.<\/span><br><br><span style=\"color:#cf2e2e\" class=\"tadv-color\">You can then edit the fbq function for the event that you are trying to dedupe and add the event ID value.<br><br>Example for updating the fbq Lead function:<\/span><\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"852\" height=\"402\" src=\"https:\/\/www.leadshook.com\/help\/wp-content\/uploads\/2021\/09\/dedupe-lead.png\" alt=\"\" class=\"wp-image-4414\"\/><\/figure>\n\n\n\n<p><br><strong><br>You can refer more here: <br><br><span style=\"color:#cf2e2e\" class=\"tadv-color\">https:\/\/developers.facebook.com\/docs\/marketing-api\/conversions-api\/deduplicate-pixel-and-server-events\/<\/span><\/strong><br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><meta charset=\"utf-8\"><br><strong>#7: Testing &amp; Confirm Setup<\/strong><\/h2>\n\n\n\n<p>Download Sample Decision Tree from above<\/p>\n\n\n\n<ol class=\"wp-block-list has-medium-font-size\">\n<li><strong>Grab the test param from your pixel&#8230;<\/strong><\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"3072\" height=\"2114\" src=\"https:\/\/www.leadshook.com\/help\/wp-content\/uploads\/2021\/05\/image-17.png\" alt=\"\" class=\"wp-image-4025\"\/><\/figure>\n\n\n\n<p class=\"has-medium-font-size\"><strong>2. Update your payload with the &#8216;test_event_code&#8217; parameter as shown below.<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"4154\" height=\"2946\" src=\"https:\/\/www.leadshook.com\/help\/wp-content\/uploads\/2021\/05\/image-6.png\" alt=\"\" class=\"wp-image-3990\"\/><\/figure>\n\n\n\n<p class=\"has-medium-font-size\"><strong>3) Add a Webhook Node For Your Lead Event<\/strong><\/p>\n\n\n\n<p>You can also add view content events<\/p>\n\n\n\n<p class=\"has-medium-font-size\"><strong>4) Setup your webhook as follows&#8230;<\/strong><\/p>\n\n\n\n<p>Sample Payload to add to your Webhooks Node.  <\/p>\n\n\n\n<p class=\"has-medium-font-size\"><strong><span style=\"color:#cf2e2e\" class=\"tadv-color\">TIP! Please adjust as needed.  We left in some hashed values for testing.  E.g Gender (ge): for testing.  For your payload, you MUST add a custom field like {fb_gender:lowercase|sha256}.  The values below need to be updated with your custom fields.  The hashed values below are there for a quick test only.<\/span><\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n    \"data\": &#91;\n        {\n            \"event_name\": \"Lead\",\n            \"event_time\": {_c_eventtime},\n            \"action_source\": \"website\",\n            \"event_id\": \"{_c_eventid}\",\n            \"event_source_url\": \"{_c_eventurl}\",\n            \"user_data\": {\n                \"client_user_agent\": \"{_c_useragent}\",\n                \"client_ip_address\": \"{ip_address}\",\n                \"fbc\": \"{fbc}\",\n                \"fbp\": \"{fbp}\",\n                \"em\": \"{email|sha256}\",\n                \"ph\": \"{phone_number|raw|international|no_leading_plus|sha256}\",\n                \"fn\": \"{first_name:lowercase|sha256}\",\n                \"ln\": \"{last_name:lowercase|sha256}\",\n                \"db\": \"531764f38242ecae4d34116402255481859cf83552a545cad2b03268a4204f1a\",\n                \"ge\": \"62c66a7a5dd70c3146618063c344e531e6d4b59e379808443ce962b3abd63c5a\",\n                \"ct\": \"6d5809aba9e26ace73438fc81a5d012738b61a5b6fc913d5100e449e72d80ee2\",\n                \"st\": \"4b650e5c4785025dee7bd65e3c5c527356717d7a1c0bfef5b4ada8ca1e9cbe17\",\n                \"zp\": \"b83c588da0c6931625f42e0948054a3ade722bfd02c27816305742ed7390ac6c\",\n                \"country\": \"9b202ecbc6d45c6d8901d989a918878397a3eb9d00e8f48022fc051b19d21a1d\",\n                \"external_id\": \"{lead_id|sha256}\"\n            },\n            \"custom_data\": {\n                \"currency\": \"USD\",\n                \"value\": 142.52,\n                \"content_name\": \"Content Name\",\n                \"content_category\": \"Content Category\",\n                \"content_ids\": &#91;\"Content ID\"]\n            }\n        }\n    ],\n   \"test_event_code\": \"TEST34465\"\n}<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"2606\" height=\"1484\" src=\"https:\/\/www.leadshook.com\/help\/wp-content\/uploads\/2021\/05\/image-18.png\" alt=\"\" class=\"wp-image-4027\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">#8 Troubleshooting Errors<\/h2>\n\n\n\n<p>Short video on how to troubleshoot issues<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-vimeo wp-block-embed-vimeo wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe src=\"https:\/\/player.vimeo.com\/video\/563282974?h=560832c3a3&amp;dnt=1&amp;app_id=122963\" width=\"980\" height=\"551\" frameborder=\"0\" allow=\"autoplay; fullscreen; picture-in-picture\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">#9  When Embedding, Add function to YOUR website to pass cookie values to LeadsHook<\/h2>\n\n\n\n<p>Here are instructions on grabbing cookie values when embedding your decision tree<\/p>\n\n\n\n<p>When embedding a LeadsHook decision tree into another website, any cookies are dropped in the 3rd party context. <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1404\" height=\"1246\" src=\"https:\/\/www.leadshook.com\/help\/wp-content\/uploads\/2021\/11\/image.png\" alt=\"\" class=\"wp-image-4608\"\/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>This will allow you to pass data to LeadsHook directly from your Website!<\/strong><\/h4>\n\n\n\n<p>IOS &amp; Browser Updates are no longer allowing 3rd party cookies. This is where a cookie is placed by a website whose url is NOT the website you&#8217;re on.<\/p>\n\n\n\n<p>E.g. When you add a Facebook pixel to your website and your decision tree, your website will place cookie in a first party context (technically the context is first party, not the cookie &#8212; but the accepted term is 1st party cookie).<\/p>\n\n\n\n<p>When the FB pixel fires inside LH, it will also try to place a cookie but because your-account.leadshook.io is a 3rd party with respect your website, the cookie now will be fired in a 3rd party context, i.e. 3rd party cookie).<\/p>\n\n\n\n<p>3rd party cookies are now blocked\u2026<\/p>\n\n\n\n<p>This means the pixel fires but no cookies are added when your LeadsHook decision tree is embedded.<br>And, your serverside tracking is affected.<\/p>\n\n\n\n<p>For completeness, direct link decision trees are not affected since it&#8217;s first party.<\/p>\n\n\n\n<p>For this reason we will be adding the ability for you to pass data such as tracking ids like subids AND cookies from your website directly into LeadsHook custom fields for use in serverside API calls for FB (and for all other purposes).<\/p>\n\n\n\n<p>See instructions here:<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-leadshook-knowledge-base wp-block-embed-leadshook-knowledge-base\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"bB3aj0RGch\"><a href=\"https:\/\/www.leadshook.com\/help\/passing-data-from-your-website-directly-to-leadshook\/\">Passing Data from Your Website Directly to LeadsHook!<\/a><\/blockquote><iframe class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;Passing Data from Your Website Directly to LeadsHook!&#8221; &#8212; LeadsHook Knowledge Base\" src=\"https:\/\/www.leadshook.com\/help\/passing-data-from-your-website-directly-to-leadshook\/embed\/#?secret=bB3aj0RGch\" data-secret=\"bB3aj0RGch\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>In this article, you&#8217;ll learn how to setup the Facebook&#8217;s new Conversions API. We have included videos, sample scripts\/code and a sample decision tree. Please import it into your LeadsHook account. &gt;&gt;&gt; Warning! Please Update the Pixel IDs from the Base Pixel AND Serverside API Call from the Sample Decision Tree Provided Below &lt;&lt;&lt; Assumptions [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,239],"tags":[],"class_list":["post-3966","post","type-post","status-publish","format-standard","hentry","category-leadshook","category-tracking"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Setup the Facebook Conversions API - LeadsHook Knowledge Base<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.leadshook.com\/help\/how-to-setup-the-facebook-conversions-api\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Setup the Facebook Conversions API - LeadsHook Knowledge Base\" \/>\n<meta property=\"og:description\" content=\"In this article, you&#8217;ll learn how to setup the Facebook&#8217;s new Conversions API. We have included videos, sample scripts\/code and a sample decision tree. Please import it into your LeadsHook account. &gt;&gt;&gt; Warning! Please Update the Pixel IDs from the Base Pixel AND Serverside API Call from the Sample Decision Tree Provided Below &lt;&lt;&lt; Assumptions [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.leadshook.com\/help\/how-to-setup-the-facebook-conversions-api\/\" \/>\n<meta property=\"og:site_name\" content=\"LeadsHook Knowledge Base\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/leadshook\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-05-10T06:01:24+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-07-21T11:25:26+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.leadshook.com\/help\/wp-content\/uploads\/2021\/05\/image-2.png\" \/>\n\t<meta property=\"og:image:width\" content=\"2278\" \/>\n\t<meta property=\"og:image:height\" content=\"2442\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Nik T\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@leadshook\" \/>\n<meta name=\"twitter:site\" content=\"@leadshook\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Nik T\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"14 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.leadshook.com\/help\/how-to-setup-the-facebook-conversions-api\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.leadshook.com\/help\/how-to-setup-the-facebook-conversions-api\/\"},\"author\":{\"name\":\"Nik T\",\"@id\":\"https:\/\/www.leadshook.com\/help\/#\/schema\/person\/4bfe37d814563cc729828b7055313f4d\"},\"headline\":\"How to Setup the Facebook Conversions API\",\"datePublished\":\"2021-05-10T06:01:24+00:00\",\"dateModified\":\"2025-07-21T11:25:26+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.leadshook.com\/help\/how-to-setup-the-facebook-conversions-api\/\"},\"wordCount\":2418,\"publisher\":{\"@id\":\"https:\/\/www.leadshook.com\/help\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.leadshook.com\/help\/how-to-setup-the-facebook-conversions-api\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.leadshook.com\/help\/wp-content\/uploads\/2021\/05\/image-2.png\",\"articleSection\":[\"LeadsHook\",\"Tracking\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.leadshook.com\/help\/how-to-setup-the-facebook-conversions-api\/\",\"url\":\"https:\/\/www.leadshook.com\/help\/how-to-setup-the-facebook-conversions-api\/\",\"name\":\"How to Setup the Facebook Conversions API - LeadsHook Knowledge Base\",\"isPartOf\":{\"@id\":\"https:\/\/www.leadshook.com\/help\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.leadshook.com\/help\/how-to-setup-the-facebook-conversions-api\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.leadshook.com\/help\/how-to-setup-the-facebook-conversions-api\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.leadshook.com\/help\/wp-content\/uploads\/2021\/05\/image-2.png\",\"datePublished\":\"2021-05-10T06:01:24+00:00\",\"dateModified\":\"2025-07-21T11:25:26+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.leadshook.com\/help\/how-to-setup-the-facebook-conversions-api\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.leadshook.com\/help\/how-to-setup-the-facebook-conversions-api\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.leadshook.com\/help\/how-to-setup-the-facebook-conversions-api\/#primaryimage\",\"url\":\"https:\/\/www.leadshook.com\/help\/wp-content\/uploads\/2021\/05\/image-2.png\",\"contentUrl\":\"https:\/\/www.leadshook.com\/help\/wp-content\/uploads\/2021\/05\/image-2.png\",\"width\":2278,\"height\":2442},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.leadshook.com\/help\/how-to-setup-the-facebook-conversions-api\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.leadshook.com\/help\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Setup the Facebook Conversions API\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.leadshook.com\/help\/#website\",\"url\":\"https:\/\/www.leadshook.com\/help\/\",\"name\":\"LeadsHook Knowledge Base\",\"description\":\"LeadsHook Training &amp; Technical Help\",\"publisher\":{\"@id\":\"https:\/\/www.leadshook.com\/help\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.leadshook.com\/help\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.leadshook.com\/help\/#organization\",\"name\":\"LeadsHook\",\"url\":\"https:\/\/www.leadshook.com\/help\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.leadshook.com\/help\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.leadshook.com\/help\/wp-content\/uploads\/2018\/12\/leadshook-logo.png\",\"contentUrl\":\"https:\/\/www.leadshook.com\/help\/wp-content\/uploads\/2018\/12\/leadshook-logo.png\",\"width\":350,\"height\":83,\"caption\":\"LeadsHook\"},\"image\":{\"@id\":\"https:\/\/www.leadshook.com\/help\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/leadshook\/\",\"https:\/\/x.com\/leadshook\",\"https:\/\/www.linkedin.com\/showcase\/leadshook\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.leadshook.com\/help\/#\/schema\/person\/4bfe37d814563cc729828b7055313f4d\",\"name\":\"Nik T\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/48d53e68db0b1db1cd5c54a750130fb2ee0c663306ff1bd434373f1a368ef7a0?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/48d53e68db0b1db1cd5c54a750130fb2ee0c663306ff1bd434373f1a368ef7a0?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/48d53e68db0b1db1cd5c54a750130fb2ee0c663306ff1bd434373f1a368ef7a0?s=96&d=mm&r=g\",\"caption\":\"Nik T\"},\"sameAs\":[\"http:\/\/www.LeadsHook.com\"],\"url\":\"https:\/\/www.leadshook.com\/help\/author\/nik\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Setup the Facebook Conversions API - LeadsHook Knowledge Base","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.leadshook.com\/help\/how-to-setup-the-facebook-conversions-api\/","og_locale":"en_US","og_type":"article","og_title":"How to Setup the Facebook Conversions API - LeadsHook Knowledge Base","og_description":"In this article, you&#8217;ll learn how to setup the Facebook&#8217;s new Conversions API. We have included videos, sample scripts\/code and a sample decision tree. Please import it into your LeadsHook account. &gt;&gt;&gt; Warning! Please Update the Pixel IDs from the Base Pixel AND Serverside API Call from the Sample Decision Tree Provided Below &lt;&lt;&lt; Assumptions [&hellip;]","og_url":"https:\/\/www.leadshook.com\/help\/how-to-setup-the-facebook-conversions-api\/","og_site_name":"LeadsHook Knowledge Base","article_publisher":"https:\/\/www.facebook.com\/leadshook\/","article_published_time":"2021-05-10T06:01:24+00:00","article_modified_time":"2025-07-21T11:25:26+00:00","og_image":[{"width":2278,"height":2442,"url":"https:\/\/www.leadshook.com\/help\/wp-content\/uploads\/2021\/05\/image-2.png","type":"image\/png"}],"author":"Nik T","twitter_card":"summary_large_image","twitter_creator":"@leadshook","twitter_site":"@leadshook","twitter_misc":{"Written by":"Nik T","Est. reading time":"14 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.leadshook.com\/help\/how-to-setup-the-facebook-conversions-api\/#article","isPartOf":{"@id":"https:\/\/www.leadshook.com\/help\/how-to-setup-the-facebook-conversions-api\/"},"author":{"name":"Nik T","@id":"https:\/\/www.leadshook.com\/help\/#\/schema\/person\/4bfe37d814563cc729828b7055313f4d"},"headline":"How to Setup the Facebook Conversions API","datePublished":"2021-05-10T06:01:24+00:00","dateModified":"2025-07-21T11:25:26+00:00","mainEntityOfPage":{"@id":"https:\/\/www.leadshook.com\/help\/how-to-setup-the-facebook-conversions-api\/"},"wordCount":2418,"publisher":{"@id":"https:\/\/www.leadshook.com\/help\/#organization"},"image":{"@id":"https:\/\/www.leadshook.com\/help\/how-to-setup-the-facebook-conversions-api\/#primaryimage"},"thumbnailUrl":"https:\/\/www.leadshook.com\/help\/wp-content\/uploads\/2021\/05\/image-2.png","articleSection":["LeadsHook","Tracking"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.leadshook.com\/help\/how-to-setup-the-facebook-conversions-api\/","url":"https:\/\/www.leadshook.com\/help\/how-to-setup-the-facebook-conversions-api\/","name":"How to Setup the Facebook Conversions API - LeadsHook Knowledge Base","isPartOf":{"@id":"https:\/\/www.leadshook.com\/help\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.leadshook.com\/help\/how-to-setup-the-facebook-conversions-api\/#primaryimage"},"image":{"@id":"https:\/\/www.leadshook.com\/help\/how-to-setup-the-facebook-conversions-api\/#primaryimage"},"thumbnailUrl":"https:\/\/www.leadshook.com\/help\/wp-content\/uploads\/2021\/05\/image-2.png","datePublished":"2021-05-10T06:01:24+00:00","dateModified":"2025-07-21T11:25:26+00:00","breadcrumb":{"@id":"https:\/\/www.leadshook.com\/help\/how-to-setup-the-facebook-conversions-api\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.leadshook.com\/help\/how-to-setup-the-facebook-conversions-api\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.leadshook.com\/help\/how-to-setup-the-facebook-conversions-api\/#primaryimage","url":"https:\/\/www.leadshook.com\/help\/wp-content\/uploads\/2021\/05\/image-2.png","contentUrl":"https:\/\/www.leadshook.com\/help\/wp-content\/uploads\/2021\/05\/image-2.png","width":2278,"height":2442},{"@type":"BreadcrumbList","@id":"https:\/\/www.leadshook.com\/help\/how-to-setup-the-facebook-conversions-api\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.leadshook.com\/help\/"},{"@type":"ListItem","position":2,"name":"How to Setup the Facebook Conversions API"}]},{"@type":"WebSite","@id":"https:\/\/www.leadshook.com\/help\/#website","url":"https:\/\/www.leadshook.com\/help\/","name":"LeadsHook Knowledge Base","description":"LeadsHook Training &amp; Technical Help","publisher":{"@id":"https:\/\/www.leadshook.com\/help\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.leadshook.com\/help\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.leadshook.com\/help\/#organization","name":"LeadsHook","url":"https:\/\/www.leadshook.com\/help\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.leadshook.com\/help\/#\/schema\/logo\/image\/","url":"https:\/\/www.leadshook.com\/help\/wp-content\/uploads\/2018\/12\/leadshook-logo.png","contentUrl":"https:\/\/www.leadshook.com\/help\/wp-content\/uploads\/2018\/12\/leadshook-logo.png","width":350,"height":83,"caption":"LeadsHook"},"image":{"@id":"https:\/\/www.leadshook.com\/help\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/leadshook\/","https:\/\/x.com\/leadshook","https:\/\/www.linkedin.com\/showcase\/leadshook\/"]},{"@type":"Person","@id":"https:\/\/www.leadshook.com\/help\/#\/schema\/person\/4bfe37d814563cc729828b7055313f4d","name":"Nik T","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/48d53e68db0b1db1cd5c54a750130fb2ee0c663306ff1bd434373f1a368ef7a0?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/48d53e68db0b1db1cd5c54a750130fb2ee0c663306ff1bd434373f1a368ef7a0?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/48d53e68db0b1db1cd5c54a750130fb2ee0c663306ff1bd434373f1a368ef7a0?s=96&d=mm&r=g","caption":"Nik T"},"sameAs":["http:\/\/www.LeadsHook.com"],"url":"https:\/\/www.leadshook.com\/help\/author\/nik\/"}]}},"_links":{"self":[{"href":"https:\/\/www.leadshook.com\/help\/wp-json\/wp\/v2\/posts\/3966","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.leadshook.com\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.leadshook.com\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.leadshook.com\/help\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.leadshook.com\/help\/wp-json\/wp\/v2\/comments?post=3966"}],"version-history":[{"count":85,"href":"https:\/\/www.leadshook.com\/help\/wp-json\/wp\/v2\/posts\/3966\/revisions"}],"predecessor-version":[{"id":7796,"href":"https:\/\/www.leadshook.com\/help\/wp-json\/wp\/v2\/posts\/3966\/revisions\/7796"}],"wp:attachment":[{"href":"https:\/\/www.leadshook.com\/help\/wp-json\/wp\/v2\/media?parent=3966"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.leadshook.com\/help\/wp-json\/wp\/v2\/categories?post=3966"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.leadshook.com\/help\/wp-json\/wp\/v2\/tags?post=3966"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}