Profile Filter Links: patch

Memerlukan otorisasi

Memperbarui link filter profil yang ada. Metode ini mendukung semantik patch. Coba sekarang atau lihat contohnya.

Permintaan

Permintaan HTTP

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

Parameter

Nama parameter Nilai Deskripsi
Parameter jalur
accountId string ID akun yang memiliki link filter profil.
linkId string ID link filter profil yang akan diperbarui.
profileId string ID profil yang mencakup link filter
webPropertyId string ID properti web yang memiliki link filter profil

Otorisasi

Permintaan ini memerlukan otorisasi dengan cakupan berikut (baca lebih lanjut tentang autentikasi dan otorisasi).

Cakupan
https://www.googleapis.com/auth/analytics.edit

Isi permintaan

Dalam isi permintaan, berikan bagian yang relevan dari resource Link Filter Profil, sesuai dengan aturan semantik patch.

Respons

Jika berhasil, metode ini menampilkan resource Link Filter Profil dalam isi respons.

Contoh

Catatan: Contoh kode yang tersedia untuk metode ini tidak merepresentasikan semua bahasa pemrograman yang didukung (lihat halaman library klien untuk mengetahui daftar bahasa yang didukung).

Java

Menggunakan library klien Java.

/*
 * 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

Menggunakan library klien Python.

# 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))

Cobalah!

Gunakan APIs Explorer di bawah untuk memanggil metode ini pada data live dan melihat responsnya. Atau, coba Explorer mandiri.