cancel
Showing results for 
Search instead for 
Did you mean: 

Facebook Dynamic Product Ads

Facebook Dynamic Product Ads

Can somebody help me implemented those scripts? Any advice is appreciated. Thank You. 

 

For product page:

 

<script>
!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,document,'script','//connect.facebook.net/en_US/fbevents.js');fbq('init', '<FB_PIXEL_ID>');fbq('track', 'ViewContent', { 
    content_type: 'product',    content_ids: ['1234'],    content_name: 'ABC Leather Sandal',    content_category: 'Shoes',    value: 0.50,    currency: 'USD'
});
</script>

 

For Cart Page:

 

<!-- Facebook Pixel Code -->
<script>
!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,document,'script','//connect.facebook.net/en_US/fbevents.js');
fbq('init', '<FB_PIXEL_ID>');
fbq('track', 'PageView');
fbq('track', 'AddToCart', { content_name: 'Shopping Cart', content_ids: ['1234', '1853', '9386'], content_type: 'product', value: 3.50, currency: 'USD' }); </script> <!-- End Facebook Pixel Code -->

 

 Thank You Page:

 

<!-- Facebook Pixel Code -->
<script>
!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,document,'script','//connect.facebook.net/en_US/fbevents.js');
fbq('init', '<FB_PIXEL_ID>');
fbq('track', 'PageView');
fbq('track', 'Purchase', { content_ids: ['1234', '4642', '35838'], content_type: 'product', value: 247.35, currency: 'USD' }); </script> <!-- End Facebook Pixel Code -->

 

2 REPLIES 2

Re: Facebook Dynamic Product Ads

I placed the script on every of those pages, I just need help to replace the variables.

 

Re: Facebook Dynamic Product Ads