> ## Documentation Index
> Fetch the complete documentation index at: https://docs.automate.ax/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Automate.ax automations are TypeScript programs.
> Use Bun for installation and command examples.
> Use Automate.ax for the product name and automate.ax for the package, CLI, and domain.
> Treat documented public APIs as current; do not invent transitional or deprecated names.

# Upsert Google tags

> Adds or updates Google tags without removing other site tags.

`webflow.upsertGoogleTags` adds or updates Google tags on a site while preserving tags omitted from the request.

## Example

```ts automations/webflow-upsert-google-tags.automation.ts theme={null}
import { automation, onDashboardRun } from "automate.ax"
import { webflow } from "automate.ax/webflow"

export default automation("Upsert Google tags", () => {
  onDashboardRun({ title: "Upsert Google tags" })
  webflow.upsertGoogleTags({
    siteId: "site-id",
    googleTagIds: [{ displayName: "Main analytics", tagId: "G-XXXXXXXXXX" }],
  })
})
```

## Inputs

Every input accepts a compatible signal. This action requires the `sites:write` OAuth scope.

| Field          | Type                 | Required | Description                     |
| -------------- | -------------------- | -------- | ------------------------------- |
| `siteId`       | `string`             | Yes      | Webflow site ID.                |
| `googleTagIds` | `WebflowGoogleTag[]` | Yes      | Up to 25 tags to add or update. |

Each tag requires `displayName` and `tagId`; `order` is an optional nonnegative integer. `tagId` must start with `G-`, `GT-`, `AW-`, or `DC-` and continue with letters or digits. Webflow rejects legacy `UA-` IDs. Existing tags omitted from the request remain configured, and Webflow assigns an order to new tags when you omit it.

## Output

| Field          | Type                                                       | Description                         |
| -------------- | ---------------------------------------------------------- | ----------------------------------- |
| `googleTagIds` | `{ displayName: string; tagId: string; order?: number }[]` | Complete tag list after the update. |
