Prueba el servidor de MCP para Google Analytics. Instala desde
GitHub y consulta el
anuncio para obtener más detalles.
REST Resource: properties.keyEvents
Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
Recurso: KeyEvent
Un evento clave en una propiedad de Google Analytics.
Representación JSON |
{
"name": string,
"eventName": string,
"createTime": string,
"deletable": boolean,
"custom": boolean,
"countingMethod": enum (CountingMethod ),
"defaultValue": {
object (DefaultValue )
}
} |
Campos |
name |
string
Solo salida. Es el nombre del recurso de este evento de tecla. Formato: properties/{property}/keyEvents/{keyEvent}
|
eventName |
string
Inmutable. Es el nombre del evento de tecla. Ejemplos: "click", "purchase"
|
createTime |
string (Timestamp format)
Solo salida. Hora en la que se creó este evento clave en la propiedad. Usa RFC 3339, en el que el resultado generado siempre se normalizará en Z y usará 0, 3, 6 o 9 dígitos fraccionarios. También se aceptan compensaciones distintas de "Z". Ejemplos: "2014-10-02T15:01:23Z" , "2014-10-02T15:01:23.045123456Z" o "2014-10-02T15:01:23+05:30" .
|
deletable |
boolean
Solo salida. Si se establece como verdadero, se puede borrar este evento.
|
custom |
boolean
Solo salida. Si se establece como verdadero, este evento clave hace referencia a un evento personalizado. Si se establece como "false", este evento clave hace referencia a un evento predeterminado en GA. Por lo general, los eventos predeterminados tienen un significado especial en GA. Por lo general, el sistema de GA crea los eventos predeterminados por ti, pero en algunos casos, los administradores de la propiedad también pueden crearlos. Los eventos personalizados se incluyen en la cantidad máxima de eventos clave personalizados que se pueden crear por propiedad.
|
countingMethod |
enum (CountingMethod )
Obligatorio. Es el método mediante el cual se registrarán los eventos clave en varios eventos de una sesión.
|
defaultValue |
object (DefaultValue )
Opcional. Define un valor o una moneda predeterminados para un evento de tecla.
|
CountingMethod
Es el método mediante el cual se registrarán los eventos clave en varios eventos de una sesión.
Enumeraciones |
COUNTING_METHOD_UNSPECIFIED |
No se especificó el método de recuento. |
ONCE_PER_EVENT |
Cada instancia de evento se considera un evento clave. |
ONCE_PER_SESSION |
Una instancia de evento se considera un evento clave como máximo una vez por sesión y por usuario. |
DefaultValue
Define un valor o una moneda predeterminados para un evento de tecla.
Representación JSON |
{
"numericValue": number,
"currencyCode": string
} |
Campos |
numericValue |
number
Obligatorio. Se usará para completar el parámetro "value" para todas las ocurrencias de este evento clave (especificado por eventName) en las que no se haya establecido ese parámetro.
|
currencyCode |
string
Obligatorio. Cuando una ocurrencia de este evento clave (especificada por eventName) no tenga una moneda establecida, esta se aplicará como la predeterminada. Debe estar en formato de código de moneda ISO 4217. Consulta https://en.wikipedia.org/wiki/ISO_4217 para obtener más información.
|
Métodos |
|
Crea un evento de tecla. |
|
Borra un evento de tecla. |
|
Recupera un solo evento de tecla. |
|
Muestra una lista de eventos de teclas en la propiedad superior especificada. |
|
Actualiza un evento de tecla. |
Salvo que se indique lo contrario, el contenido de esta página está sujeto a la licencia Atribución 4.0 de Creative Commons, y los ejemplos de código están sujetos a la licencia Apache 2.0. Para obtener más información, consulta las políticas del sitio de Google Developers. Java es una marca registrada de Oracle o sus afiliados.
Última actualización: 2025-07-26 (UTC)
[null,null,["Última actualización: 2025-07-26 (UTC)"],[[["\u003cp\u003eKeyEvent resources represent significant events within a Google Analytics property, such as clicks or purchases, and can be custom or default.\u003c/p\u003e\n"],["\u003cp\u003eKey Events have a counting method that determines how they are tallied across multiple events in a session (e.g., once per event or once per session).\u003c/p\u003e\n"],["\u003cp\u003eIt is possible to define a default numeric value and currency for a Key Event, which will be used if these parameters are not set in the event data.\u003c/p\u003e\n"],["\u003cp\u003eGoogle Analytics provides API methods to manage Key Events, including creating, deleting, retrieving, listing, and updating them.\u003c/p\u003e\n"]]],["Key Events in Google Analytics track specific actions within a property, identified by an `eventName`. Each Key Event can have a `countingMethod` (`ONCE_PER_EVENT` or `ONCE_PER_SESSION`). They may have a `defaultValue` with a `numericValue` and `currencyCode`. Key Events are created, retrieved, listed, updated, and deleted via dedicated methods. Key events can be default or custom and store information such as if they are deletable, their creation time and their resource name.\n"],null,["# REST Resource: properties.keyEvents\n\n- [Resource: KeyEvent](#KeyEvent)\n - [JSON representation](#KeyEvent.SCHEMA_REPRESENTATION)\n- [CountingMethod](#CountingMethod)\n- [DefaultValue](#DefaultValue)\n - [JSON representation](#DefaultValue.SCHEMA_REPRESENTATION)\n- [Methods](#METHODS_SUMMARY)\n\nResource: KeyEvent\n------------------\n\nA key event in a Google Analytics property.\n\n| JSON representation |\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"name\": string, \"eventName\": string, \"createTime\": string, \"deletable\": boolean, \"custom\": boolean, \"countingMethod\": enum (/analytics/devguides/config/admin/v1/rest/v1beta/properties.keyEvents#CountingMethod), \"defaultValue\": { object (/analytics/devguides/config/admin/v1/rest/v1beta/properties.keyEvents#DefaultValue) } } ``` |\n\n| Fields ||\n|------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `name` | `string` Output only. Resource name of this key event. Format: properties/{property}/keyEvents/{keyEvent} |\n| `eventName` | `string` Immutable. The event name for this key event. Examples: 'click', 'purchase' |\n| `createTime` | `string (`[Timestamp](https://protobuf.dev/reference/protobuf/google.protobuf/#timestamp)` format)` Output only. Time when this key event was created in the property. Uses RFC 3339, where generated output will always be Z-normalized and uses 0, 3, 6 or 9 fractional digits. Offsets other than \"Z\" are also accepted. Examples: `\"2014-10-02T15:01:23Z\"`, `\"2014-10-02T15:01:23.045123456Z\"` or `\"2014-10-02T15:01:23+05:30\"`. |\n| `deletable` | `boolean` Output only. If set to true, this event can be deleted. |\n| `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. |\n| `countingMethod` | `enum (`[CountingMethod](/analytics/devguides/config/admin/v1/rest/v1beta/properties.keyEvents#CountingMethod)`)` Required. The method by which Key Events will be counted across multiple events within a session. |\n| `defaultValue` | `object (`[DefaultValue](/analytics/devguides/config/admin/v1/rest/v1beta/properties.keyEvents#DefaultValue)`)` Optional. Defines a default value/currency for a key event. |\n\nCountingMethod\n--------------\n\nThe method by which Key Events will be counted across multiple events within a session.\n\n| Enums ||\n|-------------------------------|--------------------------------------------------------------------------------|\n| `COUNTING_METHOD_UNSPECIFIED` | Counting method not specified. |\n| `ONCE_PER_EVENT` | Each Event instance is considered a Key Event. |\n| `ONCE_PER_SESSION` | An Event instance is considered a Key Event at most once per session per user. |\n\nDefaultValue\n------------\n\nDefines a default value/currency for a key event.\n\n| JSON representation |\n|------------------------------------------------------------|\n| ``` { \"numericValue\": number, \"currencyCode\": string } ``` |\n\n| Fields ||\n|----------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `numericValue` | `number` Required. This will be used to populate the \"value\" parameter for all occurrences of this Key Event (specified by eventName) where that parameter is unset. |\n| `currencyCode` | `string` Required. When an occurrence of this Key Event (specified by eventName) has no set currency this currency will be applied as the default. Must be in ISO 4217 currency code format. See \u003chttps://en.wikipedia.org/wiki/ISO_4217\u003e for more information. |\n\n| Methods ------- ||\n|--------------------------------------------------------------------------------------------|----------------------------------------------------------------|\n| ### [create](/analytics/devguides/config/admin/v1/rest/v1beta/properties.keyEvents/create) | Creates a Key Event. |\n| ### [delete](/analytics/devguides/config/admin/v1/rest/v1beta/properties.keyEvents/delete) | Deletes a Key Event. |\n| ### [get](/analytics/devguides/config/admin/v1/rest/v1beta/properties.keyEvents/get) | Retrieve a single Key Event. |\n| ### [list](/analytics/devguides/config/admin/v1/rest/v1beta/properties.keyEvents/list) | Returns a list of Key Events in the specified parent property. |\n| ### [patch](/analytics/devguides/config/admin/v1/rest/v1beta/properties.keyEvents/patch) | Updates a Key Event. |"]]