For general Meta Pixel concepts, see the Meta Ads overview.
Prerequisites
- Meta Business Suite or Ads Manager account
- Meta Pixel ID (15-16 digit number)
- Weebly paid plan (Personal, Professional, or Performance)
Installation Methods
Method 1: Header Code Injection (Recommended)
- Go to Weebly Editor > Settings > SEO
- In Header Code, paste the Meta Pixel base code:
<!-- 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 Pixel ID - Click Save
- Publish your site
Method 2: Via Google Tag Manager
If using GTM (recommended for flexibility):
- In GTM, create a new Custom HTML tag
- Paste the Meta Pixel code
- Set trigger to All Pages
- Save and publish GTM container
Method 3: Weebly App Center
Some third-party apps offer Meta Pixel integration:
- Search App Center for "Facebook Pixel" or "Meta Pixel"
- Note: App quality varies, verify installation works
Standard Events
PageView (Automatic)
The base code tracks PageView automatically on all pages.
ViewContent (Product Pages)
For Performance plan stores:
<!-- Add after base Meta Pixel code -->
<script>
document.addEventListener('DOMContentLoaded', function() {
var productTitle = document.querySelector('.wsite-com-product-title');
var productPrice = document.querySelector('.wsite-com-product-price');
if (productTitle && productPrice) {
fbq('track', 'ViewContent', {
content_name: productTitle.textContent.trim(),
value: parseFloat(productPrice.textContent.replace(/[^0-9.]/g, '')),
currency: 'USD'
});
}
});
</script>
AddToCart
Track add to cart clicks:
<script>
document.addEventListener('DOMContentLoaded', function() {
document.querySelectorAll('.wsite-com-add-to-cart').forEach(function(btn) {
btn.addEventListener('click', function() {
var productTitle = document.querySelector('.wsite-com-product-title');
var productPrice = document.querySelector('.wsite-com-product-price');
if (productTitle && productPrice) {
fbq('track', 'AddToCart', {
content_name: productTitle.textContent.trim(),
value: parseFloat(productPrice.textContent.replace(/[^0-9.]/g, '')),
currency: 'USD'
});
}
});
});
});
</script>
Lead (Contact Forms)
Track form submissions:
<script>
document.addEventListener('DOMContentLoaded', function() {
document.querySelectorAll('.wsite-form').forEach(function(form) {
form.addEventListener('submit', function() {
fbq('track', 'Lead', {
content_name: 'Contact Form'
});
});
});
});
</script>
Purchase (Confirmation Page)
For order confirmation tracking, add to your thank you page:
<script>
fbq('track', 'Purchase', {
value: ORDER_VALUE,
currency: 'USD'
});
</script>
Note: Dynamic order values require custom implementation or Square's checkout integration.
Verification
Meta Pixel Helper
- Install Meta Pixel Helper Chrome extension
- Visit your Weebly site
- Check the extension icon for pixel status
Events Manager
- Go to Events Manager
- Select your Pixel
- Check Test Events tab
- Visit your site and verify events appear
Diagnostics
In Events Manager:
- Go to Diagnostics tab
- Check for any errors or warnings
- Address issues as needed
Conversion API (CAPI)
For server-side tracking (improved accuracy):
Option 1: Third-Party Integration
- Use services like Stape.io or AddingWell
- Configure server-side GTM
- Requires technical setup
Option 2: Square Integration
- Square (Weebly's parent company) does not currently offer a direct CAPI integration for Weebly sites
- For server-side tracking on Weebly, use a server-side GTM container as described in Option 1
Consent Management
<script>
// Don't fire pixel until consent given
var pixelInitialized = false;
function initPixel() {
if (!pixelInitialized) {
fbq('init', 'YOUR_PIXEL_ID');
fbq('track', 'PageView');
pixelInitialized = true;
}
}
// Call initPixel() when user consents
</script>
Troubleshooting
Pixel Not Firing
- Check Pixel Helper extension
- Verify code is in Header Code (not Footer)
- Confirm paid plan status
- Clear browser cache
- Check for JavaScript errors
Duplicate Events
- Remove any App Center pixel apps if using manual code
- Check for multiple pixel initializations
- Verify code isn't added twice
Events Missing
- Check event code syntax
- Verify DOM selectors match your theme
- Test in browser console
- Use Events Manager Test Events
Best Practices
- Use Aggregated Event Measurement for iOS 14+ tracking
- Verify domain in Business Manager
- Set up Conversions API for improved accuracy
- Test events before running ads
- Configure consent mode for privacy compliance