Before starting to run ads on Facebook, make sure that your pixel data is correct. 

It is a simple mistake that can cause massive problems and result in corrupt data, which goes to a wrong decision.  

Many a time it happens that Facebook pixel can install at several places in Shopify. However, this may result in showing excessive numbers and give an unclear picture of what is happening in the account. 

Additionally, it is a mistake that needs to fix immediately. A double-counting Facebook Pixel provides excessive data worthless as you can not be sure what is driving conversions and what is not.

Recently, Mountainise was asked to look into a client’s Facebook account with trouble with declining return on ad spend (ROAS). 

Facebook shows exceptional revenue numbers compared to the ad spend, which was a bit suspicious. 

To clarify the doubt, we matched the numbers with their Google Analytics account. That shows Facebook was taking credit for nearly all 100% of sales. 

Generally, it is improbable unless 100% of your traffic is coming from paid Facebook ads.

How to check if Facebook Pixel is Double Counting

One quick way to check Facebook pixel data is to compare the various events to your data in Google Analytics for the same date ranges.

However, the numbers don’t match perfectly, but they should be pretty close.

Facebook pixel in shopify

The odd thing that stood out from the above-highlight figures. Is that the numbers for people completing a purchase were much higher. 

As compare to adding to cart or initiate checkout, which is technically impossible since not every user who puts to cart purchases the product.

Firstly, if this pixel was correct, you would see the add to cart first, initiate checkout next, and purchase last, with declining numbers.

Secondly, it also verifies that the pixel is not working correctly and that the problem is at the purchase event, so click the “View Details” link under purchase.

view detail in Facebook pixel

The details that appear show that almost every purchase had an identical timestamp for the same value. For instance, there were three identical timestamps, and a couple of them only had one. 

To point the exact problem here, the Facebook pixel in Shopify was double-counting or even triple counting every purchase.

The reason for different count times on occasions is due to the idea that some users who have Java disabled would block one of the pixels from firing. 

In addition, that would account for the single purchases, and other users might refresh the confirmation page. That would consider for the triple purchases.

triple count in facebook pixel

How to Fix a Double Counting Facebook Pixel in Shopify

This client website was hosted on Shopify and Facebook Pixel was installed twice. 

Shopify allows native integration with Facebook, which only requires putting the value of pixel ID, and Shopify will take care of the rest.

It is the method most e-commerce sites should use because it makes seamless integration that works well. Check your store to make sure you enable it before following the next steps. You can get there under Online Store >> Preferences.

Facebook pixel installed in shopify

This client had the right Facebook pixel ID, which meant that the pixel code was either hard-code to the theme files. 

In another case is to add to the Shopify Additional Scripts folder. Under Preferences, you can access the Additional Scripts.

Pixel code in shopify

The window can expand by grabbing from the bottom right corner of the text box. As seen here, the Facebook Pixel also load in the native Shopify Facebook pixel setting. 

It meant the pixel was firing twice almost every time the confirmation page load. Moreover, the pixel has the purchase amount hard-coded at $299. 

In addition, that is a huge mistake unless all of the products are priced the same. The price 299.00 should be replaced with

{{ subtotal_price | money_without_currency }}.

additional script in shopify

The solution is to keep the native Shopify pixel integration in Facebook pixel ID in the Online Store >> Preferences section of Shopify. Remove the Facebook pixel from the Additional Scripts section of the checkout settings.

Also Check one other Place

It is also possible the site admin has hard-coded the Facebook pixel on the cart. The liquid page or elsewhere in the theme files. To check, navigate to Online Store >> Edit Code, as shown below:

navigate online shopify store Navigate online store

Hard-coding pixel in Shopify files must be avoided. To find a hard-coded pixel, you have to check multiple dot liquid files by opening each one individually. Using the command find function, to search for the pixel ID. 

Be careful of deleting the entire pixel ONLY. Make a test purchase to ensure nothing is broken after you save the change.

How to Prevent Refresh from Logging Multiple Conversions

It is always recommended by Conversion Rate Optimization Agency to use native integration for Google Analytics and Facebook Pixel within Shopify. 

However, all the other pixels must be put in the Additional Scripts section to track sales from various platforms (like Bing, Google Ads, Pinterest, Twitter, etc.). 

Moreover, the pixels will fire every time and log additional sales that never work if a customer refreshes the confirmation page or bookmarks it and views it again later. 

To prevent this from happening, use the following code format in the Additional Scripts text box:

{% if first_time_accessed %}

Put all the conversion pixels that you only want to fire the first time here

{% else %}

Put all the other pixels/tags you want to run on every visit here

{% endif %}

Generally, you only want the pixels to fire once, but if you wish to checkout page refreshes to be log as a pageview. You can also put that code in the second portion so that it fires on every visit.

In addition, even if you are using any other e-commerce platform and facing multiple conversion, the solution will be similar to this. 

However, it means you somehow install the pixel twice through a native integration and possibly again under a custom scripts section. 

Moreover, we recommend keeping this solution, most likely the native integration. And you are good to go.

Need help with your pixel? Sign up for cost-effective solution!

    Your Name (required)

    Your Email (required)

    Your website (required)

    I want consultation for (required)

    Your Message