Views (Profiles): get

Yetkilendirme gerektirir

Kullanıcının erişebildiği bir görünüm (profil) alır. Hemen deneyin veya bir örneğe göz atın.

Bu yöntem, standart parametrelere ek olarak parametreler tablosunda listelenen parametreleri destekler.

İstek

HTTP isteği

GET https://www.googleapis.com/analytics/v3/management/accounts/accountId/webproperties/webPropertyId/profiles/profileId

Parametreler

Parametre adı Değer Açıklama
Yol parametreleri
accountId string Görünümü (profil) almak için kullanılan hesap kimliği.
profileId string Görünümü (profil) almak için kullanılan Görünüm (Profil) kimliği.
webPropertyId string Görünümü (profil) alınacağı web mülkü kimliği.

Yetkilendirme

Bu istek için aşağıdaki kapsamlardan en az biriyle yetkilendirme gereklidir (kimlik doğrulama ve yetkilendirme hakkında daha fazla bilgi edinin).

Kapsam
https://www.googleapis.com/auth/analytics.edit
https://www.googleapis.com/auth/analytics.readonly

İstek içeriği

Bu yöntemle istek gövdesi sağlamayın.

Yanıt

Başarılı olursa bu yöntem, yanıt gövdesinde bir management.profile kaynağı döndürür.

Örnekler

Not: Bu yöntem için kullanıma sunulan kod örnekleri, desteklenen tüm programlama dillerini kapsamaz (Desteklenen dillerin listesi için istemci kitaplıkları sayfasını inceleyin).

Java

Java istemci kitaplığı'nı kullanmalıdır.

/**
 * Note: This code assumes you have an authorized Analytics service object.
 * See the View (Profile) Developer Guide for details.
 */


// This request gets an existing view (profile).

try {
  Profile profile = analytics.management.profiles
      .get("12345", "UA-12345-1", "523").execute();

} catch (GoogleJsonResponseException e) {
  System.err.println("There was a service error: "
      + e.getDetails().getCode() + " : "
      + e.getDetails().getMessage());
}

PHP

PHP istemci kitaplığını kullanır.

/**
 * Note: This code assumes you have an authorized Analytics service object.
 * See the View (Profile) Dev Guide for details.
 */

/**
 * This request gets an existing view (profile).
 */
try {
  $profile = $analytics->management_profiles->get('123456', 'UA-123456-1',
        '89447828');

} catch (apiServiceException $e) {
  print 'There was an Analytics API service error '
      . $e->getCode() . ':' . $e->getMessage();

} catch (apiException $e) {
  print 'There was a general API error '
      . $e->getCode() . ':' . $e->getMessage();
}



Python

Python istemci kitaplığı'nı kullanır.

# Note: This code assumes you have an authorized Analytics service object.
# See the View (Profile) Developer Guide for details.

# This request gets an existing view (profile).
try:
  profile = analytics.management().profiles().get(
      accountId='12345',
      webPropertyId='UA-12345-1',
      profileId='523').execute()

except TypeError, error:
  # Handle errors in constructing a query.
  print 'There was an error in constructing your query : %s' % error

except HttpError, error:
  # Handle API errors.
  print ('There was an API error : %s : %s' %
         (error.resp.status, error.resp.reason))

JavaScript

JavaScript istemci kitaplığını kullanır.

/*
 * Note: This code assumes you have an authorized Analytics client object.
 * See the View (Profile) Developer Guide for details.
 */

/*
 * This request gets an existing view (profile).
 */
function getView() {
  var request = gapi.client.analytics.management.profiles.get({
    'accountId': '123456',
    'webPropertyId': 'UA-123456-1',
    'profileId': '7654321'
  });
  request.execute(function (response) { // Handle the response. });
}

Deneyin.

Aşağıdaki API Gezgini'ni kullanarak canlı verilerde bu yöntemi çağırın ve yanıtı görün. Alternatif olarak, bağımsız Gezgin'i deneyin.