This document will provide step-by-step instructions for adding a Facebook pixel to a website using Google Tag Manager. Google Tag Manager is used to track events that users trigger when visiting your website.
- Support: Support is not available from the UW-Madison Google team for non-core apps. We recommend the following for assistance:
- Recommendation: Use a departmental service account when using non-core apps to share ownership of data and avoid losing access to data owned by a former employee/student.
Before you get started, you will need a Facebook Pixel and a Google Tag Manager account.
To get the pixel, you can follow Facebook's step-by-step guide. During the Install Pixel step, choose manually install pixel code yourself.
Google Tag Manager Account Setup
To setup Google Tag Manager, follow the vendor documentation steps. Note: You will not need to add any Google Tag Manager code to your website as the instructions indicate. Instead, you'll be connecting the account to your WiscWeb site via the Customizer.
- In Google Tag Manager, navigate to your Workspace Tab.
- From your Workspace Tab, navigate to Tags and click the button labeled New.
- Name your new tag Facebook Pixel and set the Tag Type to Custom HTML.
- In the HTML field, paste the Facebook Pixel code.
- In the Triggering section, select All Pages to add the tag to every page within your website.
- Click Save in the upper-right hand corner of the window.
- Next, publish your changes by clicking the Submit button in the upper-right section of the page.
- Lastly, test the pixel using the Facebook Pixel Helper to ensure that it is working as expected.
Locate the Google Tag Manager ID
- In your Google Tag Manager account, open a container.
- In the top right corner, you should see some text that starts with GTM-
- Copy this text (including the GTM- part)
Paste the ID into the Customizer in WiscWeb
- Login to your WiscWeb site
- Click on the Appearance link on the left menu
- Choose Customize
- Scroll down in the Customizer menu and select the Google Services option
- Paste in your Google Tag Manger tracking ID