Yetkilendirme gerektirir
Mevcut bir profil filtre bağlantısını güncelleyin. Bu yöntem yama semantiğini destekler. Hemen deneyin veya bir örneğe göz atın.
İstek
HTTP isteği
PATCH https://www.googleapis.com/analytics/v3/management/accounts/accountId/webproperties/webPropertyId/profiles/profileId/profileFilterLinks/linkId
Parametreler
Parametre adı | Değer | Açıklama |
---|---|---|
Yol parametreleri | ||
accountId |
string |
Profil filtre bağlantısının ait olduğu hesabın kimliği. |
linkId |
string |
Güncellenecek profil filtresi bağlantısının kimliği. |
profileId |
string |
Filtre bağlantısının ait olduğu profilin kimliği |
webPropertyId |
string |
Profil filtresi bağlantısının ait olduğu web mülkü kimliği |
Yetkilendirme
Bu istek için aşağıdaki kapsamla yetkilendirme gerekiyor (kimlik doğrulama ve yetkilendirme hakkında daha fazla bilgi edinin).
Kapsam |
---|
https://www.googleapis.com/auth/analytics.edit |
İstek içeriği
İstek gövdesinde, yama semantiği kurallarına göre bir Profil Filtresi Bağlantıları kaynağının ilgili bölümlerini sağlayın.
Yanıt
Başarılı olursa bu yöntem, yanıt gövdesinde bir Profil Filtre Bağlantıları 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 Filters Developer Guide for details. */ /* * This request patches an existing profile filter link. */ // Construct the filter reference. FilterRef filterRef = new FilterRef(); filterRef.setId("1223334444"); // Construct the body of the request. ProfileFilterLink body = new ProfileFilterLink(); body.setFilterRef(filterRef); try { analytics.management().profileFilterLinks().patch("123456", "UA-123456-1", "7654321", "1122334455", body).execute(); } catch (GoogleJsonResponseException e) { System.err.println("There was a service error: " + e.getDetails().getCode() + " : " + e.getDetails().getMessage()); }
Python
Python istemci kitaplığını kullanır.
# Note: This code assumes you have an authorized Analytics service object. # See the Filters Developer Guide for details. # This request patches an existing profile filter link. try: analytics.management().profileFilterLinks().patch( accountId='123456', webPropertyId='UA-123456-1', profileId='7654321', linkId='11223344', body={ 'filterRef': { 'id': '1223334444' } } ).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))
Deneyin.
Canlı verilerde bu yöntemi çağırmak ve yanıtı görmek için aşağıdaki API Gezgini'ni kullanın. Alternatif olarak, bağımsız Gezgin'i deneyin.