We set up a fresh Meta Pixel for pulsetechagency.com on 22 November 2026. The first PageView reached Events Manager about six minutes after we clicked Create. This guide walks through that exact Meta Pixel setup with our own screenshots: creating the dataset, adding the base code in WordPress and Google Tag Manager, testing it, and switching on the Conversions API. You’ll also see the two places Meta stopped us, plus the tracking choices that matter for Pakistani businesses that sell on cash on delivery or take leads on WhatsApp. Two short videos of the whole process are at the end.
Written by Iqra Sabir, Founder & CEO of Pulse Tech Agency. Last updated: 22 November 2026.
Contents
- What the Meta Pixel does
- Pixel vs Conversions API: do you need both?
- Before you start: the business portfolio check
- Step 1: Create the pixel (dataset) in Events Manager
- Step 2: Add the base code to your website
- Step 3: Test the pixel with Test Events
- Step 4: Add the events that matter to you
- Step 5: Turn on the Conversions API
- Tracking COD orders and WhatsApp leads in Pakistan
- Why your pixel might not be firing
- Video walkthrough
- FAQ
What the Meta Pixel does
The Meta Pixel is a small piece of JavaScript that sits on every page of your site. When someone visits, it tells Meta what happened: a page view, a form fill, an add to cart, a purchase. Meta uses that data in three ways.
It reports conversions in Ads Manager, so you can see which ads produced leads or sales. It builds audiences, such as people who visited your pricing page in the last 30 days. And it trains delivery, because a campaign set to optimise for Leads can only find more leads if the pixel tells it who converted.
Inside Events Manager you’ll now see the word “dataset” where older guides say “pixel”. They’re the same thing for a website. Your Pixel ID is the dataset ID.
Pixel vs Conversions API: do you need both?
Yes, for most businesses that run ads every month. The pixel sends events from the visitor’s browser. The Conversions API (CAPI) sends the same events from a server. Browsers block or drop some pixel events, and the server copy fills that gap.
Meta pushes this hard inside its own tools. While we were setting ours up, Events Manager showed a “Median 17.8% lower cost per result” estimate for connecting the Conversions API, labelled as based on modelling. Treat that as Meta’s estimate, since your own result will depend on your site and traffic.
| Meta Pixel | Conversions API | |
|---|---|---|
| Where it runs | Visitor’s browser | Your server or a partner tool |
| Setup effort | Paste one code snippet | Partner integration or developer work |
| Affected by ad blockers | Yes | No |
| Needed for audiences | Yes | Helps match more people |
What if the same event arrives both ways? Meta keeps one copy when the event name and event ID match and both arrive within 48 hours, according to Meta’s deduplication guide.
Before you start: the business portfolio check
This is where our first attempt failed. We opened Events Manager from an ad account that wasn’t inside a business portfolio, clicked Connect data, and Meta showed “Business portfolio needed to connect a new data source”. The Next button stayed grey. If you don’t have a portfolio yet, follow our Facebook Business Manager setup guide first.

So check two things first:
- You’re inside the right business portfolio. The name shows at the top right of Events Manager. Ours reads Pulse Tech Agency.
- Your Facebook profile is verified for that portfolio. A second portfolio on another profile asked us to “Verify account” before it would open at all, and only the account owner can finish that step.
If your ad account has no portfolio yet, our guide to Meta Ads basics covers how the account, page and portfolio fit together.
Step 1: Create the pixel (dataset) in Events Manager
- Go to Events Manager and click Connect data in the left menu.
- Choose Web and click Next.
- Click Create new dataset.
- Type a name. We used “Pulse Tech Agency Pixel”. Use your business name so nobody confuses it later with an old personal pixel.
- Leave the categories empty unless one clearly fits. Then click Create.

Two boxes come pre-ticked, so read them before you click.
The first connects every dataset in the portfolio to the Conversions API through Meta’s own integration. We kept it on, since we want CAPI anyway, and Meta says you can turn it off later in Business Manager.
The second, on the next screen, is Automatic events. It lets Meta’s AI add standard events it finds on your site, such as button clicks. We left it on for now and will review what it adds after a week of data.
Clicking Create also means you accept the Meta Business Tools Terms. If you’re setting this up for a client, get their go-ahead first.
Step 2: Add the base code to your website
Meta then asks how you want to install the pixel. You get three options: add the code yourself, send instructions to a developer, or set up with a partner such as Shopify or WordPress. We picked “Add Meta Pixel code to your website yourself”, which Meta marked as Recommended for our setup.
Meta shows the base code with a Copy code button. It goes between the <head> and </head> tags on every page.
You have two clean ways to do that on WordPress, and we tried both on our own site. Pick one. Running the same pixel through both will count every PageView twice.
Option A: paste it in a header plugin
Our site already had WPCode (Insert Headers and Footers) installed, so we used that first:
- In the left WordPress menu, hover over Code Snippets and pick Header & Footer.
- Scroll to the Header box. Our GTM snippet was already sitting there, so we pasted the pixel code on the line under it.
- Hit Save Changes at the top right.
- Purge the cache. We’re on LiteSpeed, and WPCode shows a reminder about this the moment you save.

Option B: add it through Google Tag Manager (what we use now)
Since every other tag on our site already lives in Google Tag Manager, we moved the pixel there about 15 minutes later. One place for all tags is easier to audit. Here is the exact setup:
- In your GTM workspace, click Add tag (or Tags, then New).
- Name the tag. Ours is “Meta Pixel – Base Code”.
- Click Tag Configuration and choose Custom HTML. Paste the full base code from Events Manager.
- Under Triggering, choose All Pages.
- Click Save, then Submit and Publish. GTM filled in the version name for us: “Add Meta Pixel – Base Code tag”.
- Remove the code from the header plugin if you added it there before, then purge the cache.

GTM also lists a community “Meta Pixel” template in the tag gallery. Custom HTML keeps the exact code Meta gives you, so nothing gets lost between Meta’s version and a third-party template.
The base code you paste looks like this, with your own ID in two places:
fbq('init', 'YOUR_PIXEL_ID');
fbq('track', 'PageView');Using Shopify? Skip the code and connect the pixel from your Shopify admin through the Facebook and Instagram sales channel.
On the last screen Meta offers Automatic Advanced Matching. Turning it on lets the pixel send details such as email and phone number from your forms, hashed in the visitor’s browser before they reach Meta. This helps Meta match more conversions to real accounts. We turned it on for our contact forms.
Step 3: Test the pixel with Test Events
Don’t assume the pixel works because you pasted it. Test it.
- Open your dataset in Events Manager and go to the Test events tab.
- Choose Website as the channel.
- Open “Confirm your website’s events are set up correctly”, enter your URL and click Test Events. Your site opens in a new tab.
- Click around the site for a minute, then come back to Events Manager.
We ran this test twice. The first PageView came from the WPCode version. After the move to GTM we cleared the session and tested again, and one PageView arrived at 3:48 PM, marked Processed, received from Browser. One event per page load means nothing is firing twice.

Keep the Test events page open while you test. Meta says test behaviour can differ from live traffic, and the Overview tab can take up to 30 minutes to show activity. You can also install the Meta Pixel Helper extension for Chrome, which shows a green tick on any page where your pixel fires.
Step 4: Add the events that matter to you
PageView alone tells Meta who visited. It doesn’t tell Meta who became a customer. For that you need standard events. These are the ones we use most for service businesses and online stores in Pakistan:
| Standard event | When to fire it | Good for |
|---|---|---|
| Lead | A form is submitted successfully | Agencies, clinics, real estate, education |
| Contact | Someone taps call, WhatsApp or email | Any business that sells over the phone |
| Schedule | An appointment is booked | Clinics, salons, consultants |
| ViewContent | A product or service page loads | Retargeting audiences |
| AddToCart | A product is added to the cart | Online stores |
| InitiateCheckout | Checkout starts | Online stores |
| Purchase | The order confirmation page loads | Online stores |
The full list, with the parameters each event accepts, is in Meta’s standard events reference. For Purchase, always send value and currency, because Meta needs them to report return on ad spend. Use PKR as the currency if you price in rupees.
Fire each event on the step where the action is actually complete. A Purchase that fires on the product page will report sales you never made, and Meta will then optimise toward the wrong people.
Step 5: Turn on the Conversions API
Once the pixel works, Events Manager prompts you to add the Conversions API. On our dataset it suggested Set up with partner integration as the recommended route, tagged code-free, low cost and low maintenance.

Which route fits depends on your site:
- Shopify: connect through the Facebook and Instagram channel and pick the maximum data sharing level. CAPI comes with it.
- WooCommerce: use Meta’s official integration from the WordPress plugin directory and connect it to the same dataset.
- Any other site: use the Conversions API Gateway from Events Manager settings, or have a developer send events from your server with the same event names and event IDs as the pixel.
With CAPI running, go back to Test events. Each event should now show both Browser and Server as sources, with one counted after deduplication. If Meta shows a deduplication warning, your event IDs don’t match between the two sources.
Tracking COD orders and WhatsApp leads in Pakistan
Most setup guides assume card payments and website forms. Many Pakistani businesses run on cash on delivery and WhatsApp chats instead, and that changes what you should track.
Cash on delivery. The pixel fires Purchase when the thank you page loads. That happens when the order is placed, and the cash only arrives days later. If a share of your COD orders get refused at the door, Meta counts sales that never happened and keeps finding buyers who order and then refuse. Two ways to handle it:
- Keep Purchase on the thank you page for speed, and judge results by delivered orders in your own sheet.
- If your store or courier panel can send server events, send a custom event such as
OrderDeliveredthrough the Conversions API when the parcel arrives. Once you have enough volume, build a custom conversion on it.
WhatsApp leads. If your site’s main button opens WhatsApp, the pixel won’t see the conversation. It only sees the click. Fire a Contact event on the WhatsApp button click so Meta can at least optimise for people who start a chat. Running click-to-WhatsApp ads? Then Meta already sees the conversation start. Meta also offers a Conversions API for business messaging, so you can report back which chats turned into real enquiries.
For budgeting before you launch, see what Facebook ads cost in Pakistan. Once your tracking works and a campaign is profitable, read how to scale Facebook ads before you raise the budget.
Why your pixel might not be firing
- Cache. The code is saved but your cache plugin still serves the old page. Purge the cache, then test again in a private window.
- Wrong place. The code went into the body or footer of one page instead of the header of every page.
- Installed twice. The pixel sits in a header plugin and in GTM at the same time, so Test Events shows two PageViews for one visit. Keep one.
- Two pixels. An old pixel from a theme setting or a previous agency still fires alongside the new one. Search your page source for
fbq('init'and make sure only the IDs you expect appear. - Ad blockers. Your own browser blocks the pixel, so Test Events shows nothing even though real visitors are tracked. Test with extensions off.
- Wrong dataset. The code has one ID and you’re watching a different dataset in Events Manager. Compare the ID in your code with the ID under the dataset name.
- Consent tools. A cookie banner that blocks scripts until a visitor accepts will hold back events from anyone who doesn’t accept.
Events show in Test Events but your ads still won’t spend? Then the problem is usually the campaign or the account. Our post on a disabled or restricted ad account may help.
Video walkthrough
The two short videos below show our full setup in order. The first covers creating the pixel in Events Manager and adding it in WordPress. The second shows the Google Tag Manager setup and the test after publishing.
Need it done for you? Our Facebook and Instagram ads team sets up the pixel, events and Conversions API as part of every campaign. If you also run carousel ads, our Facebook carousel ads guide shows how to build one with real screenshots.
FAQ
How long does Meta Pixel setup take?
Creating the dataset and adding the base code took us about six minutes, test included. Moving it into Google Tag Manager took another six. Adding standard events and the Conversions API takes longer and depends on your platform.
Is the Meta Pixel free?
Yes. Creating a pixel and sending events to Meta costs nothing. You only pay for the ads you run.
Can I use one pixel on two websites?
You can, but reports get messy because events from both sites land in one dataset. One pixel per website is easier to manage, and Meta lets you create more than one dataset in a business portfolio.
Do I need a developer to install the pixel?
Not for the base code. If you can reach your site’s header through a plugin like WPCode, your Shopify admin or Google Tag Manager, you can install it yourself. A developer helps with custom events and a server-side Conversions API setup.
Why does Events Manager say “dataset” instead of “pixel”?
Meta now groups web, app and offline data under datasets. For a website, your dataset ID and your Pixel ID are the same number.
How do I check if my pixel is working?
Use the Test events tab in Events Manager, or the Meta Pixel Helper extension for Chrome. A working pixel shows a PageView marked Processed within a few seconds of loading your site.



