This guide provides detailed instructions for installing the Taboola Pixel across different platforms and implementation methods.
Prerequisites
Before installing the Taboola Pixel:
- Taboola Ads account created and verified
- Account ID (Pixel ID) obtained from Taboola Backstage
- Website access to add JavaScript code
- Testing environment available (staging site recommended)
Finding Your Account ID
- Log in to Taboola Backstage
- Navigate to Account Settings (gear icon)
- Find Pixel ID or Account ID
- Copy the numeric ID (e.g., 1234567)
Note: Use the Advertiser Account ID, not Publisher ID.
Standard Pixel Installation
Base Pixel Code
The Taboola Pixel consists of two parts: initialization and the loader script.
Complete Implementation:
<script type="text/javascript">
window._tfa = window._tfa || [];
window._tfa.push({notify: 'event', name: 'page_view', id: YOUR_ACCOUNT_ID});
!function (t, f, a, x) {
if (!document.getElementById(x)) {
t.async = 1;t.src = a;t.id=x;f.parentNode.insertBefore(t, f);
}
}(document.createElement('script'),
document.getElementsByTagName('script')[0],
'//cdn.taboola.com/libtrc/unip/YOUR_ACCOUNT_ID/tfa.js',
'tb_tfa_script');
</script>
Replace YOUR_ACCOUNT_ID with your actual account ID:
<!-- Example with account ID 1234567 -->
<script type="text/javascript">
window._tfa = window._tfa || [];
window._tfa.push({notify: 'event', name: 'page_view', id: 1234567});
!function (t, f, a, x) {
if (!document.getElementById(x)) {
t.async = 1;t.src = a;t.id=x;f.parentNode.insertBefore(t, f);
}
}(document.createElement('script'),
document.getElementsByTagName('script')[0],
'//cdn.taboola.com/libtrc/unip/1234567/tfa.js',
'tb_tfa_script');
</script>
Where to Place the Pixel
Recommended Placement:
Place the pixel in the <head> section of every page:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Your Website</title>
<!-- Taboola Pixel -->
<script type="text/javascript">
window._tfa = window._tfa || [];
window._tfa.push({notify: 'event', name: 'page_view', id: 1234567});
!function (t, f, a, x) {
if (!document.getElementById(x)) {
t.async = 1;t.src = a;t.id=x;f.parentNode.insertBefore(t, f);
}
}(document.createElement('script'),
document.getElementsByTagName('script')[0],
'//cdn.taboola.com/libtrc/unip/1234567/tfa.js',
'tb_tfa_script');
</script>
<!-- End Taboola Pixel -->
</head>
<body>
<!-- Your content -->
</body>
</html>
Alternative Placement:
End of <body> section (before closing </body> tag):
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Your Website</title>
</head>
<body>
<!-- Your content -->
<!-- Taboola Pixel -->
<script type="text/javascript">
window._tfa = window._tfa || [];
window._tfa.push({notify: 'event', name: 'page_view', id: 1234567});
!function (t, f, a, x) {
if (!document.getElementById(x)) {
t.async = 1;t.src = a;t.id=x;f.parentNode.insertBefore(t, f);
}
}(document.createElement('script'),
document.getElementsByTagName('script')[0],
'//cdn.taboola.com/libtrc/unip/1234567/tfa.js',
'tb_tfa_script');
</script>
<!-- End Taboola Pixel -->
</body>
</html>
E-commerce Platform Installation
Shopify
Method 1: Using Taboola App
- Go to Shopify App Store
- Search for "Taboola Pixel"
- Click Add app
- Authorize the app
- Enter your Taboola Account ID
- Click Save
Method 2: Manual Installation
- In Shopify admin, go to Online Store > Themes
- Click Actions > Edit code
- Open
theme.liquidfile - Paste pixel code before
</head>tag - Click Save
<!-- Taboola Pixel -->
<script type="text/javascript">
window._tfa = window._tfa || [];
window._tfa.push({notify: 'event', name: 'page_view', id: 1234567});
!function (t, f, a, x) {
if (!document.getElementById(x)) {
t.async = 1;t.src = a;t.id=x;f.parentNode.insertBefore(t, f);
}
}(document.createElement('script'),
document.getElementsByTagName('script')[0],
'//cdn.taboola.com/libtrc/unip/1234567/tfa.js',
'tb_tfa_script');
</script>
WooCommerce (WordPress)
Method 1: Using Plugin
- In WordPress admin, go to Plugins > Add New
- Search for "Taboola Pixel" or "Header Footer Code Manager"
- Install and activate plugin
- Go to plugin settings
- Paste Taboola Pixel code in header section
- Save changes
Method 2: Theme Functions
Add to your theme's functions.php:
function add_taboola_pixel() {
?>
<script type="text/javascript">
window._tfa = window._tfa || [];
window._tfa.push({notify: 'event', name: 'page_view', id: 1234567});
!function (t, f, a, x) {
if (!document.getElementById(x)) {
t.async = 1;t.src = a;t.id=x;f.parentNode.insertBefore(t, f);
}
}(document.createElement('script'),
document.getElementsByTagName('script')[0],
'//cdn.taboola.com/libtrc/unip/1234567/tfa.js',
'tb_tfa_script');
</script>
<?php
}
add_action('wp_head', 'add_taboola_pixel');
Magento
Add to Layout XML:
Create/edit app/design/frontend/[Your_Theme]/Magento_Theme/layout/default_head_blocks.xml:
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<script src="//cdn.taboola.com/libtrc/unip/1234567/tfa.js" async="async"/>
</head>
</page>
Add Initialization:
Create app/design/frontend/[Your_Theme]/Magento_Theme/templates/taboola/pixel.phtml:
<script type="text/javascript">
window._tfa = window._tfa || [];
window._tfa.push({notify: 'event', name: 'page_view', id: 1234567});
</script>
BigCommerce
- In BigCommerce admin, go to Storefront > Script Manager
- Click Create a Script
- Fill in details:
- Name: Taboola Pixel
- Location: Head
- Select pages: All pages
- Script type: Script
- Paste Taboola Pixel code
- Click Save
Tag Manager Installation
Google Tag Manager
Step 1: Create Custom HTML Tag
- In GTM, go to Tags > New
- Click Tag Configuration
- Select Custom HTML
- Paste Taboola Pixel code:
<script type="text/javascript">
window._tfa = window._tfa || [];
window._tfa.push({notify: 'event', name: 'page_view', id: {{Taboola Account ID}}});
!function (t, f, a, x) {
if (!document.getElementById(x)) {
t.async = 1;t.src = a;t.id=x;f.parentNode.insertBefore(t, f);
}
}(document.createElement('script'),
document.getElementsByTagName('script')[0],
'//cdn.taboola.com/libtrc/unip/{{Taboola Account ID}}/tfa.js',
'tb_tfa_script');
</script>
Step 2: Create Account ID Variable
- Go to Variables > User-Defined Variables > New
- Select Constant
- Name:
Taboola Account ID - Value: Your account ID (e.g., 1234567)
- Save
Step 3: Set Up Trigger
- In tag configuration, click Triggering
- Select All Pages trigger
- Save tag
Step 4: Test and Publish
- Click Preview to test
- Navigate to your website
- Verify Taboola tag fires on all pages
- Click Submit to publish
Adobe Launch (Adobe Experience Platform Tags)
Step 1: Create Rule
- In Launch, go to Rules > Create New Rule
- Name:
Taboola Pixel - All Pages
Step 2: Add Event
- Under Events, click Add
- Extension: Core
- Event Type: Library Loaded (Page Top)
- Save
Step 3: Add Action
- Under Actions, click Add
- Extension: Core
- Action Type: Custom Code
- Click Open Editor
- Paste Taboola Pixel code
- Save
Step 4: Publish
- Save rule
- Add to library
- Publish to production
Tealium
Step 1: Add Tag
- In Tealium, go to Tags > Add Tag
- Select Custom Container
- Name:
Taboola Pixel
Step 2: Configure Tag
- In Tag Configuration, paste Taboola Pixel code
- Set Load Rules to fire on all pages
- Save tag
Step 3: Publish
- Save configuration
- Publish to production environment
Single Page Application (SPA) Installation
For React, Vue, Angular, and other SPAs:
React Implementation
// TaboolaPixel.js
import { useEffect } from 'react';
const TaboolaPixel = ({ accountId }) => {
useEffect(() => {
// Initialize Taboola pixel array
window._tfa = window._tfa || [];
// Load Taboola script
if (!document.getElementById('tb_tfa_script')) {
const script = document.createElement('script');
script.id = 'tb_tfa_script';
script.src = `//cdn.taboola.com/libtrc/unip/${accountId}/tfa.js`;
script.async = true;
document.head.appendChild(script);
}
}, [accountId]);
return null;
};
export default TaboolaPixel;
// App.js
import TaboolaPixel from './TaboolaPixel';
function App() {
return (
<>
<TaboolaPixel accountId={1234567} />
{/* Your app content */}
</>
);
}
Track Route Changes:
// useTaboolaPageView.js
import { useEffect } from 'react';
import { useLocation } from 'react-router-dom';
const useTaboolaPageView = (accountId) => {
const location = useLocation();
useEffect(() => {
window._tfa = window._tfa || [];
window._tfa.push({
notify: 'event',
name: 'page_view',
id: accountId
});
}, [location, accountId]);
};
export default useTaboolaPageView;
// In your component
import useTaboolaPageView from './useTaboolaPageView';
function App() {
useTaboolaPageView(1234567);
return (
<div>Your app</div>
);
}
Vue.js Implementation
// plugins/taboola.js
export default {
install(app, options) {
const accountId = options.accountId;
// Load Taboola script
if (!document.getElementById('tb_tfa_script')) {
window._tfa = window._tfa || [];
const script = document.createElement('script');
script.id = 'tb_tfa_script';
script.src = `//cdn.taboola.com/libtrc/unip/${accountId}/tfa.js`;
script.async = true;
document.head.appendChild(script);
}
// Add global method for tracking
app.config.globalProperties.$taboola = {
track(eventName, params = {}) {
window._tfa.push({
notify: 'event',
name: eventName,
id: accountId,
...params
});
}
};
}
};
// main.js
import { createApp } from 'vue';
import App from './App.vue';
import TaboolaPlugin from './plugins/taboola';
const app = createApp(App);
app.use(TaboolaPlugin, { accountId: 1234567 });
app.mount('#app');
// Track page views in router
router.afterEach(() => {
window._tfa.push({
notify: 'event',
name: 'page_view',
id: 1234567
});
});
Angular Implementation
// taboola.service.ts
import { Injectable } from '@angular/core';
declare global {
interface Window {
_tfa: any[];
}
}
@Injectable({
providedIn: 'root'
})
export class TaboolaService {
private accountId: number = 1234567;
private scriptLoaded = false;
constructor() {
this.loadScript();
}
private loadScript(): void {
if (this.scriptLoaded) return;
window._tfa = window._tfa || [];
const script = document.createElement('script');
script.id = 'tb_tfa_script';
script.src = `//cdn.taboola.com/libtrc/unip/${this.accountId}/tfa.js`;
script.async = true;
document.head.appendChild(script);
this.scriptLoaded = true;
}
trackPageView(): void {
window._tfa.push({
notify: 'event',
name: 'page_view',
id: this.accountId
});
}
trackEvent(eventName: string, params: any = {}): void {
window._tfa.push({
notify: 'event',
name: eventName,
id: this.accountId,
...params
});
}
}
// app.component.ts
import { Component } from '@angular/core';
import { Router, NavigationEnd } from '@angular/router';
import { TaboolaService } from './taboola.service';
@Component({
selector: 'app-root',
templateUrl: './app.component.html'
})
export class AppComponent {
constructor(
private router: Router,
private taboola: TaboolaService
) {
this.router.events.subscribe(event => {
if (event instanceof NavigationEnd) {
this.taboola.trackPageView();
}
});
}
}
Verification
Check Pixel Installation
Method 1: Browser Console
// Open browser console (F12)
// Check if pixel is loaded
console.log(window._tfa);
// Should show array of events
// If undefined, pixel is not loaded
Method 2: Network Tab
- Open browser DevTools (F12)
- Go to Network tab
- Reload page
- Filter by "taboola"
- Look for:
tfa.js(pixel script)- Requests to
trc.taboola.com
Method 3: Taboola Pixel Helper
- Install Taboola Pixel Helper browser extension
- Navigate to your website
- Click extension icon
- Verify pixel is detected and firing
Test Events
// Manually fire test event in console
window._tfa.push({
notify: 'event',
name: 'page_view',
id: 1234567
});
// Check Network tab for tracking request
Verify in Taboola Backstage
- Log in to Taboola Backstage
- Navigate to Tracking > Pixel
- Check Pixel Activity section
- Verify recent page views are recorded
- May take up to 24 hours for data to appear
Common Installation Issues
Pixel Not Loading
Issue: window._tfa is undefined
Solutions:
- Verify account ID is correct
- Check for JavaScript errors
- Ensure script is not blocked by ad blockers
- Verify Content Security Policy allows Taboola
Multiple Pixels
Issue: Duplicate events or multiple pixel scripts
Solutions:
- Check for multiple pixel implementations
- Remove duplicates
- Ensure pixel loads only once per page
Script Blocked
Issue: Pixel blocked by Content Security Policy
Solution: Add Taboola domains to CSP:
<meta http-equiv="Content-Security-Policy"
content="script-src 'self' 'unsafe-inline' cdn.taboola.com trc.taboola.com">
Best Practices
- Install on All Pages - Place pixel on every page for complete tracking
- Use Async Loading - Always load pixel asynchronously
- Test Before Production - Verify in staging environment first
- Single Installation - Install pixel only once per page
- Monitor Performance - Check pixel doesn't impact page load times
- Document Installation - Keep record of where and how pixel is installed
Next Steps
- Event Tracking - Implement conversion events
- Data Layer Setup - Configure event parameters
- Troubleshooting - Resolve pixel issues