# Google Ads

See what your Google Ads really earn. twelvebit puts the spend of each campaign next to the visitors, the customers and the revenue that the campaign brought, and shows the return on ad spend (ROAS). It works for Search, Shopping, Display, YouTube and Performance Max campaigns.

> You connect with a short script that runs in your own Google Ads account. You need no Google sign-in, no developer token and no Google tag on your site. The script only reads your account. It never changes a campaign, a budget or a bid.

## What you get

- **Spend, clicks and impressions per campaign**, for every day, from the first day of the last 120 days.
- **Visitors, customers and revenue per campaign** from your own twelvebit data.
- **ROAS, cost per visitor and cost per customer** for each campaign and for the account.
- **Every ad click matched to its campaign** by the Google click ID (`gclid`), also when your ads have no UTM tags.
- **Meta and Google side by side** on the **Ads page**, with a spend and revenue chart and one tile for each platform.
- **Spend in your site currency.** twelvebit converts the account currency for you.

## Before you start

You need four things:

1. **Edit access** to the site in twelvebit (owner or member).
2. **Admin or Standard access** to the Google Ads account. Google asks this person to authorize the script.
3. **Auto-tagging on** in Google Ads (Admin → Account settings → Auto-tagging). It is on by default.
4. **Payments in twelvebit**, so that revenue can count. See [Revenue](/docs/revenue). Without payments, the Ads page shows spend and visitors, but no revenue.

## Connect in five minutes

1. In [twelvebit](https://twelvebit.app/sites), open your site, then **Settings → Integrations → Google Ads**, and click **Get the script**. Copy it with the **Copy** button.
2. In Google Ads, open **Tools → Bulk actions → Scripts** and click **+** to make a new script.
3. Name the script **twelvebit**. Replace all of the code with the script, then click **Authorize** and allow access.
4. Click **Run**, then choose **Run without preview**. The script only reads, so a preview has nothing to show. The first run reads 120 days of spend and takes a minute or two.
5. Google opens the **Script history** tab. Go back to the **Scripts** tab, click the dash in the **Frequency** column of the twelvebit script, choose **Hourly** (or **Daily**), and save.

Go back to twelvebit. The setup checklist in Settings turns green by itself, and the account shows on the Ads page.

> The script contains the key of your site. Keep it private, as you keep a password. If someone else gets it, click **New key** in Settings and paste the new script in Google Ads.

## The checklist in Settings

| Line | What it means |
|---|---|
| **The script runs in Google Ads** | The last run finished, and the time shows next to it. |
| **Spend per campaign arrives** | The script sends the spend. "received, no spend yet" is normal before your ads start to run. |
| **Visits matched to campaigns by gclid** | twelvebit found the campaign of at least one ad click. This line turns green after the first click on an ad. |
| **! Late** | No run finished for more than a day. Check the frequency and the last log of the script in Google Ads. |

## How visits match campaigns

twelvebit links a visit to a campaign in three ways. You do not have to choose; it uses all of them.

1. **The Google click ID.** With auto-tagging, Google adds `?gclid=…` to the address of each ad click. twelvebit stores it with the visit, and the script reports which campaign it belongs to. This needs nothing from you.
2. **`utm_campaign`.** A visit belongs to a campaign when its `utm_campaign` is the campaign name (in any case) or the campaign ID.
3. **A `utm_id` property** with the campaign ID, sent by your own code.

To give visits UTM tags too, add this to the **Final URL suffix** of the account (Admin → Account settings → Tracking):

~~~text
utm_source=google&utm_medium=cpc&utm_campaign={campaignid}&utm_content={creative}&utm_term={keyword}
~~~

**Revenue** counts each payment whose credited visit (the last visit before the payment) belongs to the campaign. Refunds take money off. **Customers** counts the people whose first payment came from the campaign.

When a Meta campaign and a Google campaign have the same name, a visit counts for one platform only: a visit with a Google click or a Google `utm_source` never counts for Meta, and a visit with a Meta `utm_source` never counts for Google.

## The Ads page

- **Headline.** One sentence that says how much revenue each 1 of spend brought back, and which campaign did best.
- **Platforms.** With Meta and Google both connected, a split bar shows each platform's share of the spend, and a tile for each platform shows its ROAS. Click a tile, or use **All platforms · Meta · Google** at the top, to see one platform.
- **Spend and revenue chart.** **Running total** shows where revenue stays above spend: there, the ads paid for themselves. **Per day** shows the spend of each day as bars, and the revenue as a line.
- **Campaigns.** Spend, clicks, visitors, customers, revenue and ROAS for each campaign, sorted by spend. Hover a row for impressions, click rate and cost per customer.

Spend days follow the time zone of the ad account. Revenue days follow the time zone of the site.

## Manager accounts (agencies)

A manager account holds the Google Ads accounts of several clients. You are in one when Google Ads shows a list of accounts after you sign in.

- **Best:** open the client account itself (click its name in the list) and add the script there. You change nothing in the script.
- **From the manager account:** put the 10-digit customer ID of the client account between the quotes of `CLIENT_ACCOUNT_ID` at the top of the script:

~~~js
var CLIENT_ACCOUNT_ID = "123-456-7890";
~~~

Without it, the script stops and Settings shows the error. Each twelvebit site connects one Google Ads account.

## Privacy

- twelvebit stores the `gclid` of a visit **only for sites that connect Google Ads**. Other sites never store it, but an ad click still counts in the Paid channel.
- A stored `gclid` goes after 95 days (Google keeps click data for 90 days), and at once when you disconnect Google Ads.
- The script sends only campaign names and IDs, the daily spend, impressions and clicks, and the campaign of each click ID. It sends no search terms, no audiences and nothing about the people who clicked.
- The key of the script is stored encrypted, and twelvebit stores no Google password or token.

## When something is wrong

| What you see | Why | What to do |
|---|---|---|
| The checklist stays at **Waiting** | The script has not run, or it was not authorized. | In Google Ads, open the script and click **Authorize**, then **Run → Run without preview**. |
| **The key is not valid** in the script log | Someone made a new key in Settings. | Click **Show the script**, copy it, and replace the code of the script in Google Ads. |
| An error about a **manager account** | The script runs in a manager account without `CLIENT_ACCOUNT_ID`. | See [Manager accounts](#manager-accounts-agencies). |
| **! Late** | The script has no frequency, or it fails. | In Google Ads, open **Scripts** and check the **Frequency** and the last log. |
| Spend shows, but **0 visitors** | Auto-tagging is off, or a redirect on your site removes `?gclid`. | Turn on auto-tagging, and add the final URL suffix above. |
| Visitors show, but **no revenue** | Payments are not connected, or they do not carry the visitor. | See [Revenue](/docs/revenue). |
| A **new key** is necessary | The script was shared by mistake. | Click **New key** in Settings. The old script stops at once. |

## Disconnect

Click **Disconnect** in Settings → Integrations → Google Ads. twelvebit deletes the key, the stored spend and the stored click IDs. Then delete the twelvebit script in Google Ads (Tools → Bulk actions → Scripts), because it can no longer send anything.

## API and MCP

`get_integrations` (MCP) and `GET /api/v1/integrations` (REST) show `google_ads` with the account name, the customer ID, the currency, the days with spend and the visits matched by `gclid`. `disconnect_integration` (MCP) and `DELETE /api/v1/integrations/google_ads` (REST) disconnect it. A key or a script never shows in the API.

---

Source: https://twelvebit.app/docs/google-ads · All docs: https://twelvebit.app/llms.txt
