Connecting Google Sheets

Last updated
On this page
On this page

Send the customer details your AI agent collects — names, phone numbers, requests — straight into a spreadsheet in your own Google Drive.

Watch the walkthrough

Connect

  1. Go to Settings → Integrations → Google Sheets.
  2. Click Connect and sign in with your Google account.
  3. A leads spreadsheet is created for you automatically — the page shows Connected as your Google email, with an Open the leads spreadsheet link.

Google Sheets integration

To save leads to a spreadsheet you already have, click Use an existing spreadsheet and pick it from your Google Drive.

How rows land

A customer’s row is added as soon as they reach your Flow Agent, and it keeps updating as they answer. To keep only some customers, see Only syncing conversations with certain labels. If the same customer chats with a flow again later, their row is updated instead of duplicated — so the sheet stays clean enough to work from directly.

The spreadsheet lives in your Google Drive: share it with your team, add your own columns, or plug it into any tool that reads Google Sheets.

Choosing the tab and columns

On the Google Sheets integration page you can decide exactly where leads land:

  • Tab — pick which tab of the spreadsheet new leads are saved to.
  • Column mapping — choose which sheet column each piece of data lands in (see What you can send to each column). Columns are read from your spreadsheet’s first row. Click Add mapping for each column, then Save mapping.
  • Without a mapping, the sheet fills automatically: phone, name, status, last update and every collected answer.
  • Match customers by — pick the sheet column that identifies the customer and the contact detail it holds (phone number or email). Click Add match condition to add fallbacks: the first condition that finds a row wins; otherwise a new row is added.
  • Test mapping — checks your columns against the sheet and writes a test row to your spreadsheet, then removes it again.

What you can send to each column

Pick any of these as Data to send for a column:

  • Contact fields — Contact name, Contact phone number, Contact email, First chatted at, Contact ID, Company, City, Country, WhatsApp username and WhatsApp ID. For WhatsApp customers who have no phone number, add WhatsApp ID as its own column to tell them apart.
  • Inbox — Inbox name, Inbox ID, Channel, and Inbox phone number: the WhatsApp or SMS number the customer messaged. It stays empty for channels without a number, such as Instagram or your website.
  • Assignment — Assigned agent name, Assigned agent email, Team, and the Flow agent that talked to the customer.
  • Conversation — Conversation ID, Conversation link (opens the chat in Mampu AI), Status, Priority, Labels, Conversation started at and Last activity at.
  • Contact custom attributes and Conversation custom attributes — every attribute set up under Settings → Custom Attributes.
  • Ad source — Ad / post ID, Ad / post title, Ad / post URL and Ad / post content of the ad the customer last tapped, plus Ad click ID, Latest ad click time and Ad click count. See Tracking ad clicks.
  • Flow answers — the answers your Flow Agents collect. When a customer answers with a file, such as a CV or a receipt, the column gets a link to the file. The link opens only for teammates who are signed in and can see that chat, so a shared sheet does not expose the files. See Who can open a file sent in a chat.

Each customer keeps one row, so the Inbox, Assignment and Conversation columns show their latest conversation.

Tracking ad clicks

Every tap on a Click-to-Message ad is recorded on the customer’s conversation: the tap that opened the chat, a tap on another ad while the chat is still open, and the same ad tapped again later. The Ad source columns show the latest tap, and the row updates within about a minute of it.

Ad click columns in the mapping

  • Ad click ID — the tap’s own ID from Meta. Two taps on the same ad have different IDs. Facebook and Instagram ads carry no click ID, so the column stays empty for them.
  • Latest ad click time — when the latest tap happened, on your company clock.
  • Ad click count — how many taps the conversation has had.

To count ad leads for a period, map Latest ad click time and filter on it: a returning customer who taps again keeps their one row, and the time moves to their latest tap. These three columns change with every tap, so they can’t be chosen under Match customers by.

Keeping the agent and team up to date

  • When someone assigns the conversation to an agent or a team, or changes either one, the customer’s row updates within about a minute. You don’t have to wait for the customer’s next message.
  • When a conversation is unassigned or its team is removed, the columns mapped to Assigned agent name, Assigned agent email and Team are cleared, so the sheet matches what you see in Mampu AI.
  • Other empty values never overwrite what’s already in your sheet.
  • Labels and status refresh whenever the row updates: when the customer answers, when the agent or team changes, or when an automation rule runs Sync lead to Google Sheets.

Per-agent sheets

Under Per-agent sheets, give a Flow Agent its own spreadsheet with its own column mapping: choose the Flow agent, then Pick a sheet from Drive or Create a new sheet. Agents without their own sheet keep using the default spreadsheet. Click Use the default sheet to switch an agent back — its own sheet stays in your Google Drive.

If you remove the default spreadsheet with Remove default sheet, leads only sync where your automation rules or per-agent sheets send them.

Only syncing conversations with certain labels

By default, every customer who reaches your Flow Agent gets a row. To keep only some customers, such as shortlisted applicants, use Only sync conversations with these labels on the default sheet or on an agent’s own sheet, then click Save mapping.

  • Pick one or more labels, or type a word to match every label that contains it.
  • Leave it empty and everyone syncs, as before.
  • With labels chosen, a customer’s row is added or updated only while their conversation or contact has one of the labels.
  • Adding the label later writes the row within about a minute, with everything collected so far.
  • Removing the label keeps the row that’s already in your sheet.
  • Renaming a label updates the setting for you.
  • Sync lead to Google Sheets automation rules are not filtered: they write whenever they run.

For example, give your hiring bot its own sheet with the label Qualifying Applicant. Applicants appear in that sheet as soon as your team adds the label, and everyone else stays out of it.

Syncing leads from an automation rule

The Sync lead to Google Sheets automation action writes a conversation’s lead row at the moment you choose — for example when a conversation is resolved or when a label is added. It’s useful for details that arrive after the flow has ended, such as a label your team adds later.

  1. Connect Google Sheets as described above.
  2. Open Settings → Automation, click Create Automation, and pick the Event and any Conditions.
  3. Under Actions, choose Sync lead to Google Sheets.
  4. Keep Integration default sheet, or switch to Custom sheet & tab (see below).
  5. Click Create.

With Integration default sheet, the row goes to the sheet and column mapping set up on the Google Sheets integration page:

  • A conversation handled by a Flow Agent updates that customer’s existing row, and the agent’s own sheet and mapping apply if it has them.
  • Conversations your team handled without a Flow Agent sync too: their contact and conversation details go to the default sheet.

Sending to a custom sheet and tab

Each rule can write to its own spreadsheet, tab and columns, so different rules can feed different sheets you already use.

  1. On the Sync lead to Google Sheets action, switch to Custom sheet & tab.
  2. Click Choose spreadsheet and pick one from your Google Drive.
  3. Select the Tab.
  4. Map the tab’s columns to lead fields. Leave the mapping empty and the standard lead columns are written for you.
  5. When you map columns, add a condition under Match customers by so each customer’s row is found and updated — the rule can’t be saved without one.
  6. Click Test mapping to check it — a test row is written to your spreadsheet and removed again — then save the rule.

Disconnecting

Click disconnect on the same page to stop new leads from being saved. The spreadsheet itself stays in your Google Drive with everything collected so far.