Google analytics API v4 max results












3















Can someone please help me for Google analytic API V4:
how to pass: max-result parameter with this class:
Google_Service_AnalyticsReporting
I am unable to find relevant function to assign max-result parameter value.










share|improve this question



























    3















    Can someone please help me for Google analytic API V4:
    how to pass: max-result parameter with this class:
    Google_Service_AnalyticsReporting
    I am unable to find relevant function to assign max-result parameter value.










    share|improve this question

























      3












      3








      3








      Can someone please help me for Google analytic API V4:
      how to pass: max-result parameter with this class:
      Google_Service_AnalyticsReporting
      I am unable to find relevant function to assign max-result parameter value.










      share|improve this question














      Can someone please help me for Google analytic API V4:
      how to pass: max-result parameter with this class:
      Google_Service_AnalyticsReporting
      I am unable to find relevant function to assign max-result parameter value.







      google-analytics-v4






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Apr 27 '17 at 11:58









      UTurnUTurn

      235




      235
























          2 Answers
          2






          active

          oldest

          votes


















          2














          You can use parameter page_size: 10000. Hope this helps.






          share|improve this answer































            1














            Based on https://stackoverflow.com/a/38922925/1224827 , the parameter you're looking for is pageSize:



            The correct name of the parameter you are looking for is: pageSize. The Reference Docs provide the full API specifications.



            def get_report(analytics):
            # Use the Analytics Service Object to query the Analytics Reporting API V4.
            return analytics.reports().batchGet(
            body={
            'reportRequests': [
            {
            'viewId': VIEW_ID,
            'pageSize': 10000,
            'dateRanges': [{'startDate': '2016-04-01', 'endDate': '2016-08-09'}],
            'dimensions': [{'name':'ga:date'},
            {'name': 'ga:channelGrouping'}],
            'metrics': [{'expression': 'ga:sessions'},
            {'expression': 'ga:newUsers'},
            {'expression': 'ga:goal15Completions'},
            {'expression': 'ga:goal9Completions'},
            {'expression': 'ga:goal10Completions'}]
            }]
            }
            ).execute()


            Note: the API returns a maximum of 100,000 rows per request, no matter how many you ask for (according to the documentation). As you attempted max_results this tells me you are trying to migrate from the Core Reporting API V3, check out the Migration Guide - Pagination documentation to understand how to request the next 100,000 rows.



            Stack Overflow extra tip. Include your error responses in your question, as it will likely improve your chances of someone being able to help.






            share|improve this answer





















            • 2





              The docs has been updated: The Analytics Core Reporting API returns a maximum of 100,000 rows per request, no matter how many you ask for. under pageSize section.

              – Jimmy Adaro
              Nov 16 '18 at 18:28











            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f43657140%2fgoogle-analytics-api-v4-max-results%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            2














            You can use parameter page_size: 10000. Hope this helps.






            share|improve this answer




























              2














              You can use parameter page_size: 10000. Hope this helps.






              share|improve this answer


























                2












                2








                2







                You can use parameter page_size: 10000. Hope this helps.






                share|improve this answer













                You can use parameter page_size: 10000. Hope this helps.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jul 4 '17 at 8:05









                Dapeng114Dapeng114

                1396




                1396

























                    1














                    Based on https://stackoverflow.com/a/38922925/1224827 , the parameter you're looking for is pageSize:



                    The correct name of the parameter you are looking for is: pageSize. The Reference Docs provide the full API specifications.



                    def get_report(analytics):
                    # Use the Analytics Service Object to query the Analytics Reporting API V4.
                    return analytics.reports().batchGet(
                    body={
                    'reportRequests': [
                    {
                    'viewId': VIEW_ID,
                    'pageSize': 10000,
                    'dateRanges': [{'startDate': '2016-04-01', 'endDate': '2016-08-09'}],
                    'dimensions': [{'name':'ga:date'},
                    {'name': 'ga:channelGrouping'}],
                    'metrics': [{'expression': 'ga:sessions'},
                    {'expression': 'ga:newUsers'},
                    {'expression': 'ga:goal15Completions'},
                    {'expression': 'ga:goal9Completions'},
                    {'expression': 'ga:goal10Completions'}]
                    }]
                    }
                    ).execute()


                    Note: the API returns a maximum of 100,000 rows per request, no matter how many you ask for (according to the documentation). As you attempted max_results this tells me you are trying to migrate from the Core Reporting API V3, check out the Migration Guide - Pagination documentation to understand how to request the next 100,000 rows.



                    Stack Overflow extra tip. Include your error responses in your question, as it will likely improve your chances of someone being able to help.






                    share|improve this answer





















                    • 2





                      The docs has been updated: The Analytics Core Reporting API returns a maximum of 100,000 rows per request, no matter how many you ask for. under pageSize section.

                      – Jimmy Adaro
                      Nov 16 '18 at 18:28
















                    1














                    Based on https://stackoverflow.com/a/38922925/1224827 , the parameter you're looking for is pageSize:



                    The correct name of the parameter you are looking for is: pageSize. The Reference Docs provide the full API specifications.



                    def get_report(analytics):
                    # Use the Analytics Service Object to query the Analytics Reporting API V4.
                    return analytics.reports().batchGet(
                    body={
                    'reportRequests': [
                    {
                    'viewId': VIEW_ID,
                    'pageSize': 10000,
                    'dateRanges': [{'startDate': '2016-04-01', 'endDate': '2016-08-09'}],
                    'dimensions': [{'name':'ga:date'},
                    {'name': 'ga:channelGrouping'}],
                    'metrics': [{'expression': 'ga:sessions'},
                    {'expression': 'ga:newUsers'},
                    {'expression': 'ga:goal15Completions'},
                    {'expression': 'ga:goal9Completions'},
                    {'expression': 'ga:goal10Completions'}]
                    }]
                    }
                    ).execute()


                    Note: the API returns a maximum of 100,000 rows per request, no matter how many you ask for (according to the documentation). As you attempted max_results this tells me you are trying to migrate from the Core Reporting API V3, check out the Migration Guide - Pagination documentation to understand how to request the next 100,000 rows.



                    Stack Overflow extra tip. Include your error responses in your question, as it will likely improve your chances of someone being able to help.






                    share|improve this answer





















                    • 2





                      The docs has been updated: The Analytics Core Reporting API returns a maximum of 100,000 rows per request, no matter how many you ask for. under pageSize section.

                      – Jimmy Adaro
                      Nov 16 '18 at 18:28














                    1












                    1








                    1







                    Based on https://stackoverflow.com/a/38922925/1224827 , the parameter you're looking for is pageSize:



                    The correct name of the parameter you are looking for is: pageSize. The Reference Docs provide the full API specifications.



                    def get_report(analytics):
                    # Use the Analytics Service Object to query the Analytics Reporting API V4.
                    return analytics.reports().batchGet(
                    body={
                    'reportRequests': [
                    {
                    'viewId': VIEW_ID,
                    'pageSize': 10000,
                    'dateRanges': [{'startDate': '2016-04-01', 'endDate': '2016-08-09'}],
                    'dimensions': [{'name':'ga:date'},
                    {'name': 'ga:channelGrouping'}],
                    'metrics': [{'expression': 'ga:sessions'},
                    {'expression': 'ga:newUsers'},
                    {'expression': 'ga:goal15Completions'},
                    {'expression': 'ga:goal9Completions'},
                    {'expression': 'ga:goal10Completions'}]
                    }]
                    }
                    ).execute()


                    Note: the API returns a maximum of 100,000 rows per request, no matter how many you ask for (according to the documentation). As you attempted max_results this tells me you are trying to migrate from the Core Reporting API V3, check out the Migration Guide - Pagination documentation to understand how to request the next 100,000 rows.



                    Stack Overflow extra tip. Include your error responses in your question, as it will likely improve your chances of someone being able to help.






                    share|improve this answer















                    Based on https://stackoverflow.com/a/38922925/1224827 , the parameter you're looking for is pageSize:



                    The correct name of the parameter you are looking for is: pageSize. The Reference Docs provide the full API specifications.



                    def get_report(analytics):
                    # Use the Analytics Service Object to query the Analytics Reporting API V4.
                    return analytics.reports().batchGet(
                    body={
                    'reportRequests': [
                    {
                    'viewId': VIEW_ID,
                    'pageSize': 10000,
                    'dateRanges': [{'startDate': '2016-04-01', 'endDate': '2016-08-09'}],
                    'dimensions': [{'name':'ga:date'},
                    {'name': 'ga:channelGrouping'}],
                    'metrics': [{'expression': 'ga:sessions'},
                    {'expression': 'ga:newUsers'},
                    {'expression': 'ga:goal15Completions'},
                    {'expression': 'ga:goal9Completions'},
                    {'expression': 'ga:goal10Completions'}]
                    }]
                    }
                    ).execute()


                    Note: the API returns a maximum of 100,000 rows per request, no matter how many you ask for (according to the documentation). As you attempted max_results this tells me you are trying to migrate from the Core Reporting API V3, check out the Migration Guide - Pagination documentation to understand how to request the next 100,000 rows.



                    Stack Overflow extra tip. Include your error responses in your question, as it will likely improve your chances of someone being able to help.







                    share|improve this answer














                    share|improve this answer



                    share|improve this answer








                    edited Nov 20 '18 at 3:18

























                    answered Aug 31 '17 at 21:14









                    Blairg23Blairg23

                    4,31413846




                    4,31413846








                    • 2





                      The docs has been updated: The Analytics Core Reporting API returns a maximum of 100,000 rows per request, no matter how many you ask for. under pageSize section.

                      – Jimmy Adaro
                      Nov 16 '18 at 18:28














                    • 2





                      The docs has been updated: The Analytics Core Reporting API returns a maximum of 100,000 rows per request, no matter how many you ask for. under pageSize section.

                      – Jimmy Adaro
                      Nov 16 '18 at 18:28








                    2




                    2





                    The docs has been updated: The Analytics Core Reporting API returns a maximum of 100,000 rows per request, no matter how many you ask for. under pageSize section.

                    – Jimmy Adaro
                    Nov 16 '18 at 18:28





                    The docs has been updated: The Analytics Core Reporting API returns a maximum of 100,000 rows per request, no matter how many you ask for. under pageSize section.

                    – Jimmy Adaro
                    Nov 16 '18 at 18:28


















                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f43657140%2fgoogle-analytics-api-v4-max-results%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    'app-layout' is not a known element: how to share Component with different Modules

                    android studio warns about leanback feature tag usage required on manifest while using Unity exported app?

                    WPF add header to Image with URL pettitions [duplicate]