Method: properties.dataStreams.getGlobalSiteTag
הפונקציה מחזירה את תג האתר של מקור נתוני האתר שצוין. תגי אתר הם סינגלונים שאינם ניתנים לשינוי.
בקשת HTTP
GET https://analyticsadmin.googleapis.com/v1alpha/{name=properties/*/dataStreams/*/globalSiteTag}
בכתובת ה-URL נעשה שימוש בתחביר המרת קידוד של gRPC.
פרמטרים של נתיב
פרמטרים |
name |
string
חובה. השם של תג האתר שרוצים לחפש. חשוב לשים לב שתגי אתרים הם טונים ליחידים ואין להם מזהים ייחודיים. פורמט: properties/{property_id}/dataStreams/{stream_id}/globalSiteTag לדוגמה: properties/123/dataStreams/456/globalSiteTag
|
גוף הבקשה
גוף הבקשה חייב להיות ריק.
גוף התשובה
משאב לקריאה בלבד עם התג לשליחת נתונים מאתר ל-DataStream. מוצג רק למשאבי DataStream באינטרנט.
אם הפעולה בוצעה ללא שגיאות, גוף התגובה יכיל נתונים במבנה הבא:
ייצוג JSON |
{
"name": string,
"snippet": string
} |
שדות |
name |
string
פלט בלבד. שם המשאב למשאב GlobalSiteTag הזה. פורמט: properties/{property_id}/dataStreams/{stream_id}/globalSiteTag דוגמה: "properties/123/dataStreams/456/globalSiteTag"
|
snippet |
string
בלתי ניתן לשינוי. קטע הקוד של JavaScript שיודבק כפריט הראשון בתג head של כל דף אינטרנט לצורך מדידה.
|
היקפי ההרשאות
נדרש אחד מהיקפי ההרשאות הבאים של OAuth:
https://www.googleapis.com/auth/analytics.readonly
https://www.googleapis.com/auth/analytics.edit
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2024-08-22 (שעון UTC).
[null,null,["עדכון אחרון: 2024-08-22 (שעון UTC)."],[[["Retrieves the Site Tag, an immutable singleton, associated with a specific web stream."],["Utilizes an HTTP GET request with the format `GET https://analyticsadmin.googleapis.com/v1alpha/{name=properties/*/dataStreams/*/globalSiteTag}` to fetch the tag."],["Requires providing the web stream's name using the path parameter `name` in the format `properties/{property_id}/dataStreams/{stream_id}/globalSiteTag`."],["Returns a JSON response containing the site tag's name and the JavaScript snippet for website implementation."],["Needs authorization with either `https://www.googleapis.com/auth/analytics.readonly` or `https://www.googleapis.com/auth/analytics.edit` scope."]]],["This outlines retrieving a web stream's Site Tag via a `GET` request to a specified URL. The required `name` parameter, formatted as `properties/{property_id}/dataStreams/{stream_id}/globalSiteTag`, identifies the Site Tag. The request body must be empty. The successful response, in JSON format, provides a `name` (resource identifier) and an immutable `snippet` (JavaScript code) for website data measurement. This can be achieved through authorization with either `analytics.readonly` or `analytics.edit` OAuth scopes.\n"]]