If you spend on Facebook, Instagram and TikTok ads without a pixel, you know how much you paid, but you don't know which ad actually brought orders. A pixel is a small piece of code added to your store that tells the ad platform what happens after the click: did the customer view the product? Did they complete the order?
In this guide we install the Meta Pixel and the TikTok Pixel step by step, check that they work, and then measure completed orders.
What do you get after installing the pixel?
- Measured results: how many visits and how many orders came from each campaign.
- Better ad optimization: the platform learns who buys and shows your ad to similar people.
- Retargeting: ads for people who visited your store but didn't buy.
Part one: the Meta Pixel (Facebook and Instagram)
1. Create the pixel
- Open Meta Events Manager from your ad account.
- Choose Connect data sources, then Web.
- Name the pixel after your store, and choose to install it manually to get the code.
2. What the base code looks like
The code you copy looks like this (YOUR_PIXEL_ID will be your own pixel number):
<!-- Meta Pixel Code -->
<script>
!function(f,b,e,v,n,t,s){/* ... the pixel loader code exactly as you copy it from Meta ... */}
(window, document, 'script', 'https://connect.facebook.net/en_US/fbevents.js');
fbq('init', 'YOUR_PIXEL_ID');
fbq('track', 'PageView');
</script>
<!-- End Meta Pixel Code -->
Copy the code exactly as Meta gives it to you and don't edit it. The important line is fbq('track', 'PageView'), which records every visit to any page.
3. Add it to your store
On HalaOrders you don't need to edit any files:
- Open the Scripts page in your store dashboard.
- Add a new script and paste the pixel code.
- Choose to load it inside the head, and turn it on.
The code now runs on every page of your store. More details on the Meta Pixel integration page.
4. Check that it works
- Install the Meta Pixel Helper extension in Chrome and open your store. The extension will show the pixel and the
PageViewevent. - Or open Test events in Events Manager, visit your store and watch the events arrive live.
Part two: the TikTok Pixel
1. Create the pixel
- In TikTok Ads Manager open Assets, then Events.
- Choose Web Events and create a new pixel with Manually install pixel code.
2. What the code looks like
<!-- TikTok Pixel Code -->
<script>
!function (w, d, t) {/* ... the pixel loader code exactly as you copy it from TikTok ... */}
(window, document, 'ttq');
ttq.load('YOUR_PIXEL_ID');
ttq.page();
</script>
<!-- End TikTok Pixel Code -->
The ttq.page() line is the equivalent of PageView in Meta.
3. Add it and check it
Add it the same way on the Scripts page as a separate script, then use the TikTok Pixel Helper extension in Chrome to make sure it works. See the TikTok Pixel integration page.
Part three: measuring completed orders
Recording visits alone isn't enough; what matters is knowing which ad brought an order. The simplest way, with no coding at all, is a URL-based custom conversion:
After the customer completes the order they land on the order confirmation page, and on HalaOrders stores its URL contains:
/checkout/pay/succes
In Meta
- In Events Manager choose Custom conversions, then Create.
- Data source: your pixel. Event: All URL traffic.
- Rule: URL contains, then paste
/checkout/pay/succes. - Choose the Purchase category and save.
In TikTok
In the event settings, create an event based on visiting a URL that contains the same path, and map it to the Complete Payment or Place an Order event.
You can then pick this conversion as the goal of your campaigns and see the number of completed orders from each ad.
Note: a URL-based conversion records the customer reaching the confirmation page, meaning a completed order, but it doesn't send the value of each order. To measure order value you need to send a
Purchaseevent with the value from the code itself, which is an advanced setup our team can help you with.
Common mistakes
- Installing the same pixel twice (for example through Scripts and through another tool), which doubles the numbers. Pixel Helper will warn you about this.
- Editing the copied code or deleting part of it.
- Judging an ad after the first two days: give the campaign time to collect enough data.
- Forgetting to check after installing, and discovering weeks of ads later that the pixel never worked.
The bottom line
In short: create the pixel → paste the code in Scripts → check it with Pixel Helper → create a custom conversion for the order confirmation page. Half an hour of setup saves you a lot of ad budget that was being spent without measurement.