অনুমোদন প্রয়োজন
একটি নতুন নমুনাবিহীন প্রতিবেদন তৈরি করুন। একটি উদাহরণ দেখুন ।
অনুরোধ
HTTP অনুরোধ
POST https://www.googleapis.com/analytics/v3/management/accounts/accountId/webproperties/webPropertyId/profiles/profileId/unsampledReports
পরামিতি
পরামিতি নাম | মান | বর্ণনা |
---|---|---|
পাথ প্যারামিটার | ||
accountId | string | নমুনাবিহীন রিপোর্ট তৈরি করতে অ্যাকাউন্ট আইডি। |
profileId | string | নমুনাবিহীন রিপোর্ট তৈরি করতে আইডি দেখুন (প্রোফাইল)। |
webPropertyId | string | নমুনাবিহীন রিপোর্ট তৈরি করার জন্য ওয়েব প্রপার্টি আইডি। |
অনুমোদন
এই অনুরোধের জন্য নিম্নলিখিত স্কোপের মধ্যে অন্তত একটির অনুমোদন প্রয়োজন ( প্রমাণিকরণ এবং অনুমোদন সম্পর্কে আরও পড়ুন )।
ব্যাপ্তি |
---|
https://www.googleapis.com/auth/analytics |
https://www.googleapis.com/auth/analytics.edit |
শরীরের অনুরোধ
অনুরোধের অংশে, নিম্নলিখিত বৈশিষ্ট্য সহ একটি management.unsampledReport সংস্থান সরবরাহ করুন:
সম্পত্তির নাম | মান | বর্ণনা | মন্তব্য |
---|---|---|---|
প্রয়োজনীয় বৈশিষ্ট্য | |||
end-date | string | নমুনাবিহীন রিপোর্টের শেষ তারিখ। | লিখনযোগ্য |
metrics | string | নমুনাবিহীন প্রতিবেদনের মেট্রিক্স। | লিখনযোগ্য |
start-date | string | নমুনাবিহীন প্রতিবেদনের শুরুর তারিখ। | লিখনযোগ্য |
title | string | নমুনাবিহীন প্রতিবেদনের শিরোনাম। | লিখনযোগ্য |
ঐচ্ছিক বৈশিষ্ট্য | |||
dimensions | string | নমুনাবিহীন প্রতিবেদনের মাত্রা। | লিখনযোগ্য |
filters | string | নমুনাবিহীন প্রতিবেদনের জন্য ফিল্টার। | লিখনযোগ্য |
segment | string | নমুনাবিহীন প্রতিবেদনের সেগমেন্ট। | লিখনযোগ্য |
প্রতিক্রিয়া
সফল হলে, এই পদ্ধতিটি প্রতিক্রিয়া বডিতে একটি management.unsampledReport সংস্থান প্রদান করে।
উদাহরণ
দ্রষ্টব্য: এই পদ্ধতির জন্য উপলব্ধ কোড উদাহরণগুলি সমস্ত সমর্থিত প্রোগ্রামিং ভাষার প্রতিনিধিত্ব করে না (সমর্থিত ভাষার তালিকার জন্য ক্লায়েন্ট লাইব্রেরি পৃষ্ঠা দেখুন)।
জাভা
জাভা ক্লায়েন্ট লাইব্রেরি ব্যবহার করে।
/* * Note: This code assumes you have an authorized Analytics service object. * See the Unsampled Reports Developer Guide for details. */ /* * This example creates a new unsampled report. */ UnsampledReport body = new UnsampledReport(); body.setTitle("A test report"); body.setStartDate("2013-01-01"); body.setEndDate("2013-03-31"); body.setMetrics("ga:pageviews,ga:bounces"); body.setDimensions("ga:browser"); body.setFilters("ga:bounces>=100"); body.setSegment("gaid:-1"); try { analytics.management().unsampledReports().insert("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 Unsampled Reports Developer Guide for details. */ /** * This request creates a new Unsampled Report. */ // Construct an unsampled report object. $unsampledReport = new Google_Service_Analytics_UnsampledReport(); $unsampledReport->setTitle('A test report'); $unsampledReport['start-date'] = '2013-01-01'; $unsampledReport['end-date'] = '2013-03-31'; $unsampledReport->setMetrics('ga:pageviews,ga:bounces'); $unsampledReport->setDimensions('ga:browser'); $unsampledReport->setFilters('ga:bounces>=100'); $unsampledReport->setSegment('gaid:-1'); try { $analytics->management_unsampledReports->insert('123456', 'UA-123456-1', '7654321', $unsampledReport); } 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 Unsampled Reports Developer Guide for details. # This request creates an new unsampled report. try: reports = analytics.management().unsampledReports().insert( accountId='123456', webPropertyId='UA-123456-1', profileId='7654321', body={ 'title': 'A test Report', 'start-date': '2013-01-01', 'end-date': '2013-01-31', 'metrics': 'ga:pageviews,ga:bounces', 'dimensions': 'ga:browser', 'filters': 'ga:bounces>=100', 'segment': 'gaid::-1' } ).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 Unsampled Reports Developer Guide for details. */ /* * This request creates an new unsampled report. */ function insertView() { var request = gapi.client.analytics.management.unsampledReports.insert( { 'accountId': '123456', 'webPropertyId': 'UA-123456-1', 'profileId': '7654321', 'resource': { 'title': 'A test Report', 'start-date': '2013-01-01', 'end-date': '2013-01-31', 'metrics': 'ga:pageviews,ga:bounces', 'dimensions': 'ga:browser', 'filters': 'ga:bounces>=100', 'segment': 'gaid::-1' } }); request.execute(function (response) { /* Handle the response. */ }); }