---
title: "Google tag: GA4 and Google Ads for QR codes and links"
description: "Connect a Google tag to Linkbreakers so every person who scans your QR codes or opens your links sends a GA4 page_view or a Google Ads remarketing hit. G- and AW- IDs, where to find them, the audiences you can build, how to check it fires, consent and limits."
canonical: "https://linkbreakers.com/help/article/google-tag-ga4-and-google-ads-for-qr-codes-and-links"
last-updated: 2026-10-30
---

# Google tag: GA4 and Google Ads for QR codes and links

> Connect a Google tag to Linkbreakers so every person who scans your QR codes or opens your links sends a GA4 page_view or a Google Ads remarketing hit. G- and AW- IDs, where to find them, the audiences you can build, how to check it fires, consent and limits.

:::try-ai-prompt {"prompt":"Connect my Google tag G-ABC1234 to all my links and QR codes","description":"Set up the Google tag with the Assistant.","target":"assistant"}:::

## Short answer

Open **Integrations** in the Linkbreakers dashboard, pick **Google tag** under **Retargeting pixels**, paste a tag ID and select **Connect**. With a Google Analytics 4 measurement ID (`G-...`), every person who scans one of your QR codes or opens one of your links sends a GA4 `page_view`. With a Google Ads tag (`AW-...`), they send a Google Ads remarketing hit, so you can show them ads on Search, YouTube and Display.

There is one Google tag field. To use GA4 and Google Ads together, put one here and the other in [Google Tag Manager](/help/article/google-tag-manager-for-qr-codes-and-links).

The tag adds a short page before the redirect, usually well under a second and never longer than 1.2 seconds. It is available on every plan, Free included.

## Quick summary

- One Google tag ID per workspace, applied to every link and QR code
- `G-` sends a GA4 `page_view`; `AW-` sends a Google Ads remarketing hit
- `GT-` and `DC-` IDs are accepted too
- The page URL Google records is the Linkbreakers short link address
- Only people fire it: bots, link previews, AI agents and automated browsers are skipped
- Consent for marketing and analytics cookies is the workspace's responsibility
- Also available from the Assistant, the MCP server, the REST API and the CLI

## How it works with Google

Once the Google tag is connected, a person's visit goes through a brief page in their browser. That page loads Google's standard `gtag.js` and runs `gtag('config', '<your tag ID>')`, then redirects as soon as the script has loaded and had about 300 ms to send. It never waits longer than 1.2 seconds.

What `config` sends depends on the ID:

- **`G-...` (Google Analytics 4)**: a `page_view` event in your GA4 property
- **`AW-...` (Google Ads)**: a remarketing hit, which adds the visitor to Google Ads data segments built on that tag
- **`GT-...`**: a Google tag ID, which sends to the destinations linked to it in Google's tag settings
- **`DC-...`**: a Floodlight tag for Campaign Manager 360

In both GA4 and Google Ads, the page URL is the address of the Linkbreakers link that was opened, such as your short link or your custom domain link.

### What you can do in GA4

- See scans and clicks as `page_view` events on your link domain, in reports or in an exploration filtered on the page location
- Build a GA4 audience of people who viewed a page whose URL contains a given short link, and share it with a linked Google Ads account
- Compare scans per campaign by giving each campaign its own short link

GA4 treats the link domain as a different site from your own website. The visit on the link and the visit on your website can therefore count as separate users, and your link domain can show up as a referral on your website's property. If that matters for your reports, add the link domain to the unwanted referrals list of your web data stream, or use a separate GA4 property for links. [UTM parameters](/help/article/what-is-a-utm-builder-in-linkbreakers) on your destination URLs keep working as before for the visit on your website.

### What you can do in Google Ads

In Google Ads, under the audience or data segment settings, create a **website visitors** segment based on your Google tag, with a rule that the page URL contains your short link. Use it to target or exclude the people who scanned in Search, YouTube, Display or Performance Max campaigns.

Google needs time to fill the segment, and each network needs a minimum number of active users before ads serve.

## Where to find your tag ID

- **Google Analytics 4**: in Google Analytics, open **Admin > Data streams**, select your web stream, and copy the **Measurement ID**, which starts with `G-`
- **Google Ads**: in Google Ads, open the **Google tag** settings (under Tools, in the data or measurement section, depending on your account's menu) and copy the tag ID that starts with `AW-`

Linkbreakers checks the shape when you save: `G-`, `AW-`, `GT-` or `DC-`, then 4 to 20 letters or digits. Any other value is refused with `RETARGETING_PIXEL_INVALID`, and nothing is changed.

## Step-by-step in Linkbreakers

1. Open the dashboard and go to **Integrations**
2. Under **Retargeting pixels**, open **Google tag**
3. Paste your `G-` or `AW-` ID and select **Connect**
4. Read the delay notice and the consent note on the page
5. [Check that the tag fires](#how-to-check-that-it-fires)

To switch to another ID, replace it and select **Save**. To turn it off, select **Remove**. When no pixel is left on the workspace, links go back to redirecting instantly.

## How to check that it fires

1. Open **Google Tag Assistant** at tagassistant.google.com, or install its Chrome extension
2. Connect it to one of your Linkbreakers links and open the link in a normal browser window
3. Look for your tag ID and the `page_view` or remarketing hit on the first page, before the redirect

The page redirects within about a second, so Tag Assistant may move on to your destination quickly. Check the event list for the first page rather than the current one. In GA4, the **Realtime** report shows the `page_view` within a few minutes.

Ad blockers and some browsers' tracking protection block Google tags. Visitors who use them block them on your links too, as on any website.

## The short delay

A tag is JavaScript that runs in the visitor's browser, and a plain redirect runs none. So once a pixel is connected, people's visits go through the brief page described above: usually well under a second, never longer than 1.2 seconds. Workspaces without any pixel keep the instant redirect.

If you also use Advanced data collection, both share the same page, so the visit loads one page, not two.

## Who fires the tag

Only visits classified as **Human** go through the pixel page. Crawlers, link previews (Slack, Teams, Discord, WhatsApp, Facebook, LinkedIn), AI agents and recognized automated browsers get the instant redirect, so they never inflate your GA4 page views or your remarketing segments.

See [how Linkbreakers detects AI agents and automated browsers](/help/article/how-linkbreakers-detects-ai-agents-and-automated-browsers) for how visits are classified.

## Consent

Google tags set analytics and advertising cookies. In the EU and the UK, that usually needs the visitor's consent first. Linkbreakers does not show a consent banner. Covering the tag in your privacy policy and consent setup is the workspace's responsibility.

## Set it up from an AI agent, the API or the CLI

**Assistant**: in the dashboard, ask "Connect my Google tag G-ABC1234 to all my links".

**MCP server**: an agent connected to the [Linkbreakers MCP server](/help/article/mcp-server-setup) calls `retargeting_pixels_update` with `google_tag_id`. Only the fields sent change, so the other pixels keep their value. For example:

> Set my Google tag to AW-123456789 on my Linkbreakers workspace and leave the other pixels as they are.

**REST API**, with a token that has the `integrations:write` scope:

```bash
curl -X PUT https://api.linkbreakers.com/v1/retargeting-pixels \
  -H "Authorization: Bearer $LINKBREAKERS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"googleTagId": "G-ABC1234"}'
```

Send `{"googleTagId": ""}` to remove it.

**CLI**, from the next CLI release:

```bash
linkbreakers retargeting-pixels update --google-tag-id G-ABC1234
```

See [set up every Linkbreakers integration with an AI agent](/help/article/set-up-linkbreakers-integrations-with-an-ai-agent-mcp) for the other integrations an agent can configure.

## Limits and caveats

- **One Google tag field.** For GA4 and Google Ads together, put one here and the other in [Google Tag Manager](/help/article/google-tag-manager-for-qr-codes-and-links)
- **Page views only.** Linkbreakers sends the `config` page view. It does not send conversions, purchases or leads, so keep conversion tracking on your website
- **Workspace-wide.** The tag applies to every link and QR code of the workspace. There is no per-link choice yet; filter on the page URL in GA4 or Google Ads
- **Separate site in GA4.** The link domain is not your website's domain, which affects users, sessions and referrals as described above
- **Short delay on people's visits**, usually well under a second, never longer than 1.2 seconds
- **No consent banner.** Consent is the workspace's responsibility
- **Blocked like any tag** by ad blockers and tracking protection

## Frequently asked questions

### Should I paste my GA4 ID or my Google Ads ID?

Paste the one you need most. `AW-` builds Google Ads remarketing segments directly; `G-` sends GA4 page views, from which you can build GA4 audiences for a linked Google Ads account. For both, use Google Tag Manager for the second one.

### Will scans show up in my GA4 reports?

Yes, as `page_view` events with the Linkbreakers link address as the page location, from people's visits only.

### Do I still need UTM parameters?

They do a different job. The Google tag records the visit to the link. UTM parameters on your destination URL tell your website's analytics where the visitor came from after the redirect.

### Can I build a Google Ads audience for one QR code?

Yes. Create a website visitors segment with a rule that the page URL contains that QR code's short link.

### Why was my tag ID refused?

The ID must start with `G-`, `AW-`, `GT-` or `DC-`, followed by 4 to 20 letters or digits. A Universal Analytics `UA-` ID or a `GTM-` container ID is refused here; put a `GTM-` ID in the Google Tag Manager field.

## Sources

- Linkbreakers Google tag page, API and MCP tool, checked in the product on 2026-10-30.
- [Retargeting pixels overview](/help/article/retargeting-pixels-meta-google-tiktok-linkedin-and-google-tag-manager)
- [How to retarget people who scanned your QR code with ads](/help/article/how-to-retarget-people-who-scanned-your-qr-code-with-ads)
- Google tag platform, set up the Google tag with gtag.js: https://developers.google.com/tag-platform/gtagjs
- Google Analytics, measure pageviews: https://developers.google.com/analytics/devguides/collection/ga4/views
- Google Analytics Help, find your Google tag ID: https://support.google.com/analytics/answer/9539598
- Google Analytics Help, create, edit and archive audiences: https://support.google.com/analytics/answer/9267572
- Google Analytics Help, get started with Explorations: https://support.google.com/analytics/answer/7579450
- Google Ads Help, about your data segments: https://support.google.com/google-ads/answer/2453998
- Google Ads Help, tag your website using Google Ads: https://support.google.com/google-ads/answer/2476688
- Tag Assistant Help, troubleshoot with Tag Assistant: https://support.google.com/tagassistant/answer/10039345

## Last reviewed

2026-10-30 by Laurent Schaffner.
