---
title: "Integrations: Google Analytics API Reference | Linkbreakers"
description: "Send every scan, visit, form submission and captured visitor detail to your Google Analytics 4 property, server side."
canonical: "https://linkbreakers.com/help/api/integrations-google-analytics"
---

# Integrations: Google Analytics

Send every scan, visit, form submission and captured visitor detail to your Google Analytics 4 property, server side.

5 entries on this page

## The google analytics integration object

GoogleAnalyticsIntegration.

The Google Analytics 4 property a workspace sends its visits to.

`apiSecretSet` boolean

Whether a Measurement Protocol API secret is stored. The secret itself is never returned.

`createdAt` string (date-time)

When the integration was connected.

`delivery` object

Where, when and what it sends.

8 child attributes

`directoryIds` array of string

Where: directories it applies to, with every directory below them.

`linkIds` array of string

Where: links it applies to. All three lists empty means every link.

`moments` array of enum

When: the moments of a visit it sends at. Ignored when stepIds is set.

`stepIds` array of string

When: send only when a visit reaches one of these workflow steps.

`tagIds` array of string

Where: tags it applies to.

`targetsGone` boolean 

Read-only

Every link, directory and tag chosen has since been deleted, so this covers nothing. The lists above are then empty without meaning every link.

`visitorAttributeKeys` array of string

What: with SELECTED, the attribute keys sent, such as "$email" or "rating".

`visitorData` enum

How much of what is known about the visitor an integration sends.

Allowed values

* `INTEGRATION_VISITOR_DATA_NONE` Only the visit: the link, the step, the device and the place.
* `INTEGRATION_VISITOR_DATA_ALL` The visit, and every attribute known about the visitor.
* `INTEGRATION_VISITOR_DATA_SELECTED` The visit, and only the attributes named in visitorAttributeKeys.

`lastError` string

The last error met sending events, cleared by the next success.

`lastErrorAt` string (date-time)

When that error happened.

`lastSentAt` string (date-time)

When an event was last accepted by Google Analytics.

`measurementId` string

GA4 Measurement ID, e.g. "G-ABC123DEF4".

`updatedAt` string (date-time)

When it was last changed.

`visitorAttributeKeys` array of string

The attribute keys sent, when visitorAttributesEnabled is on. Empty sends every attribute that is not personal data, except free-text answers, which are sent only when their key is listed here.

`visitorAttributesEnabled` boolean

Whether the visitor's data captured at a step (form answers such as a rating, custom visitor attributes) is added to its event as parameters named lb\_<key>. Personal data is never sent.

Example google analytics integration

```json
{
  "apiSecretSet": false,
  "createdAt": "2026-01-15T09:30:00Z",
  "delivery": {
    "directoryIds": [
      "string"
    ],
    "linkIds": [
      "string"
    ],
    "moments": [
      "KIND_ENTRY"
    ],
    "stepIds": [
      "string"
    ],
    "tagIds": [
      "string"
    ],
    "targetsGone": false,
    "visitorAttributeKeys": [
      "string"
    ],
    "visitorData": "INTEGRATION_VISITOR_DATA_NONE"
  },
  "lastError": "string",
  "lastErrorAt": "2026-01-15T09:30:00Z",
  "lastSentAt": "2026-01-15T09:30:00Z",
  "measurementId": "3f6c2a5e-8b1d-4c7e-9a2f-5d8e1b0c4a7f",
  "updatedAt": "2026-01-15T09:30:00Z",
  "visitorAttributeKeys": [
    "string"
  ],
  "visitorAttributesEnabled": false
}
```

### Response

200

`integration` object

Absent when Google Analytics is not connected.

Fields: [The google analytics integration object](#integrations-google-analytics-object).

Errors answer 4xx or 5xx with the [error object](https://linkbreakers.com/help/api#errors), and `429` past the [rate limit](https://linkbreakers.com/help/api#rate-limits).

Request

```bash
curl -X GET "https://api.linkbreakers.com/v1/integrations/google-analytics" \
  -H "Authorization: Bearer $LINKBREAKERS_TOKEN"
```

Response 200

```json
{
  "integration": {
    "apiSecretSet": false,
    "createdAt": "2026-01-15T09:30:00Z",
    "delivery": {
      "directoryIds": [
        "string"
      ],
      "linkIds": [
        "string"
      ],
      "moments": [
        "KIND_ENTRY"
      ],
      "stepIds": [
        "string"
      ],
      "tagIds": [
        "string"
      ],
      "targetsGone": false,
      "visitorAttributeKeys": [
        "string"
      ],
      "visitorData": "INTEGRATION_VISITOR_DATA_NONE"
    },
    "lastError": "string",
    "lastErrorAt": "2026-01-15T09:30:00Z",
    "lastSentAt": "2026-01-15T09:30:00Z",
    "measurementId": "3f6c2a5e-8b1d-4c7e-9a2f-5d8e1b0c4a7f",
    "updatedAt": "2026-01-15T09:30:00Z",
    "visitorAttributeKeys": [
      "string"
    ],
    "visitorAttributesEnabled": false
  }
}
```

### Parameters

`Idempotency-Key` string 

header

A unique value per request, such as a UUID, that makes retrying it safe: a retry with the same key and body returns the first response instead of acting twice.

### Request body

An empty JSON object.

### Response

200

`validationMessages` array of string

Problems Google's validation server found in the event, empty when none.

Errors answer 4xx or 5xx with the [error object](https://linkbreakers.com/help/api#errors), and `429` past the [rate limit](https://linkbreakers.com/help/api#rate-limits).

Request

```bash
curl -X POST "https://api.linkbreakers.com/v1/integrations/google-analytics/test" \
  -H "Authorization: Bearer $LINKBREAKERS_TOKEN" \
  -H "Content-Type: application/json"
```

Response 200

```json
{
  "validationMessages": [
    "string"
  ]
}
```

### Parameters

`Idempotency-Key` string 

header

A unique value per request, such as a UUID, that makes retrying it safe: a retry with the same key and body returns the first response instead of acting twice.

### Request body

`apiSecret` string

Measurement Protocol API secret. Required to connect; omit it to keep the stored one when only changing the Measurement ID.

`delivery` object

Where, when and what it sends. When set, it replaces the whole setting and takes over from visitorAttributesEnabled and visitorAttributeKeys. Leave it out to keep the current one.

7 child attributes

`directoryIds` array of string

Where: directories it applies to, with every directory below them.

`linkIds` array of string

Where: links it applies to. All three lists empty means every link.

`moments` array of enum

When: the moments of a visit it sends at. Ignored when stepIds is set.

`stepIds` array of string

When: send only when a visit reaches one of these workflow steps.

`tagIds` array of string

Where: tags it applies to.

`visitorAttributeKeys` array of string

What: with SELECTED, the attribute keys sent, such as "$email" or "rating".

`visitorData` enum

How much of what is known about the visitor an integration sends.

Allowed values

* `INTEGRATION_VISITOR_DATA_NONE` Only the visit: the link, the step, the device and the place.
* `INTEGRATION_VISITOR_DATA_ALL` The visit, and every attribute known about the visitor.
* `INTEGRATION_VISITOR_DATA_SELECTED` The visit, and only the attributes named in visitorAttributeKeys.

`measurementId` string

GA4 Measurement ID, e.g. "G-ABC123DEF4".

`visitorAttributeKeys` object

Send only these attribute keys. Omit to keep the current list; an empty list sends every attribute that is not personal data.

1 child attribute

`keys` array of string

Visitor attribute keys, e.g. "rating". Empty means every attribute that is not personal data. At most 25.

`visitorAttributesEnabled` boolean

Add the visitor's data (form answers such as a rating, custom visitor attributes) to events as parameters, never personal data. Omit to keep the current setting; on by default when connecting.

### Response

200

`integration` object

GoogleAnalyticsIntegration.

The Google Analytics 4 property a workspace sends its visits to.

Fields: [The google analytics integration object](#integrations-google-analytics-object).

Errors answer 4xx or 5xx with the [error object](https://linkbreakers.com/help/api#errors), and `429` past the [rate limit](https://linkbreakers.com/help/api#rate-limits).

Request

```bash
curl -X PUT "https://api.linkbreakers.com/v1/integrations/google-analytics" \
  -H "Authorization: Bearer $LINKBREAKERS_TOKEN" \
  -H "Content-Type: application/json" \
  --data '{
  "apiSecret": "string",
  "delivery": {
    "directoryIds": [
      "string"
    ],
    "linkIds": [
      "string"
    ],
    "moments": [
      "KIND_ENTRY"
    ],
    "stepIds": [
      "string"
    ],
    "tagIds": [
      "string"
    ],
    "visitorAttributeKeys": [
      "string"
    ],
    "visitorData": "INTEGRATION_VISITOR_DATA_NONE"
  },
  "measurementId": "3f6c2a5e-8b1d-4c7e-9a2f-5d8e1b0c4a7f",
  "visitorAttributeKeys": {
    "keys": [
      "string"
    ]
  },
  "visitorAttributesEnabled": false
}'
```

Response 200

```json
{
  "integration": {
    "apiSecretSet": false,
    "createdAt": "2026-01-15T09:30:00Z",
    "delivery": {
      "directoryIds": [
        "string"
      ],
      "linkIds": [
        "string"
      ],
      "moments": [
        "KIND_ENTRY"
      ],
      "stepIds": [
        "string"
      ],
      "tagIds": [
        "string"
      ],
      "targetsGone": false,
      "visitorAttributeKeys": [
        "string"
      ],
      "visitorData": "INTEGRATION_VISITOR_DATA_NONE"
    },
    "lastError": "string",
    "lastErrorAt": "2026-01-15T09:30:00Z",
    "lastSentAt": "2026-01-15T09:30:00Z",
    "measurementId": "3f6c2a5e-8b1d-4c7e-9a2f-5d8e1b0c4a7f",
    "updatedAt": "2026-01-15T09:30:00Z",
    "visitorAttributeKeys": [
      "string"
    ],
    "visitorAttributesEnabled": false
  }
}
```

### Response

200

An empty JSON object.

Errors answer 4xx or 5xx with the [error object](https://linkbreakers.com/help/api#errors), and `429` past the [rate limit](https://linkbreakers.com/help/api#rate-limits).

Request

```bash
curl -X DELETE "https://api.linkbreakers.com/v1/integrations/google-analytics" \
  -H "Authorization: Bearer $LINKBREAKERS_TOKEN"
```

---

Source: https://linkbreakers.com/help/api/integrations-google-analytics
