---- dataentry integration ---- type : integration # do not change this line supports-foxycart-version-from : 2.0 # Minimum required FoxyCart version for this to work supports-foxycart-version-to : # Last FoxyCart version that supports this (leave empty if unknown) systems : facebook # the system(s) that the integration is for, separated with commas if more than one name : Facebook Pixel Conversion Tracking # the name of the integration description : Tracking Foxy conversions with the Facebook Pixel # tags_tags : conversion, tracking, analytics, pixel # tags, separated by commas. don't include the "system" here. date_dt : 2017-07-24 # the date in YYYY-MM-DD format version : # if you have a version for your code, enter it here developer_url : # if you'd like a link back to your site, stick it here ---- ====== Facebook Pixel Conversion Tracking ====== //**Please note:**// The code on this page is submitted by members of the FoxyCart community, and may not verified by FoxyCart.com LLC in any way, shape, or form. Please double check the code before installing. If you need help with it please [[https://foxy.io/contact|reach out to us]], but if we cannot offer assistance (due to unfamiliarity with this particular system or language) we apologize in advance. ===== Installation ===== As Facebook now requires that you verify all domains that you have the tracking pixel on, you will need to make use of a custom subdomain for your store for the Facebook tracking pixel to work. Configuring a custom SSL subdomain for your store is free, it just needs to be requested, and once configured, add some DNS records to your domain. You can [[v:2.0:custom_domain|see more details on that here]]. Within your store's FoxyCart administration, go to the "configuration" section and enable the "Add custom header and footer code to your templates" option. Within the text boxes that appear, paste the following code into the "footer" textarea: {% if context != "cart" or cart_is_fullpage %} {% set fb_pixel_id = "###########" %} {% endif %} Within the script, edit the first line to set your Facebook pixel ID ''{% set fb_pixel_id = "###########" %}''. The script will automatically include the Facebook Pixel initialisation code on the full page cart, checkout and receipt, but will rely on you including it on your own website for the Sidecart view. It will also track page views on the full page cart, checkout and receipt, as well as tracking ''AddToCart'', ''InitiateCheckout'' and ''Purchase'' events. On your own website, in order to track the ''AddToCart'' event for Sidecart, add the following code to the footer of your website (this assumes you've placed the Facebook Pixel initialisation code on your website already too):