Skip to content
  1. Home
  2. Help centre
  3. Connect Google Ads

Ad spend

Connect Google Ads

A small Google Ads Script sends your daily campaign costs to your store. It’s free and needs no developer approval from Google. Setup takes a few minutes.

How the script works

The script runs inside your Google Ads account. On each run it reads cost per campaign, per day, for the last 30 days and posts it to your site. Balanik replaces the saved costs for those days with the new ones. Late corrections from Google land too, and nothing is counted twice.

Nothing leaves your store. The script sends costs in; your orders and customers stay on your site.

Set up the script

  1. In WordPress, open Balanik, go to the Ad spend tab and find the Google Ads card.

  2. Open Set up the script and press Create script. The script appears in a box with its own key inside.

  3. Press Copy script. Copy it now: the key is shown only once.

  4. In Google Ads, open Tools → Bulk actions → Scripts, add a new script and paste it in.

  5. Authorise the script, press Preview once, then press Run.

  6. Set the script’s frequency to Hourly.

Use the store’s time zone. The Google Ads account must use the same time zone as your store. The card shows which one that is. If they differ, Balanik turns the costs away, so no day’s spend lands on the wrong day. You’ll see the reason in the script’s log in Google Ads.

Check that it’s working

The Google Ads card shows the status of the script:

  • Waiting for first run means you’ve created the script, but no costs have arrived yet.
  • Receiving means costs have arrived. Last push shows when.

Each run updates the costs in your reports. Your site accepts one push per minute. That limit only matters if you run the script by hand several times in a row.

Common questions

Can I bring in more than 30 days of history?

The script sends the last 30 days by default. The number is set by the DAYS line near the top of the script. Your site accepts up to 93 days in one push, so you can raise it to 93 for one run, then set it back to 30.

What if I lose the script or think the key leaked?

Open Set up again and press Create a new script (switches off the old key). The old script stops working at once. Paste the new one into Google Ads in place of the old one. Your site stores only a hash of the key, never the key itself, which is why it can’t show it again.

My Google Ads account bills in another currency

The script sends the account’s currency with the costs. Add an exchange rate for that currency under Costs → Exchange rates, or the costs can’t be converted to your store’s currency.

Can I assign Google campaigns to products?

Allocating Google Ads Script campaigns to products is coming in an update. Their spend already counts in your store’s profit.

Advanced: the Google Ads API

If you already have your own Google Ads developer token, approved by Google, you can connect through the API instead. Open Advanced: direct Google Ads API on the same card. It asks for:

  • Ad account ID and, if you use one, Manager account ID (optional)
  • API version, which starts at v24
  • Your OAuth client id, client secret and refresh token, plus your developer token

Press Verify and save. As with Meta, Balanik checks the account’s currency and time zone before it saves. This route refreshes like Meta does: while the dashboard is open, and hourly in the background if you switch that on. Most stores don’t need it. Use the script unless you have a reason not to.

What to do next