Facebook ADS Event Tracking: Installation instructions

There are several ways to analyze user behavior on the site: Google Analytics, FB Pixel, Google Tag Manager and others ... The Content ADsification team will tell you about another one ─ Facebook pixelmore precisely, of one of its functions ─ monitoring and recording of events or certain visitor actions.

Your site, for example, an online store, is visited by different people, someone comes and goes, someone puts the goods in their shopping cart and happily forgets them, and some become customers.

As you can see, everyone performs different actions, which means you need to remember yourself in different ways. It remains only to "track" and group visitors to the site according to certain criteria.

In Facebook pixel terminology, all actions on the site are events. You can define yourself which events will help you build audiences, optimize ads, and maybe even change something in the work of the site or employees.

For example, a large difference between the number of visitors who have placed the product in the cart and placed an order could mean that the ordering process is unclear or that the delivery is expensive, or the managers have missed the buyer. There are a lot of options, but the main thing is that you will start thinking about them and trying them.

Things to do before organizing events

Facebook pixel events can only be set after installing the main Facebook pixel code on your site. Read how to do it in the article.

Below is a code example of the site with an event configured:

  • The original code of your site.
  • The base code of your Facebook pixel.
  • Your event code. The example above shows an event for adding an item to the cart.

Facebook has two types of events: standard and custom events.

Standard events

Standard events are predefined on Facebook and are used to track conversions, perform conversion optimizations, and build audiences.

The table lists Facebook's standard pixel events.

Custom events

These events are not part of the default list, so you can give each a unique name to reflect the action taken by the user. Custom events can be used to create custom audiences, but not for conversion-optimized campaigns.

Event installation and configuration

There are several ways to set up Facebook pixel events:

  • directly in the site code;
  • through the Google Tag Manager service;
  • using Facebook's event customization tool.

All standard events are monitored via a pixel function call fbq ('track') specifying the name and, if necessary, the JSON object as parameters ─ price, currency, goods id and so on D. Further details about the parameters are written transmitted in the Facebook certificate in For example, this is what a function call looks like that tracks a completed purchase event, the currency and amount are specified as parameters: fbq ('track', 'Purchase', { currency: “USD”, value: 30.00}), where

  • Buy: The name of a standard Facebook event that reflects the completion of a purchase.
  • {currency: “USD”, value: 30.00} ─ additional parameters on the completed order ─ Currency: “USD” ─ currency “US dollar”, value: 30.00 ─ amount 30.00.

Custom events are tracked by calling the pixel function fbq ('trackCustom') with the name of the event and, if necessary, a JSON object as parameters (price, currency, product ID, etc.) for example, this is how which a function calls shows up, monitoring the submission of the form on the site:

In this example, the event name in Facebook statistics will be displayed as “OtpavkaForm”. For a more convenient analysis of the information, it is best to indicate all names as clearly as possible, after calling the code, the events will be automatically tracked in the Event Manager.

Manual setting of events

The fbq ('track') or fbq ('trackCustom') functions can be called anywhere on the site between the opening and closing tags when the page loads or when the user performs an action, such as clicking a button.

How to do it?

To begin with, we will determine for what purpose and for what event we will look on the site.

For example, we need to track when an item is added to the cart by clicking a button. For this, standard Facebook events are suitable. Go to the standard events table presented above and search for the desired action, in our example it is “Add to Cart”.

We see that the code for this action is similar to fbq ('track', 'AddToCart').

Here's how to add the code to call the fbq ('track', 'AddToCart') function by clicking the site code button.

Event configuration via Google Tag Manager

As a reminder, before working with events on the site, the Facebook pixel code must already be installed. We will take the same tracking of adding an item to cart (AddToCart) as the basis for setting up the event, let's consider a simple setup and installation of an event via GTM.

1. First, let's define a button and its parameters to send an event to Facebook. To do this, go to the site, find the button we need and click on it with the right mouse button, then select "View code".

2. Look at the parameters of the button, in this case it is the name of the AddToCard class and the text “Add to cart”.

3. Next, go to Google Tag Manager in the “Variables” section and click on the “Configure” button. In the configurations, select “Click Classes” and “Click Text”.

4. Next, go to the “Triggers” section and press the “Create” button.

5. Select the “All clicks” activation settings.

6. Make the following settings according to the button parameters:

7. It remains to create a tag. Go to the "Tags" section and click the "Create" button.

8. Next, click on 'Tag Configuration' and select 'Custom HTML' from the list provided.

9. In the entry field, enter our code, which must be enclosed in the tag :

fbq (‘track’, ‘AddToCart’);

10. After that, we need to select the trigger of the code we created earlier.

11. Now let's make sure that our event is configured correctly and first check the operation of the tag.

To do this, in the Google Tag Manager interface, go to "preliminary mode" and go to your site.

On the site, click the "Add to Cart" button and display the tag activator at the bottom of the screen:

12. Furthermore, the correctness of the trigger, in the “preliminary mode”, can be verified with the help of the “Facebook Pixel Helper” extension, where by pressing the button the name of our event will be displayed in the interface. 

More extensions to help PPC and targeted advertising specialist

13. Everything is ready, press the “Submit” button in the upper right corner.

After that, the data will be displayed in the Event Manager with a unique name, in our case by the function fbq ('track', 'AddToCart'). Facebook will define it as “Add to Cart” in the new version and AddToCart in the old one.

Screenshot of the new version of Facebook To see in detail the events in the old version of Facebook, you need to go to the Event Manager and click on our previously installed pixel.

Screenshot of the old version of Facebook

Configure events using the Facebook event setup tool

In addition to working with the code, you can use the Facebook tool to add events and parameters for this event to your site's web interface.

Step by step algorithm

Step 1

Go to Event Manager → “Data Sources” and select the pixel we need, then click the “Add Event” button.

We select "Set the code manually" and skip all the points with the "Continue" button before Facebook asks you to "Run the event configuration tool".

Click this button. After that, a window will appear to enter your site URL, fill it in, then ─ “Open Site”.

Procedure in the old version

Go to Event Manager → “Data Sources” and select the pixel we need.

The events configured by us are also displayed on the page with detailed information and statistics of the selected pixel. In the upper right corner we find and click on the "Configure" button, from the drop-down list select "Configure new events".

After that, a window will appear with the event settings, and in which we will immediately select “Use the Facebook event settings tool”.

In the "Site URL" field, enter our site address and click the "Open Site" button.

Step 2

After entering the site, in the upper left corner we will see the “Facebook Events Configuration Tool” window.

In some pages it is possible to view not only the events already configured on this page, but also those recommended for installation. For example, in the screenshot below, a page where Facebook noticed the "Checkout" button and offered to set an event on it.

We press "Check", the button on the site is highlighted, it is possible to select the category of the event itself, this is "Buy" and the values transmitted. If everything suits you, we confirm your choice.

The button has turned green, so the event for its activation is already configured and monitored in the Facebook interface in Events Manager.

The Facebook Event Configuration Tool feature allows you to manually configure button tracking.

This way you can easily customize any button on your site. After selecting “Track New Button”, the site will display all kinds of selections that Facebook can acquire. Choose the ones you want and complete the setup as described above Another useful function in the event configuration is “Track URL”.

For example, it is very easy to register the completion of an order if, after entering it, the user lands on a page with gratitude (site.ru/thank-you for example). By filling in all the necessary fields and confirming the completion of the setup, you will very quickly set up the event you need.

Custom conversions

Custom conversions allow you to create rules for the parameters of your events and pages on your site. This allows you to measure more specific customer actions. For example, you can filter all purchase events to count how many pairs of women's shoes have been purchased for more than $ 1,000. Using these conversions, you can also optimize ad delivery, with up to 100 custom conversions per ad account.

Personalized conversion opportunities

Optimizing ad serving for custom events for custom events Facebook allows you to create an optimized campaign for conversions only for standard events and for custom conversions, for custom events this is not possible. Therefore, in order to optimize for specially configured events, you must first create a conversion based on those events and then optimize the display of ads based on it. First, go to the Event Manager and go to the Custom Conversions tab.

Click the "Create Custom Conversion" button.

Make sure you indicate the name of the conversion and the source of the data, if you have several, in our case this is a single Facebook pixel. From the “Conversion Event” drop-down list, select the specially configured event we need. Then we press the "Create" button.

Now, by choosing to optimize ad display via conversion, we can use the conversion generated based on a custom event.

Standard event configuration without additional code

If your site has a basic Facebook pixel code, you can use URL rules to log standard events without adding additional code.

For example, this is useful when your site has a separate thank you page and you can create a custom conversion to quickly capture transitions to this page.

Algorithm

In the window for creating a conversion for the "Conversion event" select "All traffic for the URL" and in the rules below please indicate the name of our page with gratitude and then click on the "Create" button.

Event filtering

Adding a rule to Standard Events, Custom Events, and All Traffic for URL Events allows you to analyze customer activity in more detail. For example, if you have configured the transmission of additional parameters for events, you can create a rule to count buyers for goods of a certain category and cost.

Example

How to set the conditions for fixing the addition of a product of a certain category for more than 1000 rubles.

When we create a specially configured conversion in “Conversion event”, we select any event we need to monitor, in our case, this is “Add an item to cart”, in which the parameters are transferred. Sample code for one of the products when adding to cart:

fbq ('track', 'AddToCart', {value: 2500, currency: "RUB"}

Then, in the rules, select “URL” → “Contains” and in the input field we enter a part of the page URL, the category we need to keep track of.

For example, the page appears as site.ru/divani/3464, where site.ru is the main address of the page, sofas is the category of goods sold “Sofas” and 3464 is the id of a certain product. The sofas category will interest us.

Note: Not all pages are of the shape described in the example.

Click the “+” next to the rule to add another one. Select the category "Event Parameters" to create a rule from the parameters, then ─ "value" (cost of goods) and set "more than" 1000. The "Create" button.

Control of the data that is transferred to the partners

Share data for individual custom conversions, rather than entire data sources, with trading partners.

Conclusion

In conclusion, I would like to describe some of the problems a user may encounter when setting up events:

1. If you are using Facebook's Event Customizer which acts as a popup, it may not appear due to the popup blocker in your browser. In order for the tool to work properly, it is worth turning off the lock.

2. Facebook currently does not allow companies with activities such as investment banking and brokerage, insurance, financial services, retail banking, loans (including mortgages), mortgages (credit unions), pharmaceuticals and healthcare. Companies operating in these industries can use manual event settings.

3. You can customize the buttons in the event configuration tool provided that:

  • Representing an HTML button, link, or HTML element, the class or identifier contains "button", "btn" or another spelling of the word "button" in English.
  • The height of the button is no less than 10 pixels and no more than 600. Buttons that are too large and too small are not displayed in the tool.
  • The button contains an image or text. Buttons containing only icons or numbers, such as a search icon or phone number, are not counted.

For a fuller description of possible problems, see the Facebook Help - Facebook Site Event Troubleshooter.

Other contents

en_USEN