Problems with setting up Dynamic Facebook Pixel in my Shopify theme

New Member
2 0 0

Hey everybody,

I am having trouble integrating the Facebook Pixel Codes. I am not too sure they are working too well.

1) Under theme.liquid, I put in the regular facebook pixel code.
2) Under cart.liquid I added the following script in the bottom:

<script>
fbq('track', 'AddToCart', {
content_ids: [{% for item in cart.items %}'{{item.variant_id}}',{% endfor %}],
content_type: 'product',
value: {{ cart.total_price | money_without_currency }},
currency: 'USD'
});
</script>

3) Under product.liquid, I am having the following script:

 

<script>
fbq('track', 'ViewContent', {
content_ids: ['{{ product.id }}'],
content_type: 'product_group',
value: {{ product.price | money_without_currency }},
currency: 'USD'
});
</script>

 

--
Following all the guides, it seems like my code is set correctly! I am using a chrome app called "Facebook Pixel Helper", and according to this, I am having trouble during my process and pixels are not set correctly.


Screenshots are as following:

http://screencast.com/t/pfHRmhl2
http://screencast.com/t/71uEFdUS

I was wondering if anyone knows what is the issue, how to fix it? Any help will be greatly appreciated.

 

Thank you!

0 Likes
Shopify Staff (Retired)
Shopify Staff (Retired)
114 0 14

Facebook Pixels can definitely be tricky, so we have recently added an alternative way to add them to your Shop! We have instructions on how to set this up available here but the system can now attach to your Facebook account to set up automatically! I would give this a go to see if it works better than the alternative. As well, you are always able to call, chat or email in so we can review your set up on your store! 

0 Likes
Highlighted
Shopify Staff
Shopify Staff
81 0 11

I'll move this thread to Shopify Design

0 Likes
New Member
7 0 0

Facebook pixel can easily be managed by Trackify-facebook pixel app. I use this app as it requires zero coding.

0 Likes