Skip to content

Weekly

Track weekly HubSpot lifecycle numbers in a sheet

Every Monday a new row in your Pipeline metrics sheet shows how many contacts reached each lifecycle stage last week, split by source.

Runs
Weekly
Apps
Google Sheets, HubSpot
AI
Not needed
Access
HubSpot contacts read; Sheets edit

Send this to your assistant

Create a ClickRuntime automation: every Monday, count HubSpot contacts that reached each lifecycle stage last week, split by original source, and add the numbers to my 'Pipeline metrics' 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

A marketing lead needs to show, week by week, how many new leads came in, how many became qualified and how many turned into customers, and which channels drove them. HubSpot can show this, but building the same report every week and copying the numbers into the board deck takes an hour each Monday.

This counts the lifecycle movements for the previous week and adds them as a new row in a Google Sheet. Over time the sheet becomes a clean weekly history you can chart, share or paste into a deck without touching HubSpot.

What you get out of it

  • A weekly history builds itself

    One row per week means trends over months are easy to chart and compare.

  • Numbers anyone can read

    People who don't use HubSpot can see the funnel in a shared sheet.

  • Same counting every week

    The same rules run every Monday, so a change in the numbers is a real change, not a different filter.

  • You know it ran

    A short email confirms the row was added and shows the headline numbers.

How it works

What happens, step by step

  1. Every Monday morning, ClickRuntime looks at the previous week in HubSpot.

  2. It counts the contacts that entered each lifecycle stage that week, split by original source.

  3. It adds one row with the week's date and the counts to your Pipeline metrics sheet.

  4. You get a short email with the headline numbers.

Before it runs live

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

What you get

RunsWeekly
Track weekly HubSpot lifecycle numbers in a sheettoday, 9:00Succeeded
Google Sheets · Pipeline metricsWeek of 12 Oct: 184 leads, 41 MQLs, 17 SQLs, 9 opportunities, 4 customers.

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 Google Sheets and HubSpot 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.
campaign_and_lifecycle_analytics_from_hubspot_into_sheets.pyexample
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from datetime import date, timedelta, datetime, timezone
from clickruntime import on_trigger, credentials, http, notify

SHEET_ID = "1AbCdEfGhIjKlMnOpQrStUvWxYz"
STAGES = ["lead", "marketingqualifiedlead", "salesqualifiedlead", "opportunity", "customer"]

def hs(method, path, **kw):
    r = http.request(method, f"https://api.hubapi.com{path}", headers={"Authorization": f"Bearer {credentials.connection('hubspot', 'work')}"}, **kw)
    return r.raise_for_status() or (r.json() if r.content else {})

@on_trigger
def run(event):
    end = date.today() - timedelta(days=date.today().weekday())
    start = end - timedelta(days=7)
    ms = lambda d: str(int(datetime(d.year, d.month, d.day, tzinfo=timezone.utc).timestamp() * 1000))
    row = [start.isoformat()]
    for stage in STAGES:
        prop = f"hs_v2_date_entered_{stage}"
        res = hs("POST", "/crm/v3/objects/contacts/search", json={"filterGroups": [{"filters": [
            {"propertyName": prop, "operator": "BETWEEN", "value": ms(start), "highValue": ms(end)}]}], "limit": 1})
        row.append(res["total"])
    svc = build("sheets", "v4", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False)
    svc.spreadsheets().values().append(spreadsheetId=SHEET_ID, range="Pipeline metrics!A1", valueInputOption="RAW", body={"values": [row]}).execute()
    notify.email_me(f"Pipeline metrics for week of {start}", ", ".join(f"{s}: {n}" for s, n in zip(STAGES, row[1:])))
    return {"week": row[0], "counts": row[1:]}

FAQ

Common questions

Which lifecycle stages are counted?
By default lead, marketing qualified lead, sales qualified lead, opportunity and customer, using the date each contact entered the stage. You can add or remove stages.
How is the source decided?
From HubSpot's original source property, such as organic search, paid social, referrals or direct traffic.
Can I backfill earlier weeks?
Yes. Run it by hand with a different start date for each past week, and each run adds that week's row.
What permissions does it need?
HubSpot contacts read; Sheets edit. 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 (weekly). 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 “Track weekly HubSpot lifecycle numbers in a sheet” from your assistant

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