Finance · USE CASE

Build a customer health score from billing, usage and support.

Score every paying account on failed payments, falling usage and support load, then flag the ones at risk in HubSpot.

Data sources
Assistant
Destination
Try it with your data Free with up to 3 data sources · No credit card
A WORKED EXAMPLE

How do I build a customer health score from data I already have?

StatusAccountsBilled per month
At risk3$4,200
Watch5$5,700
Healthy14$14,400

Stripe invoices Jul 24–Nov 20, 2026 · PostHog weeks of Sep 21–Nov 9 · Zendesk and HubSpot read Nov 20

24 customers were invoiced in the last 120 days, and 22 of them could be scored. 3 are at risk and 5 need watching, together $9,900 of the $25,200 billed each month. 2 of the 3 at-risk accounts have paid every invoice, so billing shows nothing wrong with them. 2 accounts could not be scored because their billing email does not lead to a usage row, and they stay on the list.

WHERE THE RESULT GOES

HubSpot

Apply the change, then check the updated record.

Example use case

Ask. Follow up.
Take the next step.

✦ AI assistantSample use case
StripePostHogZendeskHubSpot
YOU

  1. 01
    Score under 50 · usage down by more than half or stoppedOpen a task for each owner

    Next

  2. 02
    Score 50 to 79 · one strong signal or two mild onesWrite the reason to the company

    Next

  3. 03
    Score 80 or more · invoices paid · usage steadySet the status, no follow-up

    Next

  4. 04
    The billing email does not lead to a usage rowFix the match by hand

    Next

Stripe invoices Jul 24–Nov 20, 2026 · PostHog weeks of Sep 21–Nov 9 · Zendesk and HubSpot read Nov 20

01 · CONNECT YOUR DATA

Your tools. One place to ask.

4 of 3 Free data sources
No credit card · Daily refresh

DatapipeYour project
Your AI assistantor a report in Sheets / Data Studio
  1. Create your free workspace

    Sign up with your company email. Your first project opens on Data sources.

  2. Add the data sources

    Choose the accounts for this use case. Authorize access and select the property or site.

  3. Bring your question

    Connect your project to a supported AI assistant, or build your source reports.

Create a free account →
Setup steps & what you need

Email/password signups confirm their email first. Use Google signup with a company account if you prefer.

  • Stripe: Authorize the intended Stripe account using its supported sign-in or dedicated read-key setup. Setup guide ↗
  • PostHog: Add the PostHog Cloud project that holds your product events, on the US or EU region, using its supported sign-in or a personal API key limited to that project with read access to insights. Save the weekly trend insight in that project first. Setup guide ↗
  • Zendesk: Enter your Zendesk subdomain and authorize the intended account using its supported setup. Setup guide ↗
  • HubSpot: Add the intended HubSpot account using its supported sign-in or dedicated token setup. Setup guide ↗

Free includes 3 data sources across the workspace. One account/property added to one project counts as one. Extra properties or the same account in another project use another slot.

02 · ASK A USEFUL QUESTION

Start with a prompt.
Follow the evidence.

Copy these in order into your connected assistant.
Each builds on the answer before it.

01

Find the paying accounts and their data

Read the full prompt
Use only this Datapipe project’s authorized data. Discover the connected accounts, datasets and compatible fields first. Confirm dates, timezones, currencies and data coverage. Keep missing or unmatched rows visible; never substitute sample data. Compare the sources explicitly and explain every match. Do not change source records or send messages.

Read Stripe invoices for the last 120 days with invoice.customer, invoice.customer_name, invoice.customer_email, invoice.created, invoice.status, invoice.billing_reason, invoice.currency, invoice.amount_due, invoice.amount_remaining, invoice.attempt_count and invoice.next_payment_attempt. Take the email domain of each customer as the account key. Read PostHog Saved insight inventory and find my saved weekly trend that is broken down by company domain. Read Zendesk Current users and Expanded current tickets, and HubSpot companies with Company name, Website, Record ID and the company owner. Tell me how many customers were invoiced, how many have an open invoice, which billing emails are on a free mailbox, and when the PostHog insight was last refreshed.
02

Inspect the evidence for each account

Read the full prompt
For each customer, list the open invoices with invoice.attempt_count and invoice.next_payment_attempt. Read PostHog Saved trend buckets for that insight with Native time bucket, Breakdown value (JSON), Count calculation and Native count value. Leave out the current, unfinished week, then compare the last 4 complete weeks with the 4 before for each domain. Join Zendesk requester id to the user’s Record ID, take the email domain, and count tickets created in the last 30 days, open tickets with Priority urgent, and tickets still open after more than 7 days. Match each domain to a HubSpot company Website. List every account you could not match in any one of the four data sources, and do not treat two similar domains as the same company.
03

Score the accounts and propose the changes

Read the full prompt
Score each matched account out of 100: billing 30, usage 40, support 30, with full points when fine, half when it needs watching and none when it is a risk. Billing is a risk with an open invoice at 2 or more payment attempts or an uncollectible invoice, and needs watching for any other open invoice. Usage is a risk when it is down 50% or more or there is nothing in the last 2 weeks, and needs watching when it is down 25% to 50%. Support is a risk at 5 or more tickets in 30 days or an open urgent ticket, and needs watching at 3 or 4 tickets or a ticket open for more than 7 days. Call 80 or more Healthy, 50 to 79 Watch and under 50 At risk. Show the table with the evidence behind every score and keep the accounts you could not score in their own list. Then propose the changes and wait for my approval: set my Health status property on each matched HubSpot company, write the evidence to my Health reason property on each Watch and At risk company, and create an Asana task due in three working days for each At risk account. Tell me what stays with me, such as failed payments and the calls themselves.

03 · USE WHAT YOU FIND

Score each account, then write the result where the team works.

  1. 01

    Read billing, usage, support and the company list.

  2. 02

    Match everything on the company’s email domain.

  3. 03

    Score each account, then write the result where the team works.

Make the change

The assistant proposes each change with the company, the new status and the evidence behind it. You approve the list, Datapipe makes each change and records it in the change history: who made it, when, and what was sent. A change waits in Datapipe for a second approval only when the data source or the person is set to need one.

  • Update any approved company propertyhubspot.company.fields

    Sets company properties you created for this on the 21 scored companies that exist in HubSpot: a Health status dropdown with Healthy, Watch and At risk, and a Health reason text property that holds the score, the date and the evidence for the 8 Watch and At risk companies (open invoices and payment attempts, the usage change, the ticket counts). You choose which properties Datapipe may change, and HubSpot lists, views and reports can then use the status.

  • Create a task in the projectasana.task.create

    If your team tracks follow-ups in Asana, creates one task for each of the 3 at-risk accounts in the Asana project you added to Datapipe, with the evidence in the notes, a due date and an assignee when you name one.

Stays with your team. Retrying or chasing a failed payment, changing a subscription, refunds and credits stay with your finance team in Stripe. Calling the customer, deciding what to offer, replying to the open tickets, creating the missing HubSpot company and choosing the weights and thresholds stay with your team.

Check the result at your next review.

Run the score every Monday and keep each week’s table. After 30 days, read the tasks in your Asana project to see which of the 3 at-risk accounts were called, and compare each account’s score with four weeks earlier: usage recovering in PostHog is the first sign a call worked. At each renewal or cancellation, note the score the account had four weeks before. After a quarter you will see which signal warned you earliest, and you can move the weights toward it.

Implementation tips for this use case

Billing counts 30 points, usage 40 and support 30; each signal earns full points when fine, half when it needs watching and none when it is a risk. Billing is a risk when an open invoice has 2 or more payment attempts or an invoice is uncollectible, and needs watching for any other open invoice. Usage compares the last 4 complete weeks with the 4 before: down 50% or more, or nothing in the last 2 weeks, is a risk; down 25% to 50% needs watching. Support is a risk at 5 or more tickets created in 30 days or an open urgent ticket, and needs watching at 3 or 4 tickets or a ticket open for more than 7 days. 80 or more is Healthy, 50 to 79 is Watch, under 50 is At risk. These weights and thresholds are one team’s choice; change them to fit your product. You approve the list, and Datapipe writes the status and the reason to each HubSpot company and creates the tasks.

WHEN YOU NEED MORE CONTEXT

Go a little deeper.

The method and reporting checks
behind this example.

How to build a customer health score from billing, usage and support
  1. Read billing, usage, support and the company list.

    Add Stripe, PostHog, Zendesk and HubSpot to one Datapipe project. From Stripe, read the invoice resource for the last 120 days with invoice.customer, invoice.customer_name, invoice.customer_email, invoice.created, invoice.status, invoice.billing_reason, invoice.currency, invoice.amount_due, invoice.amount_remaining, invoice.attempt_count and invoice.next_payment_attempt; amounts are in the smallest currency unit, so divide USD by 100. In PostHog, save one trend insight that counts a key event per week, broken down by the property that holds the account’s domain, then read Saved insight inventory to find its Insight ID and Saved trend buckets for Native time bucket, Breakdown value (JSON), Count calculation, Native count value and Cached result refreshed at. From Zendesk, read Current users with Record ID, Email and Role, and Expanded current tickets with Ticket ID, Subject, Status category, Priority, requester id and Created at. From HubSpot, read companies with Company name, Website, Record ID and the company owner; these are current records, not filtered by date.

  2. Match everything on the company’s email domain.

    Take the part after the @ in invoice.customer_email, lowercase. That domain is the account key. Match it to the PostHog Breakdown value, to the email domain of each Zendesk requester (join requester id to the user’s Record ID), and to the HubSpot company Website. A billing email on a free mailbox such as gmail.com never matches, and a company that is billed at one domain and signs in from another will not match either. Keep those accounts in a Not scored list instead of guessing. Leave out the PostHog bucket for the current, unfinished week before comparing.

  3. Score each account, then write the result where the team works.

    Billing counts 30 points, usage 40 and support 30; each signal earns full points when fine, half when it needs watching and none when it is a risk. Billing is a risk when an open invoice has 2 or more payment attempts or an invoice is uncollectible, and needs watching for any other open invoice. Usage compares the last 4 complete weeks with the 4 before: down 50% or more, or nothing in the last 2 weeks, is a risk; down 25% to 50% needs watching. Support is a risk at 5 or more tickets created in 30 days or an open urgent ticket, and needs watching at 3 or 4 tickets or a ticket open for more than 7 days. 80 or more is Healthy, 50 to 79 is Watch, under 50 is At risk. These weights and thresholds are one team’s choice; change them to fit your product. You approve the list, and Datapipe writes the status and the reason to each HubSpot company and creates the tasks.

See the complete example report
EXAMPLE REPORT

How do I build a customer health score from data I already have?

Stripe invoices Jul 24–Nov 20, 2026 · PostHog weeks of Sep 21–Nov 9 · Zendesk and HubSpot read Nov 20

How do I build a customer health score from data I already have?
StatusAccountsBilled per month
At risk3$4,200
Watch5$5,700
Healthy14$14,400
WHAT TO LOOK AT24 customers were invoiced in the last 120 days, and 22 of them could be scored. 3 are at risk and 5 need watching, together $9,900 of the $25,200 billed each month. 2 of the 3 at-risk accounts have paid every invoice, so billing shows nothing wrong with them. 2 accounts could not be scored because their billing email does not lead to a usage row, and they stay on the list.

Score each account, then write the result where the team works.

Underhill Robotics scores 0: its Nov 3 invoice for $2,400 is still open after 4 payment attempts, report views fell from 8,200 to 3,100 (down 62%), and an urgent ticket is open. Tarrant Brewing scores 45 and has paid every invoice: report views fell from 2,400 to 880 (down 63%) and it opened 4 tickets in 30 days. Vexford Telecom scores 45, also fully paid: nobody there has viewed a report in the last 2 weeks, and its one ticket has been open for 12 days. Each has a different reason, which is why it is written next to the status. Selwick Housing (60) pays on time and has no tickets, but report views fell from 5,200 to 2,300 (down 56%); only PostHog shows it. Oakhurst Vets (70) has an invoice open after 3 payment attempts while usage is up 8%: a card to fix, not a customer leaving. Penrose Media (70) opened 6 tickets in 30 days and its usage is up 8%. Quenby Insurance and Rookfield Farms (65 each) show two mild signals. All 14 paid every invoice in the window, usage moved between −16% and +9%, and none opened more than 2 tickets in 30 days. Three of them (Bramhall Clinics, Eastwick Foods and Kelbrook Energy) have a ticket open or pending that was created in the last 7 days, which is normal support traffic. Wyncote Legal pays from wyncote.billing@gmail.com, and a free mailbox has no company domain to match on. Yarrowby Fitness is billed at yarrowby.example, but the only similar domain in PostHog is yarrowbyfit.example, so no usage row matched. The assistant does not guess that two domains are the same company.

Try the example with sample CSVs

Download the CSVs and attach them to your assistant to try the analysis.

Data method, reporting checks & sources

Add Stripe, PostHog, Zendesk and HubSpot to one Datapipe project. From Stripe, read the invoice resource for the last 120 days with invoice.customer, invoice.customer_name, invoice.customer_email, invoice.created, invoice.status, invoice.billing_reason, invoice.currency, invoice.amount_due, invoice.amount_remaining, invoice.attempt_count and invoice.next_payment_attempt; amounts are in the smallest currency unit, so divide USD by 100. In PostHog, save one trend insight that counts a key event per week, broken down by the property that holds the account’s domain, then read Saved insight inventory to find its Insight ID and Saved trend buckets for Native time bucket, Breakdown value (JSON), Count calculation, Native count value and Cached result refreshed at. From Zendesk, read Current users with Record ID, Email and Role, and Expanded current tickets with Ticket ID, Subject, Status category, Priority, requester id and Created at. From HubSpot, read companies with Company name, Website, Record ID and the company owner; these are current records, not filtered by date. Take the part after the @ in invoice.customer_email, lowercase. That domain is the account key. Match it to the PostHog Breakdown value, to the email domain of each Zendesk requester (join requester id to the user’s Record ID), and to the HubSpot company Website. A billing email on a free mailbox such as gmail.com never matches, and a company that is billed at one domain and signs in from another will not match either. Keep those accounts in a Not scored list instead of guessing. Leave out the PostHog bucket for the current, unfinished week before comparing. Billing counts 30 points, usage 40 and support 30; each signal earns full points when fine, half when it needs watching and none when it is a risk. Billing is a risk when an open invoice has 2 or more payment attempts or an invoice is uncollectible, and needs watching for any other open invoice. Usage compares the last 4 complete weeks with the 4 before: down 50% or more, or nothing in the last 2 weeks, is a risk; down 25% to 50% needs watching. Support is a risk at 5 or more tickets created in 30 days or an open urgent ticket, and needs watching at 3 or 4 tickets or a ticket open for more than 7 days. 80 or more is Healthy, 50 to 79 is Watch, under 50 is At risk. These weights and thresholds are one team’s choice; change them to fit your product. You approve the list, and Datapipe writes the status and the reason to each HubSpot company and creates the tasks.

The account list comes from Stripe invoices created in the last 120 days, so a customer on an annual plan who was invoiced before that is not on it; add those accounts by hand or read a longer billing history elsewhere. Usage is the last saved result of one PostHog insight. Datapipe does not rerun it, so refresh the insight before the review and check Cached result refreshed at. PostHog loads the first 25 values of a breakdown, so with more accounts than that, save one insight per plan or segment; an account with no usage row is Not scored, never zero usage. Zendesk tickets are matched through the requester’s email domain; archived tickets are not in the read, and a customer who writes from a personal address is not counted. The score is a weighted sum of three rules you can read, not a prediction. It tells you which accounts to look at first, not which ones will cancel.

  • The account list comes from Stripe invoices created in the last 120 days, so a customer on an annual plan who was invoiced before that is not on it; add those accounts by hand or read a longer billing history elsewhere.
  • Usage is the last saved result of one PostHog insight. Datapipe does not rerun it, so refresh the insight before the review and check Cached result refreshed at.
  • PostHog loads the first 25 values of a breakdown, so with more accounts than that, save one insight per plan or segment; an account with no usage row is Not scored, never zero usage.
  • Zendesk tickets are matched through the requester’s email domain; archived tickets are not in the read, and a customer who writes from a personal address is not counted.
  • The score is a weighted sum of three rules you can read, not a prediction. It tells you which accounts to look at first, not which ones will cancel.
  • Access to the intended Stripe account or property.
  • Access to the intended PostHog account or property.
  • Access to the intended Zendesk account or property.
  • Access to the intended HubSpot account or property.
  • The account list comes from Stripe invoices created in the last 120 days, so a customer on an annual plan who was invoiced before that is not on it; add those accounts by hand or read a longer billing history elsewhere.

For blended reports, align dates, normalized URLs, and reporting grain. Query-level search rows must not duplicate page-level sessions.

A FEW USEFUL ANSWERS

Before you start.

What should a customer health score include?

At least one signal each for whether the customer pays, whether they use the product and whether they are struggling. In this use case those are Stripe invoices and payment attempts, a weekly count of one key event in PostHog, and Zendesk tickets. Surveys such as NPS are a useful fourth signal if you run them. Three signals you can explain beat ten you cannot.

How do I calculate a customer health score?

Give each signal a weight, score it and add the results. Here billing is 30 points, usage 40 and support 30, with full, half or no points for each. An account with paid invoices (30), usage down 63% (0) and 4 tickets in 30 days (15) scores 45, which is At risk. Start simple, then adjust the weights once you can compare scores with the accounts that actually renewed or left.

Why not use the number of support tickets alone?

Because tickets measure contact, not unhappiness. In this example the account with the most tickets, 6 in 30 days, also increased its usage by 8%: a team that is rolling the product out and asking questions. Two of the three at-risk accounts opened fewer tickets than that. Silence combined with falling usage is the more worrying pattern, and only the combination shows it.

Does a failed payment mean the customer is about to leave?

Not by itself. Cards expire and banks decline charges for reasons that have nothing to do with the product. Stripe retries a failed subscription payment on a schedule you set, and invoice.attempt_count shows how many attempts were made. A failed payment next to steady usage is a billing task. A failed payment next to falling usage and an urgent ticket is a customer at risk.

Do I need PostHog group analytics for this?

No. Group analytics is a paid PostHog add-on that lets you break a trend down by a group property. Any property that holds the account’s domain works as the breakdown, including a person or event property you already send, as long as its values match the domain your customers are billed at.

Can I use another billing or support tool?

Yes, the method is the same. Chargebee gives Datapipe every current subscription with its next billing date and the number of due invoices, which also covers annual plans. Freshdesk tickets can replace Zendesk, matched to the customer through the contact’s email. Check which fields each data source returns before you copy the thresholds.

YOUR NEXT STEP

Try it with your own data.

Start free with up to 3 data sources. No credit card.

Start free →