---
title: "PATCH /v1beta/properties/{propertiesId}/keyEvents/{keyEventsId}"
method: PATCH
path: "/v1beta/properties/{propertiesId}/keyEvents/{keyEventsId}"
tags: ["properties"]
---

# PATCH /v1beta/properties/{propertiesId}/keyEvents/{keyEventsId}

`PATCH /v1beta/properties/{propertiesId}/keyEvents/{keyEventsId}`

## Request

- Base URL: `https://analyticsadmin.googleapis.com`
- URL: `https://analyticsadmin.googleapis.com/v1beta/properties/{propertiesId}/keyEvents/{keyEventsId}`
- Auth: OAuth 2 and OAuth 2
  - Implicit: `https://accounts.google.com/o/oauth2/auth`
  - Scopes: `https://www.googleapis.com/auth/analytics.edit`
  - Authorization code: `https://accounts.google.com/o/oauth2/auth`
  - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/analytics.edit`

Updates a Key Event.

## Path parameters

- `propertiesId` string, required
- `keyEventsId` string, required

## Query parameters

- `$.xgafv` '1' | '2'
- `access_token` string
- `alt` 'json' | 'media' | 'proto'
- `callback` string
- `fields` string
- `key` string
- `oauth_token` string
- `prettyPrint` boolean
- `quotaUser` string
- `uploadType` string
- `upload_protocol` string
- `updateMask` string, google-fieldmask

## Request body

- GoogleAnalyticsAdminV1betaKeyEvent: A key event in a Google Analytics property.
  - `countingMethod` 'COUNTING_METHOD_UNSPECIFIED' | 'ONCE_PER_EVENT' | 'ONCE_PER_SESSION': Required. The method by which Key Events will be counted across multiple events within a session.
  - `createTime` string, google-datetime: Output only. Time when this key event was created in the property.
  - `custom` boolean: Output only. If set to true, this key event refers to a custom event. If set to false, this key event refers to a default event in GA. Default events typically have special meaning in GA. Default events are usually created for you by the GA system, but in some cases can be created by property admins. Custom events count towards the maximum number of custom key events that may be created per property.
  - `defaultValue` GoogleAnalyticsAdminV1betaKeyEventDefaultValue: Defines a default value/currency for a key event.
    - `currencyCode` string: Required. When an occurrence of this Key Event (specified by event_name) has no set currency this currency will be applied as the default. Must be in ISO 4217 currency code format. See https://en.wikipedia.org/wiki/ISO_4217 for more information.
    - `numericValue` number, double: Required. This will be used to populate the "value" parameter for all occurrences of this Key Event (specified by event_name) where that parameter is unset.
  - `deletable` boolean: Output only. If set to true, this event can be deleted.
  - `eventName` string: Immutable. The event name for this key event. Examples: 'click', 'purchase'
  - `name` string: Output only. Resource name of this key event. Format: properties/{property}/keyEvents/{key_event}

## Response `200`

Successful response

- GoogleAnalyticsAdminV1betaKeyEvent: A key event in a Google Analytics property.
  - `countingMethod` 'COUNTING_METHOD_UNSPECIFIED' | 'ONCE_PER_EVENT' | 'ONCE_PER_SESSION': Required. The method by which Key Events will be counted across multiple events within a session.
  - `createTime` string, google-datetime: Output only. Time when this key event was created in the property.
  - `custom` boolean: Output only. If set to true, this key event refers to a custom event. If set to false, this key event refers to a default event in GA. Default events typically have special meaning in GA. Default events are usually created for you by the GA system, but in some cases can be created by property admins. Custom events count towards the maximum number of custom key events that may be created per property.
  - `defaultValue` GoogleAnalyticsAdminV1betaKeyEventDefaultValue: Defines a default value/currency for a key event.
    - `currencyCode` string: Required. When an occurrence of this Key Event (specified by event_name) has no set currency this currency will be applied as the default. Must be in ISO 4217 currency code format. See https://en.wikipedia.org/wiki/ISO_4217 for more information.
    - `numericValue` number, double: Required. This will be used to populate the "value" parameter for all occurrences of this Key Event (specified by event_name) where that parameter is unset.
  - `deletable` boolean: Output only. If set to true, this event can be deleted.
  - `eventName` string: Immutable. The event name for this key event. Examples: 'click', 'purchase'
  - `name` string: Output only. Resource name of this key event. Format: properties/{property}/keyEvents/{key_event}

---

[API](https://skmtc.dev/google/apis/analyticsadmin.md) - [All operations](https://skmtc.dev/google/apis/analyticsadmin/llms.txt) - [OpenAPI document](https://skmtc.dev/google/apis/analyticsadmin/revisions/2f06698abda1?raw)
