Method: properties.calculatedMetrics.create
בקשת HTTP
POST https://analyticsadmin.googleapis.com/v1alpha/{parent=properties/*}/calculatedMetrics
כתובת ה-URL משתמשת בתחביר של Transcoding של gRPC.
פרמטרים של נתיב
פרמטרים |
parent |
string
חובה. פורמט: properties/{property_id}. דוגמה: properties/1234
|
פרמטרים של שאילתה
פרמטרים |
calculatedMetricId |
string
חובה. המזהה שישמש את המדד המחושב, והוא יהפוך לרכיב הסופי של שם המשאב של המדד המחושב. הערך צריך להיות באורך של 1-80 תווים. התווים התקינים הם /[a-zA-Z0-9_]/, אסור להשתמש ברווחים. הערך calculatedMetricId חייב להיות ייחודי בין כל המדדים המחושבים בנכס. השדה calculatedMetricId משמש כשמתייחסים למדד המחושב הזה מממשקי API חיצוניים, לדוגמה, "calcMetric:{calculatedMetricId}".
|
גוף הבקשה
גוף הבקשה מכיל מופע של CalculatedMetric
.
גוף התשובה
אם הפעולה בוצעה ללא שגיאות, גוף התגובה יכיל מופע חדש של CalculatedMetric
.
היקפי הרשאה
נדרש היקף ההרשאות הבא של OAuth:
https://www.googleapis.com/auth/analytics.edit
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-01-14 (שעון UTC).
[null,null,["עדכון אחרון: 2025-01-14 (שעון UTC)."],[[["Creates a new CalculatedMetric within a specified Google Analytics 4 property using an HTTP POST request."],["Requires providing a unique `calculatedMetricId` and the `property_id` as path and query parameters, respectively."],["The request body should contain the CalculatedMetric definition, and a successful response will return the newly created CalculatedMetric instance."],["Users need to have the `analytics.edit` OAuth scope to authorize this operation."]]],["This documentation details how to create a CalculatedMetric via a `POST` request to the specified URL, including required components such as path and query parameters, the request body and the response body. The path parameter `parent` defines the property ID. The query parameter `calculatedMetricId` is a unique identifier. The request and response bodies are `CalculatedMetric` instances. This action requires authorization scope: `https://www.googleapis.com/auth/analytics.edit`.\n"]]