Long story short - according to our specific marketing needs (as we will engage different marketing team with different FB accounts) we need to integrate several meta pixel directly to our store.
We have conduct our research and it seems that official Meta Pixel App doesn’t support several pixel - we could add only one FB account = 1 pixel.
Other Apps seems to not fit our needs and also they are pretty expensive and charge at least 10$ for additional pixel, but as a result of test the tracking didn’t work well.
We have tried to manually add meta pixel code to theme.liquid using trackSingle function to fire each pixel only for a certain products based on unique product ID, but as a results the tracking was disgusting and unclear (we even didn’t understand which campaign gain results and which not).
Here is the example of our meta pixel code:
// Initialize the first pixel
fbq('init', 'first_pixel_id');
fbq('trackSingle', 'first_pixel_id', 'PageView');
// Track ViewContent event for first pixel
fbq('trackSingle', 'first_pixel_id', 'ViewContent', {
content_name: 'product_name',
content_ids: ['product_id'],
content_type: 'product',
value: 16.99,
currency: 'USD'
});
// Track AddToCart event for first pixel
fbq('trackSingle', 'first_pixel_id', 'AddToCart', {
content_name: 'product_name',
content_ids: ['product_id'],
content_type: 'product',
value: 16.99,
currency: 'USD'
});
// Track InitiateCheckout event for first pixel
fbq('trackSingle', 'first_pixel_id', 'InitiateCheckout', {
content_name: 'product_name',
content_ids: ['product_id'],
content_type: 'product',
value: 16.99,
currency: 'USD'
});
// Track AddPaymentInfo event for first pixel
fbq('trackSingle', 'first_pixel_id', 'AddPaymentInfo', {
content_name: 'product_name',
content_ids: ['product_id'],
content_type: 'product',
value: 16.99,
currency: 'USD'
});
// Initialize the second pixel
fbq('init', 'first_pixel_id');
fbq('trackSingle', 'first_pixel_id', 'PageView');
// Track ViewContent event for second pixel
fbq('trackSingle', 'first_pixel_id', 'ViewContent', {
content_name: 'product_name',
content_ids: ['product_id'],
content_type: 'product',
value: 19.99,
currency: 'USD'
});
// Track AddToCart event for second pixel
fbq('trackSingle', 'secodn_pixel_id', 'AddToCart', {
content_name: 'product_name',
content_ids: ['product_id'],
content_type: 'product',
value: 19.99,
currency: 'USD'
});
// Track InitiateCheckout event for second pixel
fbq('trackSingle', 'secodn_pixel_id', 'InitiateCheckout', {
content_name: 'product_name',
content_ids: ['product_id'],
content_type: 'product',
value: 19.99,
currency: 'USD'
});
// Track AddPaymentInfo event for second pixel
fbq('trackSingle', 'secodn_pixel_id', 'AddPaymentInfo', {
content_name: 'product_name',
content_ids: ['product_id'],
content_type: 'product',
value: 19.99,
currency: 'USD'
});
</script>
<noscript>
<img height="1" width="1" style="display:none"
src="https://www.facebook.com/tr?id=first_pixel_id&ev=PageView&noscript=1" />
<img height="1" width="1" style="display:none"
src="https://www.facebook.com/tr?id=second_pixel_id&ev=PageView&noscript=1" />
</noscript>
<!-- End Meta Pixel Code -->
Also we have added additional purchase only pixel tracking on Post Purchase Page (thank_you page)
<!-- Meta 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',
'https://connect.facebook.net/en_US/fbevents.js');
// Initialize the first pixel
fbq('init', 'first_pixel_id');
// Track purchase event for the first pixel
fbq('trackSingle', 'first_pixel_id', 'Purchase', {
content_name: 'product_name',
content_ids: ['product_id'],
content_type: 'product',
value: 16.99,
currency: 'USD'
});
// Initialize the second pixel
fbq('init', 'second_pixel_id')
// Track purchase event for the second pixel
fbq('trackSingle', 'second_pixel_id', 'Purchase', {
content_name: 'product_name',
content_ids: ['product_id'],
content_type: 'product',
value: 19.99,
currency: 'USD'
});
<!-- Purchase NoScript -->
// Purchase for the first pixel
<noscript>
<img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=first_pixel_id&ev=Purchase&cd[content_name]=product_name[content_ids]=product_id[content_type]=product&cd[value]=19.99&cd[currency]=USD" />
// Purchase for the second pixel
<img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=second_pixel_id&ev=Purchase&cd[content_name]=product_name[content_ids]=product_id[content_type]=product&cd[value]=19.99&cd[currency]=USD" />
</noscript>
<!-- End Meta Pixel Code -->
But it didn’t help. As a result we saw unclear tracking which didn’t aligned with real store purchases. I’ve contacted Shopify Support team and they told me that everything seems to be fine for the pixel implementation perspective and redirected me to Meta support which told me that according to Meta Pixel Helper extension - we set up pixel not right and every event is firing within PageView.
Original Meta Support message:
So far, our engineers have come up with almost the same answer, namely that after checking the website, they see that there are multiple pixels implemented and that events such as AddPaymentInfo, AddToCart, InitiateCheckout, PageView, and ViewContent are fired on the target PageView, which is considered an incorrect implementation.> > Facebook recommends implementing the Pixel Code together in the header of the website, and it is important that the JS code matches the code from the event manager. Incorrect implementation can cause issues with reporting, targeting, or event triggering.> > Also, note that if multiple pixels are configured on the same URL, it can cause crossfire between pixels, resulting in a warning. Having multiple pixels on the same page with their own underlying codes and events can lead to crossfire, double fires, and ultimately inaccurate tracking.> > They insist that the problem is in the pixel implementation and ask you to contact the website developer to check the pixel implementation and event setup.> > After setting up the events correctly and verifying the pixels, the engineering team asks to check the URL and make sure the events are firing properly.
We have tried to add pixel within customer events and custom pixel sandbox, but it works the same as manually added pixel code. Could someone suggest what was done wrong and how to fix the correct tracking issue?