Connecting Google Ads
Qubix pulls your Google Ads campaigns, ads and spend in through a small Google Ads Script that you install once in your Google Ads account. The script is the whole integration: the interconnect address and your personal key are already inside the code, so the connection takes a copy and a paste. The script is taken on the page of a tracker campaign whose traffic source is Google, and what it brings belongs to that campaign: the account's Google campaigns, their spend and the conversions Qubix sends back to Google. Once the script runs on a schedule, your Google ads show up in Qubix with the same reports, and Britva can pause and re-activate them.
Before you start
- You need access to the Google Ads account you want to connect.
- In Qubix you need a tracker campaign whose traffic source is made from a Google template (for example, Google Ads), the Tracker kampanyalarını yönet permission and the right to edit that campaign. A demo account is refused the code.
Step 1 — Generate the script in Qubix
- In the Kampanyalar section, open the tracker campaign whose traffic source is Google. When the list holds only campaigns of other sources, create a new one and save it: the item appears on a saved campaign.
- In the campaign card, open the Google Ads item of the Ayarlar group and, in the Hesap komut dosyası group, click Komut dosyası oluştur: the script opens below, with the steps to install it. The groups of the item are described in Google Ads in a tracker campaign.
- Click Kopyala in the corner of the code — the whole script is now on your clipboard. The interconnect address and your personal key are already baked into the code, so every field is filled in. The key also names this campaign — see How Google campaigns attach to a tracker campaign.
Step 2 — Paste the script into Google Ads
- In Google Ads, open Tools → Bulk actions → Scripts.
- Click the blue + to create a new script.
- Select all the default code in the editor and delete it, then paste the code you copied from Qubix. The first line must read
// Qubix connector for Google Ads.— if afunction main()stands at the top, the default template is still in the editor and Google shows "script has multiple main functions". Below the first line come the lines with the address and your key, and then the whole script in one long line: Qubix gives it out compressed. - Click Authorize, pick your Google account and allow access.
- Click Save.

Step 3 — Set the schedule to Hourly
This step is easy to miss and the connection needs it: a script runs once until a schedule is set.
- Click Close to return to the Scripts list.
- In the qubix row, click the value in the Frequency column.
- Choose Hourly and click Save.

The row should now show Frequency: Hourly and Status: Enabled.

Open the script and click Run once (or use Options → Run in the Scripts list). This syncs immediately. The campaigns and ads come through even when the spend part of the sync fails.
Step 4 — Check the connection in Qubix
Open the Google Ads window (it needs the Servis anahtarlarını yönet permission) and look at the Hesaplar tab. After the first run your account appears there with the Bağlantı status çevrimiçi — see Accounts. The account's campaigns and ads are on the Reklam kampanyaları and Reklamlar tabs of the same window, and the cards of a Google campaign and a Google ad open from them. Britva rules apply to Google ads just like to Facebook ones.
The Google campaigns attached to your tracker campaign appear on the Reklam kampanyaları item of its card, with the figures for the period; a Google campaign without traffic in the period stands there with zeros.
How Google campaigns attach to a tracker campaign
The key in the script names the tracker campaign the code was taken on. On every sync, the account's Google campaigns that are still free of any tracker campaign are attached to this one. A Google campaign belongs to one tracker campaign at a time. From then on:
- in the Kaynaklar list, the spend, clicks and conversions of its ads are counted under the source of that tracker campaign;
- its conversions go to Google by the event map of that source — see Conversions back to Google.
The money of Google ads that stand outside every tracker campaign stands in the Google: tracker kampanyası yok row of the source list — see Sources.
The sync of spend, ads, Britva commands and conversions goes on in every case. The binding of new Google campaigns runs while three things hold:
- the key was taken on the page of a tracker campaign (only a key that names a campaign binds Google campaigns);
- the campaign of the key exists, and its source is a Google one;
- the person who took the key may edit the campaign of the key.
To attach the account's new Google campaigns again, take the code on the page of a tracker campaign and replace the script in Google Ads with it.
When a tracker campaign is deleted, its Google campaigns are detached and become free: the next sync of the account's script with a key of a live campaign on a Google source attaches them to that campaign.
Move a Google campaign to another tracker campaign
The Google campaigns of one account can be split between several tracker campaigns on a Google source.
- Open the tracker campaign the Google campaign should belong to.
- In its Google Ads item, in the Buraya bir Google kampanyası taşı row, pick the Google campaign in the Başka bir kampanyadan… list. Each entry shows the Google campaign and the tracker campaign it belongs to now.
- Confirm the move with Uygula.
The list offers the Google campaigns of your other tracker campaigns on a Google source — those you may edit. A tracker campaign with attached Google campaigns accepts another Google source as the only replacement of its source. A source whose campaigns hold Google campaigns keeps the Google template and stays until the Google campaigns move to campaigns on another Google source. The elements of the row are described in Google Ads in a tracker campaign.
The ad number in the click
To tie a visit to its ad, every Google click has to carry the ad's number. The script keeps the final URL suffix ad_id={creative} on every enabled campaign of the account — {creative} is Google's own substitution for the ad's number. The script does this by itself:
- the suffix is set at the campaign level, so every ad stays as approved;
- your other parameters of the suffix stay as they are;
- an
ad_idwith the substitution{creativeid}, which an earlier copy of the script set, or with an empty value is replaced; - an
ad_idwith a value of your own stays as it is.
Google adds the rest to the click itself: the click ID gclid when auto-tagging is on in the account, and gad_campaignid — the number of the Google campaign.
Performance Max and Demand Gen campaigns are built from asset groups rather than ad groups: their ads and the spend by their ads stay outside the export.
Your own tags in the link
The link example of a source with the Google Ads template is the same full link as for other sources: it goes into the ad's final URL. Add tags with the + list below the table — under Google Ads fields it holds Google's macros, each item the field's name with the macro and a short note under it, and last, under Kendi etiketleriniz, the next free Sub for a tag with a value you type yourself. A Google macro is a standard field of the source: it goes into its own row, which is also a column of the Clicks tab; a value of your own takes a Sub. Qubix determines the device from the browser, in the Cihaz column. The names of campaigns, ad groups and ads, and the campaign number, reach Qubix through the script, so a macro for them is superfluous. The ad number ad_id={creative} stands both in the link and in the suffix the script keeps, so a click carries it twice with the same value.
Conversions back to Google
Qubix uploads conversions to Google through the same script. Which of our events go and under which conversion action name is set by the Google olay eşlemesi of the source of the tracker campaign the click's Google campaign is attached to. The form of that source holds the map. When the Dönüşümler section is shown to you, the map is set on the Nereye gidiyor tab of each conversion instead, in the Google işlemi column. The click's Google campaign is the campaign of its ad, or, when the ad is unknown, the gad_campaignid number of the click. When that tracker campaign has several Google sources, the conversion goes by the one the click's visit came by — told by its src value, see One landing, several sources — and a visit that came by another route goes by the campaign's Google source with an empty src value, or by the first of them when each has a src value.
- Only conversions of clicks with
gclidgo to Google. - A conversion goes only when the click's Google campaign is attached to a tracker campaign.
- Only events paired in the map are sent.
- A conversion joins the queue six hours after its click, and within three days of the conversion itself.
- Qubix fills the queue at each sync of the script: at the start of every hourly run and about its fifteenth minute. The script uploads the queued conversions in the same run.
The Dönüşümleri Google'a kim gönderir field of the same form decides who sends the conversions to Google; the campaign can overrule it for each conversion — see Who sends conversions to Google:
- Qubix — the script uploads our events under the names of the map. The Eksik dönüşüm işlemleri field tells it what to do when the map names a conversion action that the account is yet to get. By default it is Birincil olarak oluşturulsun: the script creates the action as primary, and Google uses it for bidding right away. An action the account already has stays as it is. In the Dönüşümler section, each conversion has its own Eksik işlem nasıl oluşturulur choice, and that choice takes precedence over this field.
- Sitedeki Google etiketi — your own Google tag sends the conversions, and Qubix leaves the upload to the tag. The map then tells which Google conversion action counts as our event: at the start of every hourly run and about its fifteenth minute the script reads from Google how many such actions there were, by the time of the conversion itself. The Google Ads window shows these numbers in columns of their own, after the Qubix columns of the same table: a campaign takes the hourly counts of its ad groups on the days Google gives them, and an ad takes its count by the day, since Google counts an ad by the day (see Ad campaigns). Conversions of the source that were waiting for upload at the moment of the switch stay in the queue and are skipped while the source sends by the tag; a conversion that a campaign of the source marks for Qubix still goes out.
Your own events
Besides our events, the map takes an event of your own — a status your partner sends in the postback, for example kyc_passed. Type its name in the field under the map and click Olay ekle: Latin letters, digits and underscores, starting with a letter. Then pair it with a conversion action name.
A postback whose status is the key of a conversion in Dönüşümler — one created there, or a status of your own typed into the map of any source — is written as an event under that name, and the event arrives by itself. A status that the built-in words of a deposit, a registration or a rejection name (for example, approved, deposit, lead, reg or rejected), or that a rule of the affiliate network names, is written as the event of that word or rule. Every other status is marked Bilinmeyen durum in the postback log. Our own events — the visit campaign_visit, the steps of an install and push events such as push_click — are taken from a postback under their names too. A postback with the status install (also installed, app_install, install_app) is written as the Kurulum event.
Countries and the new script code
The figures by country come with the current script code, and the tab Countries names the accounts that run an older code. The remedy is the same as for any change of the script: take the code again on the page of the tracker campaign and replace the script in Google Ads with it — see Countries.
Troubleshooting
"Script has multiple main functions" — the default template was left in the editor. Select all (⌘/Ctrl+A), delete everything, and paste the Qubix code again so that exactly one main() remains.
Waiting for the account to appear, or the updates have stopped — open Tools → Scripts and check the Frequency column. If it shows —, the schedule is still empty: click it and choose Hourly. Check also that Status is Enabled. The tab Hesaplar marks an account bağlantı yok after three hours of silence.
The updates stopped after the person's sessions were reset — the script carries the personal key of the person who took it, and a session reset revokes that key. Take the script again on the page of the tracker campaign and replace the previous one with it in Tools → Scripts.
The lists stay empty after the installation — the data arrives with the first run of the script; press Run once to bring it at once.
The Google Ads item of the campaign card is hidden — the item appears on a saved campaign whose saved source is a Google one.
The Hesap komut dosyası group is hidden — the group belongs to the people with the Tracker kampanyalarını yönet permission who may edit this campaign.
The script reads the ads from the ad groups of the campaigns.