How To Add The Facebook/Meta/Instagram Pixel To Your WordPress Website Using Google Tag Manager
- Sign in to your Google Tag Manager account and create a new tag.
- Give the tag a name, such as “Facebook Pixel” or “Instagram Pixel.”
- Under “Tag Configuration,” select “Facebook Pixel” or “Instagram Pixel,” depending on which pixel you want to add.
- Enter your pixel ID in the “Pixel ID” field.
- Under “Triggering,” select “All Pages” to ensure that the pixel is added to all pages of your website.
- Click “Save” to create the tag.
- In another tab or window, log in to your WordPress website.
- Install the “Insert Headers and Footers” plugin if you haven’t already.
- Navigate to the plugin’s settings and paste the Google Tag Manager code in the “Scripts in Header” field.
- Go back to Google Tag Manager and click on “Variables” in the left-hand menu.
- Create a new variable and give it a name, such as “Pixel ID.”
- Under “Variable Configuration,” select “User-Defined Variable.”
- Under “Variable Type,” select “Constant.”
- Enter your pixel ID in the “Value” field.
- Click “Save” to create the variable.
- Go back to the “Facebook Pixel” or “Instagram Pixel” tag you created earlier and replace the pixel ID with the new variable.
- Click “Save” to update the tag.
- Preview the changes in Google Tag Manager to ensure that the pixel is firing correctly.