Google Search Console API Results Two Days Behind the Site. How to Fix? - google-search-api

So I just started working with the Google Search Console API to see top keywords that sent people to a site and interestingly, when I use the API, the most recent data I can get is from two days ago, but if I go directly into the search console website as a user, I can get data from today.
Is there a way to fix this or is it a known limitation? I Know there's a 48-hour delay in getting the search console data into Google Analytics, but I thought that applied only to the GA / Search console connection.

Simple! You just have to define the value for dataState as all to include this fresh data you're referring to.

Related

How can I get the Views Per Hour stat for a YouTube video?

I checked the Youtube API and it's mainly to do with adding functionalities related to the YouTube app rather than getting analytics data about videos.
There is a chrome extension called VidIQ that shows the views per hours of a particular video when going to the video's page on YouTube, so I tried reading the source code for it, but it is all compressed and I can't easily find what I'm looking for.
Could someone explain to me how VidIQ chrome extension is getting the views per hour stat for YouTube? Maybe it's not an official stat from Youtube but a rough estimate calculated by VidIQ. How do they get this information?
I tried debugging the VidIQ chrome extension to search through the source code but adding a simple html tag made the file corrupted and disabled the extension until I repaired it again. I'm having difficulties deciphering the source code.
Most of what VidIQ gets is from the YouTube analytics api and not directly from the YouTube data api although i would be they use some combination of both.
If you create a report that extracts views and run it every hour you should get the results you are looking for.
However i would be willing to be that they cache a lot of the data and do some internal analytics on it. They would need to cache it as the YouTube analytics api only returns data for the last 90 days last i checked.
If your intent is to Reverse Engineer VidIQ you may need to accept that a lot of the data you are seeing is internally stored in their system and generated by them based upon the data that is avaliable in the YouTube Analytics API and the YouTube data apis.

Big Query - Adwords - AuthenticationError.NOT_ADS_USER

I am trying to set up a data extract in BigQuery to pull data from a Google Ads Account. But I keep getting Auth errors (AuthenticationError.NOT_ADS_USER) when the extract tries starting pulling data.
<ApiError><type>AuthenticationError.NOT_ADS_USER</type><trigge
What did I do?-
Set up Big Query and the data extract (as depicted here: https://cloud.google.com/bigquery-transfer/docs/adwords-transfer)
Invited and added the same email address that big query is using to the Google Ads account with read access level (at first) and then standard access level when the problem persisted.
Is there something that I missed, that I have to enable/accept/configure in order for Big query extract to be able to pull the data from Google Ads?
Thanks,
p.s I have another extract in the same big query account with a different Google Ads account that is working, I recall have followed the same steps.
I would recommend to remove and add the user account that you are using to access Google Ads. It's usually related to permissions related issue. Have you followed the steps mentioned here?
https://cloud.google.com/bigquery-transfer/docs/adwords-transfer#required_permissions
If yes, try remove and add again as suggested on both Google Ads and GCP. If it's not working, try creating a case with Google Cloud support team if you have that service enabled if not your marketing folks might have connections with Google to help you out.

How to get same Localized results from Google CSE Json API

i am using the Google CSE Json API in order to receive results on generic queries from Google.
I have configured the Google Engine to return results from all web sites.
i though that this setting would make me use Google as if i was using it from the Google web site via the regular search engine.
BUT - i don't get same results that i would have expected to get from the site. i have major differences and i was wondering why.
From the past reading that i have made, i know that the API uses a certain server(s) around UK, making the results not the same due to the locale settings.
i have read the documentation on the CSE site and saw that there are 2 parameters that i thought would have improved the state:
googlehost - specifying the domain to use. this parameter is deprecated according to the documentation, hence i used the second parameter
gl - specify a country code for the search
both parameters didn't affect my results at all.
i am struggling with this for quite a long time and would appreciate a proper solution for it.
all i want is to have a CSE that acts the same as the google website. Running a search here and there should not differ in the returned results.
your help is highly appreciated.
Regards,
attiass

Google Analytics APIs: get two specific numbers only (as simple as possible)

I want to get two statistics (Visits today, visits total) from my GoogleAnalytics account.
I checked Google Analytics resources such as
https://developers.google.com/analytics/devguides/reporting/?hl=en
https://developers.google.com/analytics/devguides/reporting/core/v3/reference
But it seems pretty time-consuming to get a certain ID, oAuth and everything working.
I do not need any user authentication, just an API request from my backend (GA authentication should be provided via request url for example).
To be honest, I found myself jumping from one link to another when doing tutorial and did not accomplish anything at the end.
What is the quickest way to get everything working? If there is a nice tutorial on getting JUST basic (two numbers) stuff from GoogleAnalytics I would be very grateful (everything I see is working almost as GA itself - just with custom styles/graphs etc. I need plain and simple number returned via REST api for instance.)
Thanks for any info!
Auth is understandably complicated, but it sounds like you need service account authentication since you are querying your own data and need it to run on the back end.
The quickest way to get from zero to querying the API is to follow the Hello Analytics Guide. I have linked you to the PHP service account page. But there are examples of service accounts, web apps, and installed apps in four different languages.
But an outline of the main steps are
Create a project in the Google developer console
Within that project create a service account and download the p12 file.
add that service account email to the particular view you wish to query.
You are now ready to modify the Hello Analytics example.
Below is a simple query for the number sessions today:
function getResults(&$analytics) {
return $analytics->data_ga->get(
'ga:XXXX', // Replace with your view ID.
'today',
'today',
'ga:sessions');
}
Feel free to ask any clarifying questions in the comments section.

Alternative to the deprecated google REST web search API

I have been using the Google Websearch API for over 1 year now. The service was deprecated in Nov 2010 but continues to provide results to date. More recently, google has started to enforce the 1,000 queries (?) per day limit on this deprecated service. I swear, last month I made over 10,000 API calls in one day without any errors from the service (same IP, same API key).
So I guess my question is has anyone found an alternative yet? I know yahoo boss is pretty good but I am working exclusively on Google for my projects. I do not mind spending money for for this service either as long as i can get 64 results from Google.
On that thought, how are services like Zoomrank able to bypass all Google limits? I have a subscription with Zoomrank and I can get daily rankings for all my keywords. Do they have a tie-up with Google or are they just accessing some secret service I don't know about.
Some people have suggested the new Google custom search, but i dont know how does that help me search the web? Google CS is limited to the CSE you create and searches within those engines. If I am looking for web results for Pizza, Google CS doesnt help me.
Thanks for your input. Much appreciated
UPDATE: #ggez44 points to some official Google documentation of the solution described below here: http://support.google.com/customsearch/bin/answer.py?hl=en&answer=1210656
You can use the Google Custom Search Engine to search the entire web.
In brief:
Create a CSE that searches a single site (e.g. google.com)
In the CSE control panel's Basics section, set to "Search the entire web but emphasize certain sites"
In the Sites section, delete the single site that you added when you created the CSE
Full details here:
http://www.google.com/support/forum/p/customsearch/thread?tid=56c0bd92dda351b7&hl=en&fid=56c0bd92dda351b7000495e3f500d83f
Once that's implemented, you can enable billing in the Google API Console at a CPM of $5, to a total of 10,000 queries.
Google API Console: https://code.google.com/apis/console/
Pricing: https://code.google.com/apis/customsearch/v1/overview.html#Pricing