Meta (Facebook) Pixel Settings
This document explains how to configure Meta Pixel tracking via GTM.
Container File
Download the Meta Pixel container file and import it into GTM:
Container Import
Follow the steps on the Analytics & Tagging page to import the container.
1. Getting Your Meta Pixel ID
Step 1: Sign in to Meta Events Manager
Go to business.facebook.com/events_manager.
Step 2: Find the Pixel ID
- Click Data Sources in the left menu
- Select your Pixel
- Go to the Settings tab
- Copy the Pixel ID value
![]()
Pixel ID Format
The Pixel ID consists of numbers only. Example: 708154956804907
2. Updating the Meta Pixel ID in GTM
Step 1: Navigate to Variables
- Click Variables in the left menu
- Under User-Defined Variables, click Meta Pixel ID
![]()
Step 2: Update the Pixel ID
- Replace the
XXXXXXXXXXXXXXXXXvalue in the Value field with your own Pixel ID - Click Save
![]()
3. Testing
GTM Preview Mode
- Click Preview in GTM
- Open your site and perform test actions
- Check that Meta Pixel tags are firing in the GTM Debug panel
Meta Pixel Helper (Chrome Extension)
- Install the Meta Pixel Helper extension
- Visit your site
- Click the extension icon to verify events are being sent correctly
Meta Events Manager
- Go to Events Manager > Select your Pixel
- Go to the Test Events tab
- Enter your site URL and run tests
- Confirm that events are coming through
4. Publishing
After a successful test:
- Click Submit in GTM
- Enter a version name (e.g. "Meta Pixel Setup")
- Click Publish
Tracked Events
| GTM Event | Meta Pixel Event | Description |
|---|---|---|
page_view | PageView | Page view (automatic) |
view_item | ViewContent | Product detail view |
view_item_list | ViewContent | Category/list view |
add_to_cart | AddToCart | Add to cart |
begin_checkout | InitiateCheckout | Begin checkout |
add_payment_info | AddPaymentInfo | Add payment info |
purchase | Purchase | Purchase |
search | Search | Search |
sign_up | CompleteRegistration | Registration complete |
generate_lead | Lead | Lead generation |
add_to_wishlist | AddToWishlist | Add to wishlist |
Sent Parameters
Purchase Event Example
fbq('track', 'Purchase', {
content_ids: ['SKU123', 'SKU456'],
content_type: 'product',
contents: [
{id: 'SKU123', quantity: 2, item_price: 99.90},
{id: 'SKU456', quantity: 1, item_price: 149.90}
],
num_items: 3,
value: 349.70,
currency: 'TRY',
order_id: '1001234'
});
Using with Facebook CAPI
Facebook Conversions API (CAPI) is already running on the backend. When Meta Pixel (client-side) and CAPI (server-side) are used together:
- Event Deduplication:
event_idis used to prevent the same event from being counted twice - Better Matching: Browser and server data are combined for more accurate attribution
- iOS 14+ Compliance: CAPI helps bypass iOS tracking restrictions
Recommended Setup
Both Pixel and CAPI should be active. The system automatically handles event deduplication.
Troubleshooting
Pixel Helper "No Pixel Found" error
- Make sure the Pixel ID was entered correctly
- Make sure GTM has been published
- Refresh the page
Events showing as duplicates
- Tag Firing Option should be set to "Once per event"
- Make sure the same event_id is used for both CAPI and Pixel
"Pixel did not load" error
- Make sure ad blockers are disabled
- Check for JavaScript errors in the browser console
Values appear incorrect
- Check in GTM Preview that the
ecommerce.valueandecommerce.currencyvariables are working correctly - Verify that correct data is being sent in the dataLayer