Last active
February 19, 2022 04:57
-
-
Save chrisjhoughton/1dc91dd7bd95717e08d3 to your computer and use it in GitHub Desktop.
Facebook's conversion pixel code, ready to go for Shopify with liquid variables. Change the `youraccountid` and add this to the "additional content and scripts" section of your checkout settings.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Facebook Conversion code --> | |
{% assign fb_pixel_id = 'yourpixelid' %} | |
<script>(function() { | |
var _fbq = window._fbq || (window._fbq = []); | |
if (!_fbq.loaded) { | |
var fbds = document.createElement('script'); | |
fbds.async = true; | |
fbds.src = '//connect.facebook.net/en_US/fbds.js'; | |
var s = document.getElementsByTagName('script')[0]; | |
s.parentNode.insertBefore(fbds, s); | |
_fbq.loaded = true; | |
} | |
})(); | |
window._fbq = window._fbq || []; | |
window._fbq.push(['track', '{{ fb_pixel_id }}', {'value': '{{ order.total_price | money_without_currency }}','currency':'{{ shop.currency}}'}]); | |
</script> | |
<noscript><img height="1" width="1" alt="" style="display:none" src="https://www.facebook.com/tr?ev={{ fb_pixel_id }}&cd[value]={{ order.total_price | money_without_currency }}&cd[currency]={{ shop.currency }}&noscript=1" /></noscript> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think you mean
Change the 'yourpixelid'
in your description :)