Ybyatã: Google Ads API tool design
Updated 4 October 2026 · Ybyata Growth Operations Ltda
What we use the API for. For the Google Ads accounts of the local businesses we manage under our manager account (health clinics among them): reading how each campaign spent and delivered (reporting); sending offline conversions when a lead the ad brought books, attends or buys; linking an account to our manager account and setting up its conversion tracking; and making the campaign changes our team approves, one by one: a campaign's daily budget, negative keywords, and new Search campaigns, which are created paused.
Where it stands. The platform is built and runs on Google Cloud in São Paulo; the first client is being onboarded, and today the only account linked under our manager account is Ybyatã's own. The screenshots below are the real product, with demonstration data (no real patients). This page replaces the version that described reporting and conversions only, and is kept up to date with what the tool does.
1. Company and business model
Ybyatã Growth Operations (ybyata.com) is a Brazilian marketing agency and software company. It runs paid acquisition on Google Ads and Meta for local businesses that advertise, health clinics first among them. Clients pay a monthly fee. In exchange, Ybyatã runs their campaigns and operates the software that follows every lead from the ad click, through the WhatsApp conversation with the business, to a booked appointment, a visit and a sale.
The Google Ads accounts of clients are linked under Ybyatã's manager account (MCC). Ybyatã's team operates them, in the Google Ads interface and, for the changes described in 3.4, through this tool.
2. What the tool is
A web application hosted by Ybyatã on Google Cloud in São Paulo (southamerica-east1): an API service (Python) and a web app, on Cloud Run, with PostgreSQL on Cloud SQL. Every person signs in with an individual account. Each client business is a tenant, and its data is isolated by PostgreSQL row-level security: the application connects as a database role that cannot bypass it.
The client's team uses it for their WhatsApp inbox, their schedule and their reports. Advertising results appear on the Reports screen, where the owner sees what each campaign cost against the appointments and sales it actually produced. Campaign changes are proposed and approved on a separate screen that only Ybyatã staff see (3.4).
The Google Ads API is called only by this application's server: by background jobs, and by actions a member of Ybyatã's staff takes in the tool. It always uses Ybyatã's own credentials. No client user authenticates with Google or calls the API. The tool is not sold or licensed to third parties.
3. API usage
3.1 Reporting (read)
Every six hours, for each linked account, a job reads the last seven days with GoogleAdsService.SearchStream, since Google restates recent spend:
- campaign spend per day (
campaign,metrics.cost_micros,segments.date); - delivery per day at campaign, ad group and ad level: impressions, clicks, cost, conversions and, on Search, impression share;
- once a week, the search terms report (
search_term_view), which the negative keywords in 3.4 come from.
Results are stored per object per day. They feed the Reports screen (ad spend, the cost of each booking and each lead, the client's result) and the analysis our team's tools run on each account.
3.2 Offline conversions (write)
The client's landing page stores the click id (gclid, wbraid or gbraid) with the lead it captures. When that person books an appointment, attends it or buys, the platform records a conversion against one of the account's three conversion actions (scheduled, attended, purchase), and a job sends it:
- through the Data Manager API (
events:ingest), as Google requires of new integrations; what Google made of each request is read back later (requestStatus:retrieve); - with the click id, the conversion action, the date and time, the currency and, for a sale, its value;
- when there is no click id, only for a lead who came through a landing-page form and agreed to its text: the person's phone number and e-mail, hashed with SHA-256 (enhanced conversions for leads). Nothing else about the person is sent: no name, no conversation, no health information;
- with our own event id as the order id, so a retried upload never counts twice.
When a sale is refunded, the conversion is retracted with
ConversionAdjustmentUploadService (uploadConversionAdjustments, RETRACTION), by
the same order id. Conversions older than 90 days are not sent.
A booking becomes a conversion only when a person on the client's team confirms it. The platform reads the WhatsApp conversation and proposes what happened; the team approves or corrects it:
3.3 Linking an account and setting up conversion tracking (write)
Each of these is started by a member of Ybyatã's staff, from the client's page in the tool:
- Linking: CustomerClientLinkService invites the client's existing account under our manager account (status PENDING). The client's admin accepts it in Google Ads; a job reads
customer_client_linkevery 15 minutes while an invitation waits. The tool can also ask CustomerService.CreateCustomerClient to open a new account under the manager account, in BRL and São Paulo time; Google currently refuses this for our manager account, and the client's own account is invited instead. - Billing: the tool reads
billing_setupto know when the account can run ads. It never handles payment details; the client adds billing in Google Ads. - Auto-tagging: once linked, CustomerService turns on auto-tagging, so clicks carry a gclid.
- Conversion actions: ConversionActionService creates the three conversion actions in 3.2, named as ours, or finds them when they already exist, and staff choose which one counts toward the account's goals. Conversion actions the client already had are shown, never changed or removed.
3.4 Campaign management, approved by our staff (write)
Our tools read each account's results and propose changes. Every change is reviewed by a member of Ybyatã's staff on a screen the client never sees: approved or declined, one by one. Applying an approved change is a second, explicit action, which first reads the current value from Google and shows what it will become. Nothing is changed on Google without both.
| Change | API | Safeguards in code |
|---|---|---|
| A campaign's daily budget, up or down | CampaignBudget |
One step at a time, within the step limit of the strategy that proposed it. Never past the client's monthly ad budget, and nothing goes up when no monthly budget is set. Refused if the budget changed in Google Ads since the proposal. |
| Negative keywords on an ad group (exact match) | AdGroupCriterion |
Only adds. Undoing removes only the keywords this tool added; the client's own are never removed. |
| A new Search campaign from a tested recipe: its budget, location and language targeting, ad groups, keywords, negatives and a responsive search ad our team approved | GoogleAdsService. |
Created paused, after staff review the full plan. Refused when the daily budget doesn't fit in the client's monthly ad budget. Staff turn it on with CampaignService (status ENABLED); pausing it again is the undo. |
For every change, the value it replaced is kept, and the change can be reverted within seven days. Nothing is ever deleted from a Google Ads account: no campaigns, ad groups, ads or keywords of the client's. There is no automated bidding logic; bidding is left to Google's own strategies. Only the production deployment writes to Google Ads; development and test copies of the tool cannot.
4. Architecture and data flow
Client's landing page --lead + gclid--> Ybyatã platform (lead record)
WhatsApp Cloud API --webhook-------> Ybyatã platform (conversation, appointment, sale)
Platform background jobs <----------> Google Ads API
every 6 h: SearchStream (spend and delivery per day; search terms weekly)
every 15 min, while an invitation waits: customer_client_link, billing_setup
from a queue ----------------------> Data Manager API: events:ingest (scheduled / attended / purchase)
Google Ads API: uploadConversionAdjustments (refunds)
Ybyatã staff, in the tool ---------> Google Ads API
link an account, auto-tagging, conversion actions
approved changes: budgets, negative keywords, Search campaigns (created paused)
Ybyatã's OAuth client and refresh token, login-customer-id = Ybyatã's manager account
Ybyatã platform ---> Reports for the client's owner, and for Ybyatã staff
Credentials: the OAuth client and refresh token are Ybyatã's, issued for the Google Cloud project that holds our API access; the requests also carry our developer token. They are kept in Google Secret Manager and read by the server at runtime; they are never in the database or in the browser. Per-client Google data (the customer id and the conversion action ids) lives in the database with the client's other settings.
How personal data is handled:
- The database, files and the AI models the platform uses (Vertex AI) are all in São Paulo (southamerica-east1).
- The database is on a private IP, accepts TLS connections only, and is encrypted at rest by Cloud SQL. Each client's rows are isolated by row-level security.
- The access tokens clients connect (WhatsApp, payments) are also encrypted by the application, with a key kept in Secret Manager. Photos and voice notes sit in a private bucket and are served only through the application.
- Ybyatã staff access to a client's data is audited. Access records are kept six months, as Brazilian law (Marco Civil da Internet) requires.
- Toward Google, a person's data leaves only as a click id or as SHA-256 hashes of phone and e-mail, attached to a conversion. Conversations and health information are never sent.
- The client is the controller of its customers' data and Ybyatã the processor, under Brazil's LGPD. Our privacy policy has the details.
5. Volume and rate limits
- Fewer than 10 linked accounts in the first year.
- Reporting: four SearchStream requests per account every six hours, and one more a week for search terms.
- Conversions: a few dozen per account per day at most.
- Campaign changes: a few per account per week, each approved by a person.
- Expected total: well under 1,000 operations per day. Transient errors (RESOURCE_EXHAUSTED, 5xx, network) are retried later with backoff; a rejected request is not retried.
6. Users and access
| Who | What they see | Google Ads data |
|---|---|---|
| Ybyatã staff | The clients they manage. | Review and approve campaign changes in the tool; link accounts and set up conversion tracking; operate the accounts in the Google Ads interface. |
| Client owners and managers | Their own business. | Spend, cost per booking and results for their own campaigns. |
| Client front desk | Conversations, schedule, approvals. | None. |
The tool is not offered to the general public.
7. Contact
Ybyata Growth Operations Ltda, CNPJ 68.452.751/0001-82, R. Pais Leme, 215, Conj. 1713, Pinheiros, São Paulo/SP, Brazil · [email protected] · [email protected]