Profile Filter Links: patch

נדרשת הרשאה

עדכון קישור למסנן פרופיל קיים. השיטה הזו תומכת בסמנטיקה של תיקונים. אפשר לנסות עכשיו או לראות דוגמה.

בקשה

בקשת HTTP

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

פרמטרים

שם הפרמטר ערך תיאור
פרמטרים של נתיב
accountId string מספר החשבון שאליו שייך הקישור למסנן הפרופיל.
linkId string המזהה של הקישור למסנן הפרופיל שברצונך לעדכן.
profileId string מזהה הפרופיל שאליו שייך הקישור למסנן
webPropertyId string מזהה נכס האינטרנט שאליו שייך הקישור של מסנן הפרופיל

אישור

הבקשה הזו מחייבת הרשאה עם ההיקף הבא (מידע נוסף על אימות והרשאה).

היקף
https://www.googleapis.com/auth/analytics.edit

גוף הבקשה

בגוף הבקשה, מספקים את החלקים הרלוונטיים של משאב של קישורים למסנן פרופילים, בהתאם לכללי הסמנטיקה של תיקון.

תשובה

אם הפעולה בוצעה בהצלחה, השיטה הזו מחזירה משאב של קישורים למסנן הפרופיל בגוף התגובה.

דוגמאות

הערה: דוגמאות הקוד הזמינות לשיטה זו לא מייצגות את כל שפות התכנות הנתמכות (רשימת השפות הנתמכות זמינה בדף של ספריות המשתמשים).

Java

משתמש בספריית הלקוח של 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

משתמש בספריית הלקוח של 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))

רוצה לנסות?

צריך להשתמש ב-APIs Explorer שבהמשך כדי לקרוא לשיטה הזו בנתונים בזמן אמת ולראות את התגובה. לחלופין, אפשר לנסות את ה-Explorer העצמאי.