Learn how to install Meta Pixel (formerly Facebook Pixel) on your Site123 website for Facebook and Instagram ads tracking.
Installation Methods
| Method | Difficulty | Customization | Recommended For |
|---|---|---|---|
| Direct Code Injection | Easy | Medium | Quick setup |
| Google Tag Manager | Medium | High | Best practice |
Method 1: Direct Code Injection
Install Meta Pixel directly into Site123's code injection system.
Step 1: Get Your Pixel ID
Go to Meta Events Manager
Select or Create Pixel
- If you have a Pixel: Select it from the list
- If not: Click Add Events → From a New Website → Meta Pixel
Copy Pixel ID
- Your Pixel ID is a 15-16 digit number
- Format:
1234567890123456
Step 2: Add Meta Pixel to Site123
Log in to Site123 Dashboard
Navigate to Code Injection
- Click Manage in top menu
- Go to Settings → Advanced Settings
- Select Code Injection or Custom Code
Add Meta Pixel Code to Head Section
In the Head Code section, paste:
<!-- Meta Pixel Code --> <script> !function(f,b,e,v,n,t,s) {if(f.fbq)return;n=f.fbq=function(){n.callMethod? n.callMethod.apply(n,arguments):n.queue.push(arguments)}; if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0'; n.queue=[];t=b.createElement(e);t.async=!0; t.src=v;s=b.getElementsByTagName(e)[0]; s.parentNode.insertBefore(t,s)}(window, document,'script', 'https://connect.facebook.net/en_US/fbevents.js'); fbq('init', 'YOUR_PIXEL_ID'); fbq('track', 'PageView'); </script> <noscript> <img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=YOUR_PIXEL_ID&ev=PageView&noscript=1"/> </noscript> <!-- End Meta Pixel Code -->Replace
YOUR_PIXEL_IDwith your actual 15-16 digit Pixel ID.Save Changes
Click Save or Update to apply the code to your website.
Step 3: Enable Advanced Matching (Recommended)
Advanced matching sends hashed customer data for better ad targeting:
Replace the basic init code with:
<script>
fbq('init', 'YOUR_PIXEL_ID', {
em: '', // Will be populated if available
fn: '',
ln: '',
ph: '',
external_id: ''
});
fbq('track', 'PageView');
</script>
Note: Site123 doesn't provide automatic access to user data. Advanced matching works best with GTM or custom form integrations.
Step 4: Verify Installation
Install Meta Pixel Helper
- Download Meta Pixel Helper Chrome extension
Visit Your Site
- Open your Site123 website
- The Pixel Helper icon should turn blue with a number
Check Pixel Status
- Click the Pixel Helper icon
- Green checkmark = Working correctly
- Yellow warning = Review warnings
- Red error = Fix required
Verify in Events Manager
- Go to Meta Events Manager
- Click Test Events
- Enter your website URL
- Navigate your site and watch events appear
Method 2: Google Tag Manager (Recommended)
Using GTM provides better event management and easier updates.
Prerequisites
- GTM installed on Site123
- Meta Pixel ID
Step 1: Create Meta Pixel Base Tag
In GTM, go to Tags → New
Paste Meta Pixel Code:
<script> !function(f,b,e,v,n,t,s) {if(f.fbq)return;n=f.fbq=function(){n.callMethod? n.callMethod.apply(n,arguments):n.queue.push(arguments)}; if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0'; n.queue=[];t=b.createElement(e);t.async=!0; t.src=v;s=b.getElementsByTagName(e)[0]; s.parentNode.insertBefore(t,s)}(window, document,'script', 'https://connect.facebook.net/en_US/fbevents.js'); fbq('init', 'YOUR_PIXEL_ID'); fbq('track', 'PageView'); </script>Replace
YOUR_PIXEL_IDwith your actual Pixel ID.Triggering: Select All Pages
Tag Sequencing (optional):
- Advanced Settings → Tag Sequencing
- Fire this tag before other Meta event tags
Name:
Meta Pixel - Base CodeSave
Step 2: Create Event Tags
See event tracking section below for specific event implementations.
Step 3: Test and Publish
Use GTM Preview Mode
- Click Preview in GTM
- Enter your Site123 URL
- Verify Meta Pixel base tag fires on all pages
Check with Pixel Helper
- Visit your site with Preview active
- Pixel Helper should show PageView event
Publish Container
- Click Submit
- Add version name
- Click Publish
Standard Event Tracking
Track common Meta Pixel events.
ViewContent Event
Track when users view important content or specific pages.
Direct Code (add to specific pages via page-specific code injection):
<script>
fbq('track', 'ViewContent', {
content_name: 'Page Name',
content_category: 'Services', // or 'Blog', 'About', etc.
content_type: 'page'
});
</script>
GTM Method:
- Create Page View trigger for specific pages
- Create Custom HTML tag with ViewContent event
- Assign trigger and publish
Lead Event
Track form submissions and lead generation.
Site123 Contact Form:
<script>
document.addEventListener('DOMContentLoaded', function() {
const forms = document.querySelectorAll('form');
forms.forEach(function(form) {
form.addEventListener('submit', function(e) {
fbq('track', 'Lead', {
content_name: 'Contact Form',
content_category: 'Lead Generation'
});
});
});
});
</script>
Add this to Site123's Body Code or Footer Code section.
GTM Method:
- Create Form Submission trigger
- Create Custom HTML tag:
<script> fbq('track', 'Lead', { content_name: 'Contact Form' }); </script> - Assign Form Submission trigger
- Publish
Contact Event
Track when users initiate contact (phone, email).
Phone Click Tracking:
<script>
document.addEventListener('DOMContentLoaded', function() {
const phoneLinks = document.querySelectorAll('a[href^="tel:"]');
phoneLinks.forEach(function(link) {
link.addEventListener('click', function() {
fbq('track', 'Contact', {
contact_type: 'phone'
});
});
});
});
</script>
Email Click Tracking:
<script>
document.addEventListener('DOMContentLoaded', function() {
const emailLinks = document.querySelectorAll('a[href^="mailto:"]');
emailLinks.forEach(function(link) {
link.addEventListener('click', function() {
fbq('track', 'Contact', {
contact_type: 'email'
});
});
});
});
</script>
CompleteRegistration Event
Track user signups or account creations (if applicable).
<script>
fbq('track', 'CompleteRegistration', {
status: 'completed'
});
</script>
Add to your signup confirmation page using page-specific code injection.
Ecommerce Events (Site123 Store)
If using Site123's ecommerce features:
ViewContent (Product Page)
<script>
fbq('track', 'ViewContent', {
content_ids: ['PRODUCT_SKU'],
content_name: 'Product Name',
content_type: 'product',
value: 99.99,
currency: 'USD'
});
</script>
Add to product pages using page-specific code injection.
AddToCart Event
<script>
document.addEventListener('DOMContentLoaded', function() {
const addToCartButtons = document.querySelectorAll('.add-to-cart-btn');
addToCartButtons.forEach(function(button) {
button.addEventListener('click', function() {
// Extract product data from page
const productName = document.querySelector('.product-name')?.textContent;
const productPrice = parseFloat(
document.querySelector('.product-price')?.textContent.replace(/[^0-9.]/g, '')
);
fbq('track', 'AddToCart', {
content_name: productName,
content_type: 'product',
value: productPrice,
currency: 'USD'
});
});
});
});
</script>
InitiateCheckout Event
<script>
fbq('track', 'InitiateCheckout', {
content_type: 'product',
value: 99.99, // Cart total
currency: 'USD',
num_items: 2
});
</script>
Add to cart page or when checkout button is clicked.
Purchase Event
Add to order confirmation/thank you page:
<script>
fbq('track', 'Purchase', {
content_type: 'product',
value: 99.99,
currency: 'USD',
content_ids: ['SKU1', 'SKU2'],
num_items: 2
});
</script>
Important: Only fire this once per order using page-specific code injection on the thank you page.
Custom Events
Track site-specific interactions.
Button Click Tracking
<script>
document.addEventListener('DOMContentLoaded', function() {
const ctaButtons = document.querySelectorAll('.cta-button, .get-quote-btn');
ctaButtons.forEach(function(button) {
button.addEventListener('click', function() {
fbq('trackCustom', 'CTAClick', {
button_text: this.textContent,
page_location: window.location.pathname
});
});
});
});
</script>
Download Tracking
<script>
document.addEventListener('DOMContentLoaded', function() {
const downloadLinks = document.querySelectorAll('a[href$=".pdf"], a[href$=".doc"], a[href$=".zip"]');
downloadLinks.forEach(function(link) {
link.addEventListener('click', function() {
const fileName = this.getAttribute('href').split('/').pop();
fbq('trackCustom', 'FileDownload', {
file_name: fileName,
page_location: window.location.pathname
});
});
});
});
</script>
Video Play Tracking
<script>
document.addEventListener('DOMContentLoaded', function() {
const videos = document.querySelectorAll('video');
videos.forEach(function(video) {
video.addEventListener('play', function() {
fbq('trackCustom', 'VideoPlay', {
video_title: this.title || 'Untitled',
page_location: window.location.pathname
});
});
});
});
</script>
Privacy & Consent
GDPR Compliance
Implement consent before loading Meta Pixel:
<script>
// Wait for user consent
document.addEventListener('cookieConsentGranted', function() {
// Load Meta Pixel only after consent
!function(f,b,e,v,n,t,s)
{if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};
if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];
s.parentNode.insertBefore(t,s)}(window, document,'script',
'https://connect.facebook.net/en_US/fbevents.js');
fbq('init', 'YOUR_PIXEL_ID');
fbq('track', 'PageView');
});
</script>
Limited Data Use (CCPA)
For California visitors:
fbq('dataProcessingOptions', ['LDU'], 1, 1000); // California
Or disable for all:
fbq('dataProcessingOptions', []);
Testing & Verification
1. Meta Pixel Helper
- Install: Chrome Web Store
- Green icon: Pixel working
- Yellow: Warnings to review
- Red: Errors to fix
2. Meta Events Manager
Test Events Tool:
- Go to Events Manager
- Select your Pixel
- Click Test Events
- Enter your Site123 URL
- Navigate your site
- Watch events appear in real-time
Check Event Quality:
- Events appear within seconds
- Parameters are correct (value, currency, etc.)
- No duplicate events
- Event names match standard or custom events
3. Browser Console
Check Pixel loaded:
console.log(window.fbq);
// Should show function
Monitor Pixel calls:
// Open browser console, then interact with site
// You'll see fbq() calls logged
Troubleshooting
Pixel Not Loading
Symptoms: Pixel Helper shows no pixel
Fixes:
- Verify Pixel ID is correct (15-16 digits)
- Check code injection saved in Site123
- Clear browser cache, test in incognito
- Disable ad blockers for testing
- Check browser console for errors
- Verify Site123 site is published
Duplicate Events
Cause: Pixel installed in multiple locations
Fix:
- Check Site123 code injection (head, body, footer)
- If using GTM, remove direct pixel code
- Search all code areas for
fbq('init' - Keep only ONE implementation
Events Not Tracking
Symptoms: PageView works, but custom events don't
Fixes:
- Verify event code runs after base pixel
- Check element selectors are correct
- Ensure event code is inside DOMContentLoaded
- Test event manually in browser console:
fbq('track', 'Lead'); - Check Events Manager for the event
Purchase Event Fires Multiple Times
Cause: Purchase code on page that's revisited
Fix:
- Only add purchase code to thank you page
- Use page-specific code injection, not global
- Consider using sessionStorage to prevent duplicates:
if (!sessionStorage.getItem('purchase_tracked_' + ORDER_ID)) { fbq('track', 'Purchase', {...}); sessionStorage.setItem('purchase_tracked_' + ORDER_ID, 'true'); }
Mobile Tracking Issues
Symptoms: Works on desktop, not mobile
Fixes:
- Test on actual mobile device
- Check mobile browser console for errors
- Verify scripts load on mobile (Network tab)
- Ensure Site123 mobile version has same code
Advanced Features
Server-Side Events (Conversions API)
For better iOS 14+ tracking and ad blocker bypass, implement Conversions API.
Options:
- Use Meta's Conversions API Gateway (requires Plus plan)
- Implement custom server-side tracking
- Use third-party tools (e.g., Zapier, Segment)
Note: Server-side implementation requires development work beyond Site123's capabilities.
Multi-Language Sites
Track language in events:
const siteLang = document.documentElement.lang || 'en';
fbq('track', 'Lead', {
content_name: 'Contact Form',
language: siteLang
});
Best Practices
- Use Standard Events when possible (ViewContent, Lead, Purchase, etc.)
- Add Custom Events for site-specific actions (CTAClick, etc.)
- Always include value and currency for ecommerce events
- Implement consent management for GDPR/CCPA compliance
- Test thoroughly before launching ad campaigns
- Monitor event quality in Events Manager regularly
- Use GTM for easier management of multiple events
Next Steps
- Install GTM - For easier tag management
- Install GA4 - Track website analytics
- Troubleshoot Tracking - Debug issues
For general Meta Pixel concepts, see Meta Pixel Guide.