top of page

Visionary Ads

FB Ads - How to track any event on the site (using GTM)?

  • Writer: Alex Denshik
    Alex Denshik
  • Mar 29, 2021
  • 5 min read

Updated: Apr 29, 2021

People are also looking for:


How to create a custom conversion (custom event) on the site for FB ads? How to track clicks / form submissions / text selection / scrolling depth / duration / element visibility / video view duration, etc in FB Pixel?


How it works:


With GTM, you can send a signal to the FB Pixel that the conversion has taken place. To do this, use a custom HTML tag with the fbq ('trackCustom') function. You just need to choose the right trigger, and you can track any FB Pixel event that can be tracked with GTM. Each time the selected GTM trigger fires (for example, when a form is submitted), the tag sends a signal to the FB pixel. See the manual below.



What you need:

  • Your site must have GTM installed

  • FB Pixel code must be installed on your site, preferably via GTM (see How to add FB Pixel code using GTM”)

  • It is advisable to install the browser extension - Facebook Pixel Helper (to check if the conversion is working);

  • You must know what event you want to track and how to create a trigger for it in GTM



Step 1: Log into your GTM account. Go to the "Triggers" section

Step 2: Select and create the type of trigger you want (it depends on your situation and needs). If you do not know what type of trigger you need and how to create it.


Step 3: Go to the “Tags” section and click on the “New” button. Select the trigger you created earlier. Give a name to your tag


Step 4: In the "Tag Configuration" section, select the "Custom HTML" tag type;


Step 5: Insert custom conversion tracking code into the HTML code field:


<script>

fbq('track', 'Your Event's Name');

</script>


Step 6:(If your FB Pixel is installed on the site via GTM tag) Click on "Advanced Settings", then on "Tag Sequencing" and check the box "Fire a tag before * Your Tag * fires". In the "Setup Tag" field that appears, select the tag that is responsible for installing the FB Pixel (so that it starts before our tag with conversions).

Step 7: Click the "Submit" button, fill in the information about the changes (it doesn't matter what you write) and click the "Publish" button

Step 8: Go to your website, perform a conversion action and use the Facebook Pixel Helper extension to check if FB Pixel is tracking it successfully;


Note: The event should only appear in Pixel Helper after the conversion is complete. If the Event appears earlier or does not appear at all, check how the GTM tag works in Preview Mode (See how to do it)

Step 9: Go to your FB Business Manager account - https://business.facebook.com (select the one you need if you have several).

Step 10: Go to Event Manager

Step 11: Select the Pixel that is installed on your site. The Events field should display the custom events that you created and tested earlier. If they are not there, wait for a little or click "Check events" and test them on the site, following the instructions.

Step 12: Go to the section "Custom conversions" (menu on the left - a star in a circle). Click “Create Custom Conversion”


Step 13: Give a name to your new conversion. In the "Conversion Event" field, select the conversion you created earlier (if not already, wait a while or do more tests on the site). Be sure to check that you have selected the correct Pixel.


Note: You can associate your conversion with standard conversions in FB (leads, sales, contacts, etc.) by manually selecting a category. After that, the number of your conversions will be added to the total number of events in the selected category in the reports (for example, a custom conversion "form submit" can be taken into account in the total number of leads).

Step 14: (optional) To select a conversion category, under the heading "Choose a Standard Event for Optimization" click on "Select your own category" and choose the most suitable category.

Click 'Create'. Done. Now you can see your new conversion in reports, select it as a goal for your ad sets and use it to create audiences.


Update: Due to changes due to iOS 14, your Pixel can only track 8 conversion events per domain. New conversions are not automatically added to this list, so you need to do it manually. Check out this article if you don't know how to do it.


See Screenshots:


Step 1: Log into your GTM account. Go to the "Triggers" section. Click on the "New" button.

Step 2: Select and create the type of trigger you want (it depends on your situation and needs). If you do not know what type of trigger you need and how to create it, see this article.

Step 3: Go to the “Tags” section and click on the “New” button. Select the trigger you created earlier. Give a name to your tag

Step 4: In the "Tag Configuration" section, select the "Custom HTML" tag type;


Step 5: Insert custom conversion tracking code into the HTML code field:


<script>

fbq('track', 'Your Event's Name');

</script>


Step 6:(If your FB Pixel is installed on the site via GTM tag) Click on "Advanced Settings", then on "Tag Sequencing" and check the box "Fire a tag before * Your Tag * fires". In the "Setup Tag" field that appears, select the tag that is responsible for installing the FB Pixel (so that it starts before our tag with conversions).

Step 7: Save. Click the "Submit" button, fill in the information about the changes (it doesn't matter what you write) and click the "Publish" button


Step 8: Go to your website, perform a conversion action and use the Facebook Pixel Helper extension to check if FB Pixel is tracking it successfully;


Step 9: Go to your FB Business Manager account - https://business.facebook.com (select the one you need if you have several).

Step 10: Go to Event Manager


Step 11: Select the Pixel that is installed on your site. The Events field should display the custom events that you created and tested earlier. If they are not there, wait for a little or click "Check events" and test them on the site, following the instructions.


Step 12: Go to the section "Custom conversions" (menu on the left - a star in a circle). Click “Create Custom Conversion”


Step 13: Give a name to your new conversion. In the "Conversion Event" field, select the conversion you created earlier (if it still not available, wait a while or do more tests on the site). Be sure to check that you have selected the correct Pixel.

Note: You can associate your conversion with standard conversions in FB (leads, sales, contacts, etc.) by manually selecting a category. After that, the number of your conversions will be added to the total number of events in the selected category in the reports (for example, a custom conversion "form submit" can be taken into account in the total number of leads).


Step 14: (optional) To select a conversion category, under the heading "Choose a Standard Event for Optimization" click on "Select your own category" and choose the most suitable category.

Click 'Create'. Done. Now you can see your new conversion in reports, select it as a goal for your ad sets and use it to create audiences.

Update: Due to changes due to iOS 14, your Pixel can only track 8 conversion events per domain. New conversions are not automatically added to this list, so you need to do it manually. Check out this article if you don't know how to do it.

Comments


bottom of page