checking the microphone and webcam

How to Install Facebook Pixel with Google Tag Manager in 2022

How to connect Facebook Pages + Google Sheets

Zapier lets you send info between Facebook Pages and Google Sheets automatically—no code required.

When this happens…

automatically do this!


Part 9: Handle Pagination

  1. By default Facebook limits the number of results in a single response (usually to 25 records) as described here. To get more records, you can add the ‘limit’ parameter to the end of your URL, like this: https://graph.facebook.com/v13.0/act_YOUR_ACCOUNT_ID/insights?fields=reach,impressions,clicks,cpc,spend&limit=1000
  2. There seems to be an undocumented limit of 5000, so if you need more records after that, you can loop through them using pagination handling (paid feature).
    • API URL: enter your request URL, including &limit=5000
    • Pagination type: cursor
    • Next token parameter: after
    • Next token path: paging.cursors.after
    • Run until: choose when to stop running the request

How to get Facebook Pixel code?

First things first, let’s go to the Facebook Pixel Business manager and get the Pixel ID (that will be needed in the next chapters of this blog post.

Disclaimer: Facebook is constantly changing the user interface here, therefore, there is a high chance that my screenshots will not match what you actually see. In fact, once I had a case where 4 people in my GTM workshop saw different versions of the interface at the same time. So, if you don’t find a certain option, just keep looking.

In the top right corner, click the Menu icon and go to Events Manager.

Then go to  Data Sources and choose the Pixel that

Then go to  Data Sources and choose the Pixel that you’re interested in.

If you don’t have any Pixels yet, click the

If you don’t have any Pixels yet, click the Set Up Pixel and follow all the necessary steps.

In one of the steps, Facebook will offer you several ways to add the pixel. Close this window for now.

Your main goal, for now, is to get the Pixel ID th

Your main goal, for now, is to get the Pixel ID that looks like this (of course, the value will be different):

Once you get it, copy it (because we’ll need

Once you get it, copy it (because we’ll need it in the next chapter of this blog post).

Part 7: Handle Actions

Facebook’s API lists conversions together in a single “actions” field. Therefore, if you’re requesting multiple actions at once, I suggest using a JMESPath expression to move each action into its own column. The expression for each metric looks like this, where you name your new field on the left side, and query for the action you want on the right, like this:


Let’s take an example request URL of https://graph.facebook.com/v13.0/act_1111111/insights?fields=campaign_id,campaign_name,unique_clicks,spend,actions&level=campaign

The following JMESPath would create a report with the following fields: campaign_id, campaign_name, unique_clicks, spend, cart_adds, purchases, date_start, date_stop

Create your Facebook API Request URL

Let us follow the Facebook documentation to access the key summary data for your account. 

  • API root: https://graph.facebook.com
  • Endpoint: /vAPI_VERSION/act_YOUR_ACCOUNT_ID/insights (You can get your account ID from Facebook Ads Manager). 
  • Endpoint Example: /v8.0/act_123456789012345/insights
  • Query Strings: ?access_token=USER_ACCESS_TOKENQuery Strings Example: ?access_token=EAAEZCmli4ij4BAPTOzshTCirwrKU6tTUP3CE0…

When we put all of them together, we get the following:

Ensure that you substitute in your own account ID and access token. 

#5. What Can You Do with the Data That You Have Just Tracked via Facebook Pixel?

This question goes beyond the scope of this blog post, therefore, I’ll just quickly mention the possibilities:



Advanced Integrations For Facebook Lead Ads

Of course, merely collecting leads is not worth much unless you do something with them. You need to nurture those leads and work towards converting them into sales. With Automate.io there is unlimited scope to do just that.

1. Connect Facebook Lead Ads to a CRM

We get it. Some businesses use Google Sheets as a simple, lightweight database. And it is free. However, it is not effective if you want to get the most out of your Facebook leads.

That’s why most businesses are tilting towards using a CRM for storing their customer information. And there are many benefits to doing so.

What are the advantages of using a CRM over Google Sheets?

  1. It is much more secure. 
  2. It is ideal for team collaboration.
  3. It gives you a chronological record of every interaction you have with your leads.

Here are a few handy integrations to get you started.

Note: While collecting your Facebook leads on a CRM, always separate the lead name into first and last name. 

2. Add Your Facebook Leads To An Email List

A personalized welcome message to each of your leads goes a long way. And, couple that with an email marketing software, the level of personalization becomes multifold.

This strategy is particularly useful if you have clear customer segments. You can categorize your leads into specific segments and run focussed campaigns in the future.

If you are collecting phone numbers, you can send them personalized SMSes. 

3. Enhance Your Facebook Lead Generation Using Clearbit

Using Facebook Lead Ad forms, you want to collect as much information as possible from the customer. However, the more fields you ask them to fill in the form, the more likely it is that you lose them.

You can reduce this friction if you add a Clearbit integration in your workflow. All you need is the customer’s email ID from the Facebook lead form to get his or her complete picture. Clearbit’s Enrichment platform backfills any other information associated with that email.

4. Get Instant Notifications On New Facebook Leads

If you or your team wants to keep up and get notified with every new lead, it is ideal for connecting a notifications app to your workflow.

You can even get notified about new Facebook leads via Gmail.

Hevo Data: Integrate your Data Seamlessly

Hevo is a No-code Data Pipeline. It supports pre-built data integration from 100+ data sources at a reasonable price. It can automate your entire integration process in minutes. It offers a set of features and supports compatibility with several databases and data warehouses. Hevo will integrate Facebook Ads and Google Sheets conveniently without writing any code and for free.

Get Started with Hevo for free

Let’s look at some of the unbeatable features of Hevo:

  • Completely Automated: Hevo platform can be set up in minutes and requires minimal maintenance.
  • Real-Time Data Transfer: Hevo provides real-time data migration, so you can have analysis-ready data always.
  • Data Transformation: It provides a simple interface to perfect, modify, and enrich the data you want to transfer. 
  • Fault-Tolerant: Hevo is capable of detecting anomalies in the incoming data and informs you instantly. All the affected rows are kept aside for correction so that it doesn’t hamper your workflow.
  • Live Support: Hevo team is available round the clock to extend exceptional support to you through chat, email, and support calls.
  • Schema Management: Hevo takes away the tedious task of schema management and automatically detects the schema of incoming data and maps it to the destination schema.
  • Live Monitoring: Hevo allows you to monitor the data flow, so you can check where your data is at a particular point in time.
Sign up here for a 14-day Free Trial!

Transfer Data from sources like Facebook Ads, Google Sheets, etc., to your target destination for Free!

Step 3: Set up automatic refreshes and triggers

If you’d like to analyze the same daily, weekly, or monthly data, you can use Supermetrics to set up new data transfers to Google Sheets.

To do so, click on the ‘Schedule’ tab on the sidebar.

Next, click on ‘Add trigger’. From here, you can c

Next, click on ‘Add trigger’. From here, you can choose how often you want to update your report and whether you want an email notification when it happens.

Learn how to set up the triggers.

Learn how to set up the triggers.

Buh-bye copy/paste ?

High five! ✋ We finally got rid of the most boring and tedious part of marketing reporting — copy/pasting data into Google Sheets.

Now it’s your turn to decide how you’ll analyze your data and what kind of reports you want to build.

And if you want to feature your awesome reports in our template gallery, let me know on Twitter or LinkedIn.

Happy automating! ?