Views (Profiles): patch

অনুমোদন প্রয়োজন

একটি বিদ্যমান ভিউ (প্রোফাইল) আপডেট করে। এই পদ্ধতি প্যাচ শব্দার্থবিদ্যা সমর্থন করে. এখন এটি চেষ্টা করুন বা একটি উদাহরণ দেখুন

স্ট্যান্ডার্ড প্যারামিটারগুলি ছাড়াও, এই পদ্ধতিটি প্যারামিটার টেবিলে তালিকাভুক্ত পরামিতিগুলিকে সমর্থন করে।

অনুরোধ

HTTP অনুরোধ

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

পরামিতি

পরামিতি নাম মান বর্ণনা
পাথ প্যারামিটার
accountId string অ্যাকাউন্ট আইডি যার ভিউ (প্রোফাইল) অন্তর্গত
profileId string ভিউ এর আইডি (প্রোফাইল) আপডেট করতে হবে।
webPropertyId string ওয়েব প্রপার্টি আইডি যার ভিউ (প্রোফাইল) অন্তর্গত

অনুমোদন

এই অনুরোধের জন্য নিম্নলিখিত সুযোগের সাথে অনুমোদনের প্রয়োজন ( প্রমাণিকরণ এবং অনুমোদন সম্পর্কে আরও পড়ুন )।

ব্যাপ্তি
https://www.googleapis.com/auth/analytics.edit

শরীরের অনুরোধ

অনুরোধের অংশে, প্যাচ শব্দার্থবিদ্যার নিয়ম অনুসারে একটি management.profile সম্পদের প্রাসঙ্গিক অংশগুলি সরবরাহ করুন৷

প্রতিক্রিয়া

সফল হলে, এই পদ্ধতিটি প্রতিক্রিয়া বডিতে একটি management.profile রিসোর্স প্রদান করে।

উদাহরণ

দ্রষ্টব্য: এই পদ্ধতির জন্য উপলব্ধ কোড উদাহরণগুলি সমস্ত সমর্থিত প্রোগ্রামিং ভাষার প্রতিনিধিত্ব করে না (সমর্থিত ভাষার তালিকার জন্য ক্লায়েন্ট লাইব্রেরি পৃষ্ঠা দেখুন)।

জাভা

জাভা ক্লায়েন্ট লাইব্রেরি ব্যবহার করে।

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


/*
 * This request patches an existing View (Profile).
 */

// Construct the body of the request.
Profile body = new Profile();
body.setECommerceTracking(true);
body.setEnhancedECommerceTracking(true);
body.setTimezone("America/Chicago");

try {
  analytics.management().profiles().patch("123456", "UA-123456-1",
      "7654321", body).execute();
} catch (GoogleJsonResponseException e) {
  System.err.println("There was a service error: "
      + e.getDetails().getCode() + " : "
      + e.getDetails().getMessage());
}

পিএইচপি

পিএইচপি ক্লায়েন্ট লাইব্রেরি ব্যবহার করে।

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

/**
 * This request patches an existing view (profile).
 */

// Construct the body of the request.
$profile = new Google_Service_Analytics_Profile();
$profile->setName('eCommerce View');
$profile->setECommerceTracking(True);
$profile->setEnhancedECommerceTracking(True);

try {
  $analytics->management_profiles->patch('123456', 'UA-123456-1',
      '7654321', $profile);

} 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();
}



পাইথন

পাইথন ক্লায়েন্ট লাইব্রেরি ব্যবহার করে।

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

# This request patches an existing View (Profile).
try:
  analytics.management().profiles().patch(
      accountId='123456',
      webPropertyId='UA-123456-1',
      profileId='7654321',
      body={
          'eCommerceTracking': True,
          'enhancedECommerceTracking': True,
          'timezone': 'America/Chicago'
      }
  ).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))

জাভাস্ক্রিপ্ট

জাভাস্ক্রিপ্ট ক্লায়েন্ট লাইব্রেরি ব্যবহার করে।

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

/*
 * This request patches an existing view (profile).
 */
function patchView() {
  var request = gapi.client.analytics.management.profiles.patch(
    {
      'accountId': '123456',
      'webPropertyId': 'UA-123456-1',
      'profileId': '7654321',
      'resource': {
        'eCommerceTracking': true,
        'timezone': 'America/Chicago'
      }
    });
  request.execute(function (response) { // Handle the response. });
}

এটা চেষ্টা করুন!

লাইভ ডেটাতে এই পদ্ধতিতে কল করতে এবং প্রতিক্রিয়া দেখতে নীচের APIs এক্সপ্লোরার ব্যবহার করুন। বিকল্পভাবে, স্বতন্ত্র এক্সপ্লোরার ব্যবহার করে দেখুন।