Add the TikTok Pixel to Joomla
You're paying for TikTok Ads that send people to your Joomla site, and then the data stops. TikTok can tell you how many people clicked, but not how many bought, signed up, or came back.
Without that feedback the algorithm has nothing to optimize against, and your budget goes to the cheapest clicks instead of the best customers. The TikTok Pixel fixes that, and adding it to Joomla doesn't have to mean another plugin. You can add the TikTok Pixel to your Joomla site using Tassos Code Snippets.
What is the TikTok Pixel
The TikTok Pixel is a small JavaScript tracker that reports website activity back to TikTok. It measures conversions from your ads, builds custom and retargeting audiences, and feeds TikTok the signals it uses to optimise campaign delivery.
How to get the TikTok Pixel
You need a TikTok Ads Manager account.
- Go to TikTok Ads Manager and sign in.
- Open Tools → Events.
- Under Web Events, click Manage and then Set Up Web Events.
- Choose TikTok Pixel and then Manually install pixel code.
- Copy the pixel code, or note your Pixel ID, the string passed to
ttq.load().
How to Add the TikTok Pixel to Joomla
- Install Tassos Code Snippets if it isn't installed already.
- Go to Joomla Administrator.
- Open Components → Tassos Code Snippets.
- Click New.
- Give your snippet a descriptive title like "TikTok Pixel".
- Select HTML snippet type.
- Paste the following code, replacing YOUR_PIXEL_ID with your actual Pixel ID:
<script> !function (w, d, t) { w.TiktokAnalyticsObject=t;var ttq=w[t]=w[t]||[];ttq.methods=["page","track","identify","instances","debug","on","off","once","ready","alias","group","enableCookie","disableCookie"],ttq.setAndDefer=function(t,e){t[e]=function(){t.push([e].concat(Array.prototype.slice.call(arguments,0)))}};for(var i=0;i<ttq.methods.length;i++)ttq.setAndDefer(ttq,ttq.methods[i]);ttq.instance=function(t){for(var e=ttq._i[t]||[],n=0;n<ttq.methods.length;n++)ttq.setAndDefer(e,ttq.methods[n]);return e},ttq.load=function(e,n){var i="https://analytics.tiktok.com/i18n/pixel/events.js";ttq._i=ttq._i||{},ttq._i[e]=[],ttq._i[e]._u=i,ttq._t=ttq._t||{},ttq._t[e]=+new Date,ttq._o=ttq._o||{},ttq._o[e]=n||{};var o=document.createElement("script");o.type="text/javascript",o.async=!0,o.src=i+"?sdkid="+e+"&lib="+t;var a=document.getElementsByTagName("script")[0];a.parentNode.insertBefore(o,a)}; ttq.load('YOUR_PIXEL_ID'); ttq.page(); }(window, document, 'ttq'); </script> - Select Site Header as the "Insertion Method".
- Publish the snippet.
- Optionally, open the Conditional Logic tab to restrict which pages the snippet runs on. Leave it empty to run it site-wide. Learn more in Using Conditional Logic.
Congrats! You've successfully added the TikTok Pixel to your Joomla site without installing another plugin.
Track a Conversion Event
The base pixel reports page views. To report a specific action, such as a purchase or a form submission, add a second snippet that fires only on that page.
- Create a new snippet and select JS as the snippet type.
- Paste the event code, adjusting the values to your own:
ttq.track('CompletePayment', { value: 99.99, currency: 'EUR' }); - Select Site Footer as the "Insertion Method" so the event fires after the base pixel has loaded.
- Open the Conditional Logic tab and limit the snippet to your order confirmation page. This step matters: without it, the event fires on every page.
- Publish the snippet.
TikTok optimizes best for its standard event names, such as CompletePayment, AddToCart, ViewContent, SubmitForm, Contact, and CompleteRegistration. Use the same pattern for each one.
Verify it Works
Install the TikTok Pixel Helper extension for Chrome, then visit your site. The extension shows the pixel firing and lists the events it picked up.
You can also open Tools → Events → Test Event in TikTok Ads Manager and browse your site to watch events arrive in real time. If nothing shows up, confirm the snippet is published and set to Site Header, check the Pixel ID, and disable any ad blocker in your test browser.
For more information about snippet types and insertion methods, visit our documentation: https://www.tassos.gr/docs/tassos-code-snippets/