How to install the Facebook Pixel with the Google Tag Manager
The Tag Manager allows people to quickly and easily update tracking codes and related code fragments collectively known as “tags” on their website. Once the Tag Manager web snippet has been added, marketers can configure and deploy their tag configurations from a web-based user interface without involving any developer work every time they need to make changes.
Send Standard Events
Step 1: Sign in to your Google Tag Manager account.
Step 2: Select your website’s container and click Add a new tag.
Step 3: Click Custom HTML Tag and type a name for your tag.
Step 4: Go to Events Manager and click Details for your pixel.
Step 5: Click Set Up and select Manually Install the Code Yourself.
Step 6: Copy the entire pixel base code, as shown below.
Step 7: Return to Google Tag Manager and paste the code in the HTML container.
Step 8: Click Advanced Settings and under Tag firing options, select Once per page.
Step 9: Under Fire On, select All Pages.
Step 9: In the same way, create tags for the other events on your website (ex: add to cart, purchase). See the examples below.
Step 10: When you’re finished creating tags, click Publish.
Google Tag Manager Data Layer
The Google Tag Manager data layer is an object that contains all of the information that people want to pass to Google Tag Manager from their website. Information, such as events or variables, can be passed to Google Tag Manager via the data layer, and triggers can be set up in Google Tag Manager based on the values of variables or based on the specific events. Variable values can also be passed through to other tags (for example, pass purchase total into the value field of a tag).
Step 1: Define the data layer in your HTML; see following example:
Step 3: In tag HTML, you can reference the data layer by the {{ }} placeholder; for example:
fbq(‘track’, ‘Purchase’,
{ content_ids: {{content_ids}},
content_type: ‘product’,
value: {{total}} });