वह व्यू (प्रोफ़ाइल) पा सकता है जिसका उपयोगकर्ता के पास ऐक्सेस है. इसे अभी आज़माएं या उदाहरण देखें.
यह तरीका स्टैंडर्ड पैरामीटर के अलावा, पैरामीटर टेबल में दिए गए पैरामीटर के साथ भी काम करता है.
अनुरोध करें
एचटीटीपी अनुरोध
GET 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 |
https://www.googleapis.com/auth/analytics.readonly |
अनुरोध का मुख्य भाग
इस तरीके से अनुरोध का मुख्य हिस्सा न दें.
जवाब
अगर यह तरीका काम करता है, तो जवाब देने वाले पेज में मैनेजमेंट.प्रोफ़ाइल संसाधन दिखता है.
उदाहरण
ध्यान दें: इस तरीके के लिए दिए गए कोड के उदाहरणों में इसके साथ काम करने वाली सभी प्रोग्रामिंग भाषाएं नहीं दिखाई गई हैं (इसके साथ काम करने वाली भाषाओं की सूची के लिए क्लाइंट लाइब्रेरी वाला पेज देखें).
Java
Java क्लाइंट लाइब्रेरी का इस्तेमाल करता है.
/** * Note: This code assumes you have an authorized Analytics service object. * See the View (Profile) Developer Guide for details. */ // This request gets an existing view (profile). try { Profile profile = analytics.management.profiles .get("12345", "UA-12345-1", "523").execute(); } catch (GoogleJsonResponseException e) { System.err.println("There was a service error: " + e.getDetails().getCode() + " : " + e.getDetails().getMessage()); }
PHP
PHP क्लाइंट लाइब्रेरी का इस्तेमाल करता है.
/** * Note: This code assumes you have an authorized Analytics service object. * See the View (Profile) Dev Guide for details. */ /** * This request gets an existing view (profile). */ try { $profile = $analytics->management_profiles->get('123456', 'UA-123456-1', '89447828'); } 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(); }
Python
Python क्लाइंट लाइब्रेरी का इस्तेमाल करता है.
# Note: This code assumes you have an authorized Analytics service object. # See the View (Profile) Developer Guide for details. # This request gets an existing view (profile). try: profile = analytics.management().profiles().get( accountId='12345', webPropertyId='UA-12345-1', profileId='523').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))
JavaScript
JavaScript क्लाइंट लाइब्रेरी का इस्तेमाल करता है.
/* * Note: This code assumes you have an authorized Analytics client object. * See the View (Profile) Developer Guide for details. */ /* * This request gets an existing view (profile). */ function getView() { var request = gapi.client.analytics.management.profiles.get({ 'accountId': '123456', 'webPropertyId': 'UA-123456-1', 'profileId': '7654321' }); request.execute(function (response) { // Handle the response. }); }
इसे आज़माएं!
इस तरीके को लाइव डेटा पर कॉल करने और जवाब देखने के लिए, नीचे दिए गए एपीआई एक्सप्लोरर का इस्तेमाल करें. इसके अलावा, स्टैंडअलोन एक्सप्लोरर आज़माकर देखें.