{"action":"created","issue":{"url":"https://api.github.com/repos/PromInc/organic-search-analytics/issues/10","labels_url":"https://api.github.com/repos/PromInc/organic-search-analytics/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/PromInc/organic-search-analytics/issues/10/comments","events_url":"https://api.github.com/repos/PromInc/organic-search-analytics/issues/10/events","html_url":"https://github.com/PromInc/organic-search-analytics/issues/10","id":116634434,"number":10,"title":"Data Validity","user":{"login":"PromInc","id":7319505,"avatar_url":"https://avatars.githubusercontent.com/u/7319505?v=3","gravatar_id":"","url":"https://api.github.com/users/PromInc","html_url":"https://github.com/PromInc","followers_url":"https://api.github.com/users/PromInc/followers","following_url":"https://api.github.com/users/PromInc/following{/other_user}","gists_url":"https://api.github.com/users/PromInc/gists{/gist_id}","starred_url":"https://api.github.com/users/PromInc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PromInc/subscriptions","organizations_url":"https://api.github.com/users/PromInc/orgs","repos_url":"https://api.github.com/users/PromInc/repos","events_url":"https://api.github.com/users/PromInc/events{/privacy}","received_events_url":"https://api.github.com/users/PromInc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-12T20:35:12Z","updated_at":"2015-11-19T20:42:08Z","closed_at":null,"body":"The issue has been addressed to me on multiple occasions that the data retrieved by this tool is not accurate when compared to Google Search Console and/or the Google API Explorer.\r\n\r\nI am starting this issue in hopes that a community discussion can come out of it to either prove or disprove the theory.\r\n\r\nI do see some anomalies in the data, but I'm guessing it's an issue potentially in the Google API.  At the time of writing this the [Google API](https://github.com/google/google-api-php-client) that is being utilized is still technically in beta.\r\n\r\nA discussion on this topic that triggered me to start this issue can be found in the comments on [my blog post](http://promincproductions.com/blog/google-api-access-google-search-analytics-from-google-search-console/#comment-22) about this tool.\r\n\r\nI ran a few tests on the largest site that I have access to and came up with the following data:\r\n\r\nData Capture Method|Number of Impressions|Description\r\n----------------------------|----------------------------|--------------\r\nAPI Explorer|8,335|Google API Explorer without a row limit set\r\nAPI Explorer w Row Limit 5000|16,250|Google API Explorer with a row limit set\r\nOrganic Search Analytics|16,078|Utilizing the reporting tool in the Organic Search Analytics\r\nOrganic Search Analytics DB|16,078|Running a query directly in the database from the same data the tool accesses\r\nGoogle Search Console reported|64,729|The number listed at the top of a report above the cart\r\nGSC download|11,699|The sum of impressions found after downloading a report\r\n\r\n\r\n![osa-data-validity-gsc](https://cloud.githubusercontent.com/assets/7319505/11129925/c2f8166c-8947-11e5-8e74-41df126ebafd.JPG)\r\n![osa-data-validity-osa](https://cloud.githubusercontent.com/assets/7319505/11129926/c2fdb4b4-8947-11e5-9c2b-f2692af79c4d.JPG)\r\n![osa-data-validity-gapiexp](https://cloud.githubusercontent.com/assets/7319505/11130169/4829d054-8949-11e5-92b7-3bb05cf21a6f.JPG)\r\n\r\nOne item to note is where in the code you can find what data is passed to the Google API request.\r\nIn `organic-search-analytics/inc/code/dataCapture.php`:\r\n[Lines 21-25](https://github.com/PromInc/organic-search-analytics/blob/master/organic-search-analytics/inc/code/dataCapture.php#L21-L25) are the default settings that get used at [Line 139](https://github.com/PromInc/organic-search-analytics/blob/master/organic-search-analytics/inc/code/dataCapture.php#L139).  On this line, we merge in an array of additional override parameters that *can* be set for advanced users by creating a custom call to `data-capture-run.php`.  Overrides are not applied when using the GUI of the Organic Search Analytics tool.\r\n\r\nOne last item to point out is acutally quoting something I said in the comments on my blog the other day about how I understand these tools to operate which should explain the differences we find between GSC and OSA/API Explorer in my test above.  But it doesn't really explain why there is a slight difference between the API Explorer and OSA (Google API) that is displayed in my data sample above.\r\n>First off, yes it is common that the data will be slightly different based on how Google has designed their system. Google Search Console provides up to 1,000 records per report. But this tool is utilizing the API access data, which provides 5,000 records per report. That is one of the reasons it pulls data on a daily basis – to ensure that it captures as much data as possible. That’s my reasoning for saying that typically this tool will show more data than GSC would.\r\n\r\n>Also to note, when you pull data for one day it actually pulls three reports – Web, Image, and Video. In GSC you can only view one of these at a time, where as in this tool you can view them as combined or separate.\r\n\r\n>But probably the biggest reason for the discrepancy is that Google doesn’t even display their data accurately in their own tool – and this is intentional. I heard Google’s own John Mueller explain this scenario within the past month or two but can’t recall exactly where to link to it. My assumption is that your 30k impressions number you found at the top of the GSC page just above the chart. As I understand it, that is a “fairly accurate” number from Google’s eyes and it’s intended to be all encompassing of the real world scenario of what happened on their site. However, if you were to click the download button at the bottom of a GSC report page and total up the impressions that you get in that report (which is the same as what is shown on the website) it will never match up to the number you saw at the top of the page. Again, this is an intentional “feature” that Google provides. Bottom line – they don’t provide you with all of the data.\r\n\r\n>For that reason, each and every marketer gets to make their own opinion about if they choose to use this data or not, and if so at what level do we rely on this data. I see it as this data is great at identifying overall site trends. I take the assumption that Google provides a completely random sample of data as opposed to selectively excluding data on an algorithm of what they want to provide you. Also to note, Google Analytics does something kind of similar… They record and provide you all of your data until a report gets too large and then they randomly sample it in your reports. Despite this being frustrating and potentially invalid data, a large majority of businesses rely on Google Analytics to make business decisions.\r\n\r\n>I hope that makes sense and helps you to understand the tool and it’s data a bit more – it’s designed to do the best it can with what information it is provided.\r\n\r\n>One last thing to point out is as of right now the reporting tool does not display Bing data (if you captured it). It will be added at some point, but for now it collects and stores Bing data only and is holds it until it gets added to the reporting tool.\r\n\r\nPlease leave your comments below about your personal findings and if you have any suggestions on how this tool could better capture the data from Google to be more accurate to what the API Explorer is providing."},"comment":{"url":"https://api.github.com/repos/PromInc/organic-search-analytics/issues/comments/158191897","html_url":"https://github.com/PromInc/organic-search-analytics/issues/10#issuecomment-158191897","issue_url":"https://api.github.com/repos/PromInc/organic-search-analytics/issues/10","id":158191897,"user":{"login":"Ninjataktikz","id":8031147,"avatar_url":"https://avatars.githubusercontent.com/u/8031147?v=3","gravatar_id":"","url":"https://api.github.com/users/Ninjataktikz","html_url":"https://github.com/Ninjataktikz","followers_url":"https://api.github.com/users/Ninjataktikz/followers","following_url":"https://api.github.com/users/Ninjataktikz/following{/other_user}","gists_url":"https://api.github.com/users/Ninjataktikz/gists{/gist_id}","starred_url":"https://api.github.com/users/Ninjataktikz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ninjataktikz/subscriptions","organizations_url":"https://api.github.com/users/Ninjataktikz/orgs","repos_url":"https://api.github.com/users/Ninjataktikz/repos","events_url":"https://api.github.com/users/Ninjataktikz/events{/privacy}","received_events_url":"https://api.github.com/users/Ninjataktikz/received_events","type":"User","site_admin":false},"created_at":"2015-11-19T20:42:08Z","updated_at":"2015-11-19T20:42:08Z","body":"Hi Prominc,\r\n\r\nAny update on this as of lately.\r\n\r\n-Gary"}}