ลองใช้เซิร์ฟเวอร์ MCP สำหรับ Google Analytics ติดตั้งจาก
GitHub และดูรายละเอียดเพิ่มเติมได้ที่
ประกาศ
REST Resource: properties.keyEvents
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
ทรัพยากร: KeyEvent
เหตุการณ์สําคัญในพร็อพเพอร์ตี้ Google Analytics
การแสดง JSON |
{
"name": string,
"eventName": string,
"createTime": string,
"deletable": boolean,
"custom": boolean,
"countingMethod": enum (CountingMethod ),
"defaultValue": {
object (DefaultValue )
}
} |
ช่อง |
name |
string
เอาต์พุตเท่านั้น ชื่อแหล่งข้อมูลของเหตุการณ์สําคัญนี้ รูปแบบ: properties/{property}/keyEvents/{keyEvent}
|
eventName |
string
เปลี่ยนแปลงไม่ได้ ชื่อเหตุการณ์สําหรับเหตุการณ์สําคัญนี้ ตัวอย่างเช่น "click", "purchase"
|
createTime |
string (Timestamp format)
เอาต์พุตเท่านั้น เวลาที่สร้างเหตุการณ์สําคัญนี้ในพร็อพเพอร์ตี้ ใช้ RFC 3339 ซึ่งเอาต์พุตที่สร้างขึ้นจะเป็นรูปแบบ Z-normalized เสมอ และใช้ตัวเลขทศนิยม 0, 3, 6 หรือ 9 ระบบยังยอมรับออฟเซตอื่นๆ นอกเหนือจาก "Z" ด้วย ตัวอย่างเช่น "2014-10-02T15:01:23Z" , "2014-10-02T15:01:23.045123456Z" หรือ "2014-10-02T15:01:23+05:30"
|
deletable |
boolean
เอาต์พุตเท่านั้น หากตั้งค่าเป็น "จริง" กิจกรรมนี้จะลบได้
|
custom |
boolean
เอาต์พุตเท่านั้น หากตั้งค่าเป็น "จริง" เหตุการณ์สําคัญนี้จะหมายถึงเหตุการณ์ที่กําหนดเอง หากตั้งค่าเป็นเท็จ เหตุการณ์สําคัญนี้จะหมายถึงเหตุการณ์เริ่มต้นใน GA ซึ่งโดยปกติแล้วเหตุการณ์เริ่มต้นจะมีความหมายพิเศษใน GA โดยปกติแล้วระบบ GA จะสร้างเหตุการณ์เริ่มต้นให้คุณ แต่ในบางกรณีผู้ดูแลระบบพร็อพเพอร์ตี้อาจสร้างเหตุการณ์เริ่มต้นได้ เหตุการณ์ที่กําหนดเองจะนับรวมกับจํานวนเหตุการณ์สําคัญที่กําหนดเองสูงสุดที่อาจสร้างขึ้นต่อพร็อพเพอร์ตี้
|
countingMethod |
enum (CountingMethod )
ต้องระบุ วิธีการนับเหตุการณ์สําคัญในหลายเหตุการณ์ภายในเซสชัน
|
defaultValue |
object (DefaultValue )
ไม่บังคับ กําหนดมูลค่า/สกุลเงินเริ่มต้นสําหรับเหตุการณ์สําคัญ
|
CountingMethod
วิธีการนับเหตุการณ์สําคัญในหลายเหตุการณ์ภายในเซสชัน
Enum |
COUNTING_METHOD_UNSPECIFIED |
ไม่ได้ระบุวิธีการนับ |
ONCE_PER_EVENT |
อินสแตนซ์เหตุการณ์แต่ละรายการถือเป็นเหตุการณ์สําคัญ |
ONCE_PER_SESSION |
ระบบจะถือว่าอินสแตนซ์เหตุการณ์เป็นเหตุการณ์สําคัญไม่เกิน 1 ครั้งต่อเซสชันต่อผู้ใช้ |
DefaultValue
กําหนดมูลค่า/สกุลเงินเริ่มต้นสําหรับเหตุการณ์สําคัญ
การแสดง JSON |
{
"numericValue": number,
"currencyCode": string
} |
ช่อง |
numericValue |
number
ต้องระบุ ระบบจะใช้ค่านี้เพื่อป้อนข้อมูลพารามิเตอร์ "value" สําหรับเหตุการณ์สําคัญนี้ (ที่ระบุโดย eventName) ทั้งหมดที่ไม่ได้ตั้งค่าพารามิเตอร์นั้น
|
currencyCode |
string
ต้องระบุ เมื่อเหตุการณ์สําคัญนี้ (ที่ระบุโดย eventName) ไม่ได้กําหนดสกุลเงิน ระบบจะใช้สกุลเงินนี้เป็นค่าเริ่มต้น ต้องอยู่ในรูปแบบรหัสสกุลเงิน ISO 4217 ดูข้อมูลเพิ่มเติมได้ที่ https://en.wikipedia.org/wiki/ISO_4217
|
เมธอด |
|
สร้างเหตุการณ์สําคัญ |
|
ลบเหตุการณ์สําคัญ |
|
ดึงข้อมูลเหตุการณ์สําคัญรายการเดียว |
|
แสดงรายการเหตุการณ์สําคัญในพร็อพเพอร์ตี้หลักที่ระบุ |
|
อัปเดตเหตุการณ์สําคัญ |
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-26 UTC
[null,null,["อัปเดตล่าสุด 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. |"]]