Everyone who sells through PrestaShop knows the Facebook Pixel. Fewer realise that TikTok, Pinterest and Snapchat each ship their own near-identical tracking system, and that getting one onto a PrestaShop store is a different job from getting it onto a Shopify or WordPress store, because PrestaShop has no "paste your pixel here" box in the back office. This guide is strictly about the tracking side: what each of these three pixels is, where the code physically goes in PrestaShop, how to fire the e-commerce events that actually matter (a purchase, not just a page view), and how to do it without dragging your PageSpeed score down or breaking GDPR. If you're still deciding whether a given platform is worth your time as a sales channel, that's a separate question, we cover it for TikTok here and Pinterest here. This post assumes you've already decided to advertise and now need the data plumbing in place.
What a social pixel actually does, and why it's worthless without events
A "pixel" is just a small JavaScript snippet that loads on your pages and reports back to the platform. Installed bare, it does one thing: tells TikTok or Pinterest "this person visited your site," which is enough to build a retargeting audience. But the value isn't in the base pixel, it's in the standard events layered on top of it: a product view, an add-to-cart, an initiated checkout, and above all a completed purchase carrying the order value and currency. Without those events the platform's algorithm is flying blind: it can show your ad to people but it can't learn who actually buys, and it can't report a return on ad spend. So the real installation task on PrestaShop isn't "drop in the snippet", it's "fire the right event, with the right data, on the right page."
The mechanics of using those audiences to chase visitors around the web, frequency caps, exclusion windows, creative, is its own discipline; we walk through it in retargeting explained. Here we're only concerned with making the data correct at the source.
Where the code goes in PrestaShop (the part the platforms never explain)
TikTok, Pinterest and Snapchat all hand you a snippet and assume you can paste it into your theme's <head>. In PrestaShop you have three honest ways to do that, in rough order of how much they'll hurt you at the next upgrade:
| Method | Where it lives | Survives a theme/core upgrade? | Can it fire purchase events? |
|---|---|---|---|
| Edit the theme template | themes/your-theme/templates/_partials/head.tpl (or header.tpl) | No, overwritten when the theme updates | Only with manual Smarty work per page |
| A custom module on displayHeader | Your own mini-module hooking hookDisplayHeader / hookDisplayFooter | Yes | Yes, you control the event logic in PHP/JS |
| Google Tag Manager container | One GTM snippet in the theme; pixels managed inside GTM | Yes (only GTM lives in the theme) | Yes, via the data layer (see below) |
So what's the recommendation? For a single pixel you'll rarely change, a tiny custom module hooked on displayHeader is the cleanest: it's upgrade-proof and it can read the order to populate purchase data. The moment you're running two or more of these pixels, switch to Google Tag Manager, one container in the theme, every pixel managed from GTM's web UI, and no theme edit needed to add the next platform. The trick that makes GTM work properly with PrestaShop is the data layer: you push the cart contents and (on the order-confirmation page) the order total and order ID into window.dataLayer, and every pixel reads from there. That's what turns a "someone visited" pixel into a "someone spent €84.50" pixel.
Firing the purchase event reliably
The one event you cannot get wrong is the purchase, and it must fire exactly once, on the real order-confirmation page, with the true amount. In PrestaShop that page is served by the OrderConfirmationController, and the correct hook to attach to is displayOrderConfirmation, it passes you the actual Order object, so you read $order->total_paid and the order reference straight from the database rather than trusting a JavaScript value that a refresh could double-count. Firing on the order controller's earlier steps, or on a thank-you CMS page, is how stores end up reporting twice the revenue they actually made and then wondering why their ROAS looks like a fantasy.
Just as important: the pixel must not fire before the visitor has agreed to marketing cookies. The pattern that satisfies both rules, fire once, on the confirmation page, and only with consent, looks like this for the TikTok pixel (the Pinterest and Snapchat versions are the same shape with their own event names and global object):
{* themes/your-theme/templates/.../order-confirmation, rendered server-side with the real Order *}
<script>
(function () {
// 1. Only fire if the visitor accepted marketing cookies.
function hasMarketingConsent() {
if (window.MPRCR && typeof window.MPRCR.isGranted === 'function') {
return !!window.MPRCR.isGranted('marketing');
}
return false; // no consent layer answer yet → treat as not granted
}
if (!hasMarketingConsent() || !window.ttq) return;
// 2. Values come from the trusted Order object server-side, not from JS state.
ttq.track('CompletePayment', {
value: {$order_total_paid|floatval}, // $order->total_paid
currency: '{$currency_iso|escape:'javascript'}',
content_type: 'product',
contents: {$order_contents_json nofilter} // array of {content_id, quantity, price}
}, {
// 3. Stable event_id keyed on the order → de-dupes against the server-side Events API.
event_id: 'order_{$order_id|intval}'
});
})();
</script>
Three things make that snippet correct rather than a copy-paste landmine: it is gated behind a real consent check (TikTok also exposes ttq.holdConsent() / ttq.grantConsent() for the same purpose); the value and order reference are injected from the server-rendered Order object, so a page refresh can't fabricate a second purchase; and the event_id is keyed on the order id, so when you later add the server-side Events API the platform can de-duplicate the browser event against the server event instead of counting both.
The three pixels, and the one thing each is genuinely good at

The installation pattern is identical for all three; what differs is the event vocabulary and the behaviour each platform is built to capture. Match the pixel to your catalogue, not to the hype.
| Platform | Core e-commerce events | What it's distinctly good at | Worth it when… |
|---|---|---|---|
| TikTok Pixel | ViewContent, AddToCart, InitiateCheckout, CompletePayment | Using pixel events to optimise delivery and build lookalike and custom audiences, though, as with any platform, results depend on your event volume and product-market fit | Impulse-friendly, visual products; an audience mostly under 35 |
| Pinterest Tag | pagevisit, viewcategory, addtocart, checkout | Capturing longer discovery and planning journeys. Users save now and buy weeks later, a path other pixels can miss; compare the actual attribution settings in each ad account | Aspirational, planned purchases: décor, fashion, weddings, DIY, food |
| Snapchat Pixel | PAGE_VIEW, VIEW_CONTENT, ADD_CART, PURCHASE | Reaching the youngest buyers, and often cheaper impressions than Meta or TikTok in that bracket | A genuinely Gen-Z audience in markets where Snapchat is still daily (US, UK, FR, Middle East) |
Note the event names are not interchangeable, Pinterest's are lowercase, Snapchat's are upper-snake-case, TikTok's are camelCase, so a copy-paste between platforms silently fails. This is exactly the kind of per-platform fiddliness that argues for managing them in GTM rather than hand-coding four near-identical-but-not-quite snippets into your theme.
Server-side: the Events API (strongly recommended once you spend materially)
Browser-side pixels are losing accuracy every year, ad blockers, Safari's tracking prevention, and consent rejections all eat into what the JavaScript pixel can see. All three platforms now offer a server-side counterpart that sends the same events straight from your server to theirs: the TikTok Events API, Pinterest Conversions API and Snap Conversions API. In PrestaShop the natural place to call these is the same displayOrderConfirmation hook (or a module override of validateOrder) where you already have the trusted Order object, you fire a PHP cURL request to the platform's API with the order value, the hashed customer email, and an event ID that matches the browser event so the platform can de-duplicate the two. The benefit in plain terms: a purchase that the browser pixel missed (blocked, or the customer closed the tab before it loaded) still reaches the platform, so your reported sales, and therefore the algorithm's learning, stop leaking. It's more work to set up, but once you're spending materially on these channels it's strongly recommended: it's the difference between optimising on complete data and optimising on a reduced and variable share of browser events.
Keeping three trackers from wrecking your PageSpeed
Every pixel you add is more JavaScript on every page, and PrestaShop stores already fight to keep their Core Web Vitals green. Stacking three pixels plus a tag manager is an easy way to add hundreds of milliseconds to load, and a slow store loses the very customers you're paying to acquire. Keep it under control:
- Load pixels through GTM, asynchronously. A single async GTM container is far lighter than three separate synchronous snippets pasted into the head.
- Defer non-critical pixels. A pixel doesn't need to fire in the first paint. Triggering it on the first scroll or a few seconds after interaction keeps your Largest Contentful Paint clean while still catching the events that matter.
- Prefer server-side for the purchase event. Anything sent via the Events API is zero weight in the browser, moving conversions server-side both improves accuracy and removes JavaScript from the page.
- Audit honestly. If you installed a pixel "just in case" and have never run an ad on that platform, remove it. It's collecting nothing you use and costing every visitor load time.
Consent first, or none of this is legal
Under GDPR each of these pixels is a separate third-party vendor that must be disclosed and gated by valid marketing consent, and none of them may fire before the visitor has agreed. A compliant PrestaShop setup means your cookie-consent banner lists TikTok, Pinterest and Snapchat individually, lets a visitor accept or reject each one, and actually withholds the snippet until consent is given. Which is the other strong argument for GTM, because it lets you centralise consent-based firing in one place, though each non-Google tag (TikTok, Pinterest, Snapchat) still has to be configured to respect the consent state; it isn't automatic. Practically, this is also why deferred loading is free: an unconsented visitor never triggers the pixel at all, so they never pay the performance cost either. Get the consent layer right once and the rest of this becomes a configuration exercise rather than a legal exposure.
Attribution: trust your own numbers, not the platforms'
Install all three and you'll quickly notice something uncomfortable: their reported conversions don't add up to your real sales. A customer who discovered a product on TikTok, saved it on Pinterest, and finally bought after a Facebook retargeting ad gets claimed by all three platforms, so the sum of platform-reported conversions is always inflated. Don't budget off those numbers. Use PrestaShop's own order data as the single source of truth and compare it against what each platform claims. The store's actual revenue lives in your back office, and our Financial Revolution module pulls real, paid-order figures into clean reports you can hold up against each channel's self-reported ROAS, so you fund the platforms that genuinely move money and quietly cut the ones taking credit for sales they only watched. That's the whole point of getting the tracking right: not vanity dashboards, but knowing which channel to feed.
Frequently asked questions
Can I just paste my pixel code into PrestaShop somewhere?
There's no native "paste your pixel here" box. Your three honest options are: edit the theme's head.tpl (lost at the next theme update), a small custom module hooked on displayHeader/displayFooter (upgrade-proof, can read the order), or a Google Tag Manager container (one snippet in the theme, every pixel managed in GTM). For one pixel a custom module is cleanest; for two or more, GTM with a data layer scales better. If you'd rather not hand-build it, there are dedicated PrestaShop modules for each, the Facebook Pixel guide covers the Meta one, and the same approach (consent-gated, server-side purchase event) applies to TikTok, Pinterest and Snapchat.
Why don't the platforms' reported conversions match my real sales?
Because a single buyer who touched TikTok, Pinterest and Facebook before purchasing gets claimed by all three, so the sum of platform-reported conversions is always inflated. Don't budget off those numbers. Use PrestaShop's own paid-order data as the single source of truth and compare each platform's claim against it.
Do I legally need consent before the pixel fires?
Yes. Under GDPR each pixel is a separate marketing vendor that must be disclosed and gated by valid consent, and none may fire before the visitor agrees. A compliant setup lists TikTok, Pinterest and Snapchat individually in the consent banner and actually withholds each snippet until that specific consent is given. It isn't automatic just because you run them through GTM; each non-Google tag still has to be configured to respect the consent state.
Is the server-side Events API worth the extra work?
Once you're spending materially, yes. Browser pixels lose accuracy every year to ad blockers, Safari tracking prevention and consent rejections. The TikTok Events API, Pinterest Conversions API and Snap Conversions API send the same events server-to-server from the trusted Order object, so purchases the browser missed still reach the platform. Match the server event's event_id to the browser event's so the platform de-duplicates the two.
Will three pixels wreck my PageSpeed?
They can if you paste three synchronous snippets into the head. Load them through one async GTM container, defer non-critical pixels to first scroll instead of first paint, move the purchase event server-side (zero browser weight), and remove any pixel for a platform you've never actually advertised on.
One last sanity check before you install anything: a pixel only earns its keep if the platform behind it is actually where your customers are. If you haven't pinned that down, start with which platforms actually drive sales, and for the Meta side of the house, the Facebook Pixel for PrestaShop guide covers the one tracker nearly every store should run regardless. Track the platforms you advertise on, fire a clean purchase event server-side, gate it all behind consent, and let your own order data settle the arguments.