Customizing the Facebook Event Pixel via Google Tag Manager
Every year, the digital world is watching the release of innovations in the advertising offices of large social networks. Trends in this area are set, of course, by Facebook. No matter how the opponents of “Facebook domination” accuse the network team of being set up only to extort funds from advertisers, the guys from Facebook are constantly improving the advertising account. And as a result, everyone who pays for targeted advertising gets ample opportunities to analyze the effectiveness of advertising campaigns.
Another giant of the digital age, Google, has also joined in to improve the analytics of advertising companies. Google Tag Manager (hereinafter referred to as GTM) is a free tool that was created primarily to manage code snippets for advertising and analytics purposes. Properly configuring GTM for your advertising campaign goals will help take the process of getting the right data to a new level.
How to combine the features of the Facebook ad cabinet and GTM?
Let’s start with the basics. If you have a website and you maintain a business account on Facebook, then the goal of the lion’s share of the advertising campaigns that you launch is transitions to the site and users to perform targeted actions.
To analyze the effectiveness of conversion advertising campaigns, a tool is used – the Facebook Pixel. Pixel allows:
- track various actions of the audience on the site;
- collect information about the target audience and set up more accurate guidelines in advertising;
- optimize advertising campaigns and increase conversions to the site.
A pixel is a piece of code that needs to be inserted into the website code.
The task of an advertising campaign (hereinafter referred to as RK) is not always a direct incentive to purchase. Some RKs also solve problems in getting to know the brand, with expert content presented on the site. Accordingly, the list of user actions on the site is not limited to one.
Therefore, the Pixel consists of 2 parts:
- Base code. It is installed on all pages of the site.
- Event codes. Customized for individual business goals.
Events are actions on the site (viewing content, filling out a form, purchasing, etc.).
To track events, you need to place a code snippet in your GTM account, which will be used to record user actions.
Block of work in the Facebook advertising account
- Open the Pixels tab in Events Manager.
- Click Customize.
- Click Set Code Manually.
- Next, in the “Installing the pixel code” section, click on the “Add your own events” section.
- We get the List of events that can be tracked via FB. You can read more about what each standard event from the list above means at the link.
- Click the switch next to the event you want to track.
- Next, we make the selected event from the list active, and get the event pixel code. Example for the Lead event.
- List of recommended events, their description and pixel codes.
Event name | Description | Event pixel code |
Purchase | Track purchases or checkout completion (e.g. thank you landing page or confirmation page) | <script> fbq(‘track’, ‘Purchase’); </script> |
Lead | Track when someone is interested in your offer (e.g. submitting a form, signing up for a trial) | <script> fbq(‘track’, ‘Lead’); </script> |
Search | Track search queries on the site | <script> fbq(‘track’, ‘Search’); </script> |
ViewContent | Track key page views (e.g. product pages, landing pages, articles) | <script> fbq(‘track’, ‘ViewContent’); </script> |
Contact | Communication between the client and your company by phone/SMS, e-mail or otherwise. | <script> fbq(‘track’, ‘Contact’); </script> |
Submit Application | Track the submission of completed registration forms for your products, services or programs | <script> fbq(‘track’, ‘SubmitApplication’); </script> |
Block of work in Google Tag Manager
- Go to GTM.
- Choose one of the containers you need.
- Log in to your account and select the “Tags” section.
- In the “Tags” section, click on the “Create” function.
- Automatically goes to the section of the new tag. Give the name of the tag in the English version of the event (see the table above).
- In the “Tag Type” section, select the type – Custom HTML.
- In the HTML area, paste the event pixel code.
- Next, go to the “Triggers” section. A trigger in GTM is a condition under which a tag is enabled or disabled. A tag must have at least one trigger to activate.
- We recommend that you carefully consider the conditions for each trigger, i.e. what the user must do on your site to trigger the event of interest. Using the example of the MAVR agency website and our block, we will show the conditions for triggers.
Our recommendations are not universal, but only hints for ideas and analysis of the logic of actions for the user, which is written on your site.
Conditions for triggers for each of the recommended events for the site https://mavr.ua/
- Conditions for triggers for each of the recommended events for the site https://vlada-rykova.com
Event | Page/pages on the site | Forms to fill out, payment forms or search forms |
Purchase | https://vlada-rykova.com/kopirayting-video/ | Click on the button to pay for the video course |
Lead | Two pages from the site or https://vlada-rykova.com/uslugi-i-stoimost/, or https://vlada-rykova.com/kontakty/ | |
Submit Application | Website page “Thanks” | |
ViewContent | All pages of the site | |
Search | Search result pages |
- Using one of the examples, we will analyze what condition for the trigger we have written under the “Seach” event tag for the site https://mavr.ua
The condition for activating this trigger is when the user lands on the search results page. You type in the search bar, for example, the word “SMM” and get search results.
We gave the trigger for the “Seach” event a name:
Next, you need to specify the trigger type. In this case, we chose the Page Views type.
Then you need to register at what action the trigger is activated. In our example, activation occurs when a site page is generated through a url containing the expression “\?s=”.
- After the actions – the name of the tag, inserting the event code, assigning a trigger – to save the tag, click the “Save” button.
The block of work on the integration of the Facebook Event Pixel and GTA has been completed.
Conclusions. The implementation of a set of tasks for integrating the Facebook Event Pixel and Google Tag Manager will allow you to collect accurate quantitative and qualitative indicators of the effectiveness of targeted advertising.
- You will learn what actions the audience performs on the site from a specific traffic source – Facebook.
- You will be able to collect information about your users and use it when setting up individual audiences in targeted advertising.
- You will be able to set up more precise characteristics of the target audience for the remarketing system.
Internet marketing expert. Head of marketing agency MAVR.
Business degree “Master of Business Administration” (MBA).