{"push_id":1471563565,"size":6,"distinct_size":6,"ref":"refs/heads/story/show-number-of-page-views","head":"2318fb2b792eb44facee8d9db226f623d74453a5","before":"056db8b8e6a341c6557661ed74cb426d65a20847","commits":[{"sha":"9e0fca5ab738956372aee753c671cb81f1e6607c","author":{"name":"Ikenna Okpala","email":"b4a5ea001e047040e8c9075b67a268293138da2c@ikennaokpala.com"},"message":"Setup Google Analytics request client\n\nIn order to interact with the Google Analytics Reporting API, this defines\na wrapper service that sets up the a client is an instance of\nAnalyticsReportingService with the google service account credentials\nsupplied and setup.\n\nAt the moment the service account credentials is provided via a JSON file\nthat contains a private key, account’s email (i.e client’s email) and other\nattributes.\n\nUpon investigation [1] the private key, client email and scope appear to be\nthe most sort after, hence why the tests ensures that the api client’s\nauthorisation is setup as expected.\n\n[1] https://github.com/google/google-auth-library-ruby/blob/82a4f8520cc8897bbcf0485d4ea678317619c84e/lib/googleauth/service_account.rb#L57","distinct":true,"url":"https://api.github.com/repos/alphagov/content-performance-manager/commits/9e0fca5ab738956372aee753c671cb81f1e6607c"},{"sha":"5f832ee7c30d201eff455b89f2d246dda2ef64b9","author":{"name":"Ikenna Okpala","email":"b4a5ea001e047040e8c9075b67a268293138da2c@ikennaokpala.com"},"message":"Build report requests for retrieving page views\n\nThis ruby client [1]  for Google Analytics Reporting API, provides, classes and methods,\nthat help construct the request body that gets sent the API.\n\nWithin exists a method that constructs the request required for getting page views count\nfor a content item (i.e base_path). This method can accept base pages, start and end date\nrange for the report. Some more information and examples in here [2] and [3]\n\n[1] http://www.rubydoc.info/gems/google-api-client/Google/Apis/AnalyticsreportingV4\n[2] https://developers.google.com/analytics/devguides/reporting/core/v4/basics\n[3] https://developers.google.com/analytics/devguides/reporting/core/v4/rest/v4/reports/batchGet#ReportRequest.FIELDS.date_ranges","distinct":true,"url":"https://api.github.com/repos/alphagov/content-performance-manager/commits/5f832ee7c30d201eff455b89f2d246dda2ef64b9"},{"sha":"c61a6337cb91a894848c51678ba1079d90638367","author":{"name":"Ikenna Okpala","email":"b4a5ea001e047040e8c9075b67a268293138da2c@ikennaokpala.com"},"message":"Retrieving page view for just one content item\n\nThis adds implementation for extracting the page view from the\nGoogle Analytics Reporting API.\n\nThis response from the API is returned as an instance of [1]. when\nthis is converted to json it returns [3].\n\nIn the test a partial in memory version has been used.\n\nFor more on query, see [2]\n\n[1] Google::Apis::AnalyticsreportingV4::GetReportsResponse\n[2] https://developers.google.com/analytics/devguides/reporting/core/v4/parameters\n[3] {\n \"reports\": [\n  {\n   \"columnHeader\": {\n    \"metricHeader\": {\n     \"metricHeaderEntries\": [\n      {\n       \"name\": \"ga:pageViews\",\n       \"type\": \"INTEGER\"\n      }\n     ]\n    }\n   },\n   \"data\": {\n    \"rows\": [\n     {\n      \"metrics\": [\n       {\n        \"values\": [\n         \"4\"\n        ]\n       }\n      ]\n     }\n    ],\n    \"totals\": [\n     {\n      \"values\": [\n       \"43\"\n      ]\n     }\n    ],\n    \"rowCount\": 1,\n    \"minimums\": [\n     {\n      \"values\": [\n       \"43\"\n      ]\n     }\n    ],\n    \"maximums\": [\n     {\n      \"values\": [\n       \"43\"\n      ]\n     }\n    ]\n   }\n  }\n ]\n}","distinct":true,"url":"https://api.github.com/repos/alphagov/content-performance-manager/commits/c61a6337cb91a894848c51678ba1079d90638367"},{"sha":"598cbe307d8ab6145e905f95cade8654d6205b3a","author":{"name":"Ikenna Okpala","email":"b4a5ea001e047040e8c9075b67a268293138da2c@ikennaokpala.com"},"message":"Retrieving page view for more than one content item\n\nThis adds implementation that supports the querying for page views from the\nGoogle Analytics Reporting API for more than one content item.\n\nThe request builder has been altered to fit [2] and response from the API is\nreturned with a data structure similar to [3].\n\nFor more on query, see [1]\n\n[1] https://developers.google.com/analytics/devguides/reporting/core/v4/parameters\n[2] {\n \"reportRequests\": [\n  {\n   \"viewId\": \"53872948\",\n   \"dimensionFilterClauses\": [\n    {\n     \"filters\": [\n      {\n       \"expressions\": [\n        \"/check-uk-visa\"\n       ],\n       \"dimensionName\": \"ga:pagePath\",\n       \"operator\": \"EXACT\"\n      },\n      {\n       \"expressions\": [\n        \"/marriage-abroad\"\n       ],\n       \"dimensionName\": \"ga:pagePath\",\n       \"operator\": \"EXACT\"\n      }\n     ]\n    }\n   ],\n   \"dateRanges\": [\n    {\n     \"startDate\": \"2016-12-19\",\n     \"endDate\": \"2016-12-19\"\n    }\n   ],\n   \"dimensions\": [\n    {\n     \"name\": \"ga:pagePath\"\n    }\n   ]\n  }\n ]\n}\n[3] {\n \"reports\": [\n  {\n   \"columnHeader\": {\n    \"dimensions\": [\n     \"ga:pagePath\"\n    ],\n    \"metricHeader\": {\n     \"metricHeaderEntries\": [\n      {\n       \"name\": \"ga:visits\",\n       \"type\": \"INTEGER\"\n      }\n     ]\n    }\n   },\n   \"data\": {\n    \"rows\": [\n     {\n      \"dimensions\": [\n       \"/check-uk-visa\"\n      ],\n      \"metrics\": [\n       {\n        \"values\": [\n         \"7211\"\n        ]\n       }\n      ]\n     },\n     {\n      \"dimensions\": [\n       \"/marriage-abroad\"\n      ],\n      \"metrics\": [\n       {\n        \"values\": [\n         \"443\"\n        ]\n       }\n      ]\n     }\n    ],\n    \"totals\": [\n     {\n      \"values\": [\n       \"7654\"\n      ]\n     }\n    ],\n    \"rowCount\": 2,\n    \"minimums\": [\n     {\n      \"values\": [\n       \"443\"\n      ]\n     }\n    ],\n    \"maximums\": [\n     {\n      \"values\": [\n       \"7211\"\n      ]\n     }\n    ],\n    \"isDataGolden\": true\n   }\n  }\n ]\n}","distinct":true,"url":"https://api.github.com/repos/alphagov/content-performance-manager/commits/598cbe307d8ab6145e905f95cade8654d6205b3a"},{"sha":"9048f7714fbd97b9fab05c0bd123c5a20ad12050","author":{"name":"Ikenna Okpala","email":"b4a5ea001e047040e8c9075b67a268293138da2c@ikennaokpala.com"},"message":"Add number of page views for a content item\n\nFor every content item, content designers want to see the number of page\nviews a content item is belonging to an organisation.\n\nHere a new column/attribute (i.e `number_of_views`) has been added to the\ncontent_item(s).\n\nThe `number_of_views` attribute’s value is obtained from Google Analytics\nReporting API.","distinct":true,"url":"https://api.github.com/repos/alphagov/content-performance-manager/commits/9048f7714fbd97b9fab05c0bd123c5a20ad12050"},{"sha":"2318fb2b792eb44facee8d9db226f623d74453a5","author":{"name":"Ikenna Okpala","email":"b4a5ea001e047040e8c9075b67a268293138da2c@ikennaokpala.com"},"message":"Render content item’s number of page views\n\nFor each organisation’s content item, content designers want to know the\nnumber of page views of a content item.\n\nIn previous commits the number of page views attribute was defined and\nadded to the import.\n\nThis commit updates the content items view table to show the number of\npage views (i.e `number_of_views`).","distinct":true,"url":"https://api.github.com/repos/alphagov/content-performance-manager/commits/2318fb2b792eb44facee8d9db226f623d74453a5"}]}
{"actor":{"display_login":"ikennaokpala"}}