Go to https://www.facebook.com/ads/manager with your favorite browser:
Click Tools, then select Pixels:
Click Actions, then select View Pixel Code:
This is your Facebook Pixel Code, which you will copy and paste in between the <head> and </head> in your website code. The pixel will track visits to every page of your website.
You can also add events to track specific actions. Copy the code for the event you want to track, and paste it after the pixel code on the web pages where you want to track the action. Keep in mind standard event codes are case-sensitive.
Let’s say you want to track purchases on your website.
First copy your Facebook Pixel Code in a notepad:
Then put your cursor after fbq(‘track’, “PageView”);
Press Enter Twice, It should like this:
Copy the Event code for Purchase here:
Paste in your Facebook Pixel Code:
That’s it, you can now paste your Facebook Pixel code on your Web Page you want to track for purchases!