Shopify & Facebook Tracking Issue

Hi, I am running Ads on Facebook & Instagram with my shopify store connected.
All the orders happening through ads are being tracked.

However, the main concern is, even if we are creating manual orders from shopify backend, those are also getting tracked in Facebook ads conversions in random campaign which is creating a lot of confusions.
How can i resolve this issue?

@Chlmarketing Hey To resolve this issue, make sure your Facebook Pixel is only tracking conversions from specific events like ā€œPurchaseā€ and not manual orders. You can adjust your Pixel settings in Shopify or use a tag management tool like Google Tag Manager to ensure only relevant conversions are tracked. This will prevent manual orders from being incorrectly attributed to your ad campaigns

1 Like

Hey @rajimulislamjoy Thank you for your response.
Could you please guide me with steps to make necessary adjustments to Pixel settings. Have been trying to find out for a long.

Hi, I faced some issues with this reply. Kindly refer to my new reply to this question. :slightly_smiling_face:

Hey there,

It seems like there is some server-side Meta conversions tracking that is not distinguishing between orders from Checkout and orders created manually. If this is a deal breaker, it would be better for you to use a Custom pixel for conversion tracking instead.

To set up the custom pixel, follow these steps:

  1. Go to Shopify Admin.
  2. Click on Settings.
  3. Go to Customer events.
  4. Click on Add custom pixel.
  5. Enter a pixel name such as Facebook Pixel.
  6. Click on Add pixel.
  7. Then paste this code in the Code section (replace your-pixel-id with your actual pixel id):

!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’);

const metaPixelId = ā€˜your-pixel-id’;
fbq(ā€˜init’, metaPixelId);

analytics.subscribe(ā€˜product_added_to_cart’, (event) => {
const metaCartAmount = event.data.cartLine.cost.totalAmount;
fbq(ā€˜trackSingle’, metaPixelId, ā€˜AddToCart’, {
value: metaCartAmount.amount,
currency: metaCartAmount.currencyCode
});
});

analytics.subscribe(ā€˜checkout_started’, (event) => {
const metaPrice = event.data.checkout.subtotalPrice;
fbq(ā€˜trackSingle’, metaPixelId, ā€˜InitiateCheckout’, {
value: metaPrice.amount,
currency: metaPrice.currencyCode
});
});

analytics.subscribe(ā€˜checkout_completed’, (event) => {
let metaCustomerData = {};
if (event.data.checkout.email) {
metaCustomerData.email = event.data.checkout.email;
if (event.data.checkout.shippingAddress) {
metaCustomerData.first_name = event.data.checkout.shippingAddress.firstName;
metaCustomerData.last_name = event.data.checkout.shippingAddress.lastName;
}

}

fbq(ā€˜init’ , metaPixelId, metaCustomerData);

if (event.data.checkout && event.data.checkout.subtotalPrice) {

let metaPrice = event.data.checkout.subtotalPrice;

let metaCurrency = event.data.checkout.currencyCode;

let metaOrderId = event.data.checkout.order.id;
fbq(ā€˜trackSingle’, metaPixelId, ā€˜Purchase’, {
value: metaPrice,
currency: metaCurrency
}, {eventID: metaOrderId});

}

});

  1. Click on Save and then click on Continue.

Hope this helps :slightly_smiling_face:

1 Like

Hi Masoomi, thanks for your reply.

We are experiencing the exact same issue. Do you recommend that custom pixel to be the only one set up within the store?

Thanks!

We are having the same issue. Did you find a solution to this Algofy? Our pixel has been in place for several years and we don’t want to start with a new/custom one. Thanks for any help!

Hello,

I am trying to add a Facebook Ad Pixel to ONE PAGE on my website, and I am unable to add the code in the template for that page, I keep getting an error message. Can you please help me add my code to one page?

This is the page I want to add the pixel to: Inquire about Claire Hodges Art Custom Wedding Invitations to track when peope click on my Facebook Ad and see when they come to my site

Would you be interested to connect pixel through google tag manager GTM.

Because GTM is the most recommended and stable way to connect pixel or any other tracking pixel.

kind regards.

Yes, that is fine, but I need you to show me how to do that.

To install Meta Pixel through Google Tag Manager GTM follow these steps:

  1. Create a custom pixel under customer events
  2. Install a GTM script/data layer with a GTM snippet
  3. Once GTM is connected with the store backend, create a Facebook pixel tag
  4. trigger all pages
  5. Create datalayer variables to pass event data like value, currency, transaction id, content ID, and content name
  6. Submit the container and check for the test event.

These are the fundamental steps to connect GTM and install the pixel.

Feel free to ask if you have any questions.