Skip to content

On a schedule

Log Facebook Page insights to Google Sheets daily

Yesterday's Facebook Page views, post engagements, new follows and media views are added to a sheet as one row per day.

Runs
On a schedule
Apps
Facebook Pages, Google Sheets
AI
Not needed
Access
pages_show_list, pages_read_engagement, read_insights; Google Sheets read+write

Send this to your assistant

Create a ClickRuntime automation: every morning at 6, add yesterday's Facebook Page insights (page views, post engagements, new follows, unfollows and media views) to the Page stats tab of my sheet.

Paste it into your assistant. It tells you what it will send or change before it runs live.

First time? Adding ClickRuntime to your assistant takes about two minutes.

Why use it

Why teams use this automation

Meta Business Suite shows Page insights, but only for windows it chooses, and exporting means downloading a file each time. Comparing this month with the same month last year is awkward without your own history.

This automation adds one row a day to a sheet with the Page's views, engagements, follows, unfollows and media views, so you build a complete record you control.

Social media managers, small businesses and agencies reporting to clients use the tab as the source for monthly charts.

What you get out of it

  • History you own

    Daily numbers stay in your sheet even after Meta changes what its dashboards show.

  • Easy monthly reports

    Sum a month's rows or chart them; no exports needed.

  • Follows and unfollows side by side

    See whether a post or campaign brought in followers or lost them.

  • Several Pages, one sheet

    Ask for one tab per Page to compare locations or brands.

  • Adjustable metrics

    Swap metric names at the top of the script to track what matters to you.

How it works

What happens, step by step

  1. Every morning ClickRuntime asks Facebook for your Page's insights for the previous day.

  2. It reads views, post engagements, new follows, unfollows and media views.

  3. One row with the date and each number is added to your Page stats tab.

  4. Over time the tab becomes a daily history you can chart.

Before it runs live

  • Connect Facebook Pages
  • Connect your Google Sheets account and pick the spreadsheets it may use

What you get

RunsOn a schedule
Log Facebook Page insights to Google Sheets dailytoday, 9:00Succeeded
Google Sheets · Social › Page stats2026-11-09 | page views 412 | engagements 1,038 | new follows 27 | unfollows 3 | media views 18,640

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • Your own rules

    Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.

  • Any number of apps

    One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.

  • AI where it helps

    Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.

  • On a schedule or on each event

    Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.

Changes you can ask for

  • Run it at a different time, more or less often, or only on weekdays
  • Add an AI step, for example to summarize, sort or draft a reply
  • Add another app, for example also send it to Slack
  • Combine it with other Facebook Pages and Google Sheets steps into one automation

Under the hood

The code that runs this automation

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
log_facebook_page_insights_to_google_sheets_daily.pyexample
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from datetime import date, timedelta
from clickruntime import on_trigger, credentials, http

PAGE_ID = "1234567890"
SHEET_ID = "your-spreadsheet-id"
METRICS = ["page_views_total", "page_post_engagements", "page_daily_follows_unique", "page_daily_unfollows_unique", "page_media_view"]

def page_token():
    r = http.get(f"https://graph.facebook.com/v21.0/{PAGE_ID}", params={"fields": "access_token",
                 "access_token": credentials.connection("facebook", "work")})
    r.raise_for_status()
    return r.json()["access_token"]

@on_trigger
def run(event):
    day = date.today() - timedelta(days=1)
    data = http.get(f"https://graph.facebook.com/v21.0/{PAGE_ID}/insights", params={
        "metric": ",".join(METRICS), "period": "day", "since": day.isoformat(), "until": date.today().isoformat(),
        "access_token": page_token()}).json().get("data", [])
    values = {m["name"]: (m["values"][-1].get("value", 0) if m.get("values") else 0) for m in data}
    row = [day.isoformat()] + [values.get(m, 0) for m in METRICS]
    build("sheets", "v4", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False) \
        .spreadsheets().values().append(spreadsheetId=SHEET_ID, range="Page stats!A:F", valueInputOption="RAW",
                                        body={"values": [row]}).execute()
    return {"date": day.isoformat(), **values}

FAQ

Common questions

Which permissions does my Facebook app need?
pages_show_list, pages_read_engagement and read_insights, and you must be an admin of the Page. ClickRuntime uses your connection to get the Page's own access token.
Why is a metric showing zero?
Meta renames or retires Page metrics from time to time, and retired ones come back empty. The metric names sit at the top of the script, so your assistant can swap in the current name.
Can I backfill past months?
Yes. Insights can be requested for earlier date ranges, so ask your assistant for a one-off run that writes one row per day for the last 90 days.
What permissions does it need?
pages_show_list, pages_read_engagement, read_insights; Google Sheets read+write. Nothing else in your accounts is used.
Does it need AI?
No. It runs without AI, so it doesn't use your plan's AI allowance.
How many runs does it use?
One run each time it runs (on a schedule). Checks that find nothing to do and stop right away aren't counted.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

Set up “Log Facebook Page insights to Google Sheets daily” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.