Marketing Pixels (Meta + TikTok)
Meta and TikTok ad pixels with server-side purchases and consent gating
What it does
Ad platforms learn which clicks turn into sales from small tracking scripts on your site, and browsers and ad blockers increasingly hide those signals. This plugin installs the Meta Pixel and the TikTok Pixel on your public pages from nothing more than their pixel IDs. It reports page views plus the store events ViewContent, AddToCart, InitiateCheckout and Purchase, which TikTok knows as CompletePayment. After a paid order is fulfilled, your server also sends the purchase to Meta's Conversions API and TikTok's Events API, so a sale still counts when the browser stayed silent. Both pixels can wait for visitor consent first.
Who it's for
Shop owners who run paid ads on Meta, TikTok or both and want those platforms to see which campaigns produce orders. You need a pixel from Meta Events Manager or TikTok Events Manager, plus an access token if you want server-side purchase events. It is a good fit when you sell to European or British buyers, because consent handling is built in. If you do not advertise on either platform, you can ignore it.
How it works
Open the plugin settings and fill in the Meta tab, the TikTok tab or both. Paste the pixel ID, switch the pixel on, and add the access token if you want server-side purchases. Save.
On every public page, VeloCMS adds each enabled pixel's base code, but only when its ID passes a format check. With consent on, the code waits in the page and does not run yet.
A visitor accepts the consent banner, or is outside the EU, EEA and UK, and the pixels load. With consent switched off they load straight away and no banner is shown. From then on the browser reports page views, product views, adds to cart, the start of checkout and the purchase on your order confirmation page.
When a paid order is fulfilled, your server sends one Purchase event to Meta and one CompletePayment event to TikTok with the order value, currency, product lines and a hashed email. Meta and TikTok each pair it with the browser event through a shared event ID built from your order ID, so the sale is counted once.
Settings you configure
- Enable Meta Pixel, Enable TikTok Pixel
- Each is off until you switch it on. Meta adds the Meta base code and allows the server-side Purchase event. TikTok adds the TikTok base code and allows the server-side CompletePayment event.
- Meta Pixel ID
- A 15 or 16 digit number from Meta Events Manager. Anything else is rejected before saving.
- Conversions API access token
- Needed only for server-side purchases. Stored encrypted and shown as hidden dots after saving. Leaving it blank sends no server-side Meta event.
- TikTok Pixel ID
- 15 to 25 capital letters and digits from TikTok Events Manager.
- Events API access token
- Needed only for server-side purchases. Stored encrypted, never shown again after saving.
- Test event code
- One optional field per platform, copied from its Test Events tool. Leave it blank in production, because events sent with a test code are kept out of reporting.
- Require consent before loading pixels
- On by default, in the Consent tab. Visitors from the EU, EEA, the UK, or whose country is unknown, see a banner and the pixels load only after they accept. Turn it off and the pixels load for every visitor, and this plugin no longer asks for a banner.
- Consent banner message
- Optional, in the Consent tab. Plain text up to 300 characters, with HTML tags removed. Leave it blank to use the standard message in the visitor's language. The banner appears only while consent is required and at least one pixel is on with a valid ID.
What it can access
The plugin reads your store orders so it can report a paid purchase, and it contacts only Meta's Graph API and TikTok's business API, both from your server. It sends order value, currency, product IDs and quantities, plus an email address that is hashed first, never the plain address. Your access tokens are encrypted when saved and are not returned to the browser. It adds a settings section to the admin area.
Permissions
- Read products and orders
- Make external HTTP requests to: graph.facebook.com, business-api.tiktok.com
Lifecycle hooks
afterOrderCreate
External network access
This plugin makes requests to the following domains:
graph.facebook.combusiness-api.tiktok.com
Capabilities
commerce:readnetwork:fetch
Screenshots

Honest limits
Server-side events cover purchases only. Page views, product views, adds to cart and checkout starts are reported from the visitor's browser, so they are lost when a blocker or a declined consent stops the pixel from loading.
Server-side purchases are matched using a hashed email and the order. The IP address and browser details are not available when the order is fulfilled in the background, so match quality can be lower than for a purchase tracked in the browser.
Duplicate removal works for purchases only, using an event ID built from your order ID in the browser and on the server. After a test order, check Events Manager on each platform to confirm the sale shows once.
The banner's layout and buttons are standard, and its country list covers the EU, EEA and UK. Visitors elsewhere get the pixels straight away. Check that this matches the rules for your own audience. A custom message is plain text, shown as written in every language, so a bilingual site should word it for both.
Only Meta and TikTok are supported. Other ad pixels, such as Pinterest or Snapchat, are not part of this plugin.
Frequently asked questions
Where do I find my pixel ID and access token?
The pixel ID is in Meta Events Manager under Data Sources, or TikTok Events Manager under Assets and Events. The Conversions API token is created in Meta's Conversions API settings, and the Events API token in TikTok's Events API settings.
Will a sale be counted twice if both the browser and the server report it?
No. On both platforms the browser and server reports of a purchase carry the same event ID, built from your order ID, and the platform merges them. Check Events Manager after a test order to be sure.
Is my access token visible after I save it?
No. It is encrypted before it is stored and the settings page shows hidden dots afterwards. Leave the field alone to keep the saved token, or paste a new one to replace it.
Can I check the setup before real traffic arrives?
Yes. Put the test event code from Meta or TikTok into its field and watch the Test Events screen. Remove the code before going live, or the events stay out of your reports.
Related plugins
Specifications
- Category
- Analytics
- Price
- Included
- Version
- 1.0.0
- Source
- First-party
Browse more integrations
58 free first-party integrations available.