Big Query - Adwords - AuthenticationError.NOT_ADS_USER - google-bigquery

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.

Related

Google Search Console API Results Two Days Behind the Site. How to Fix?

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.

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.

Google Adwords Keyword Tool API to automatically extract data onto a website

Im looking to use Google Adwords Keyword tool data on a website. Ive been looking around in the API and I cant find much to match what I need. I noticed a lot of keyword research tool websites use google as their main source for their information. How would I go about doing this and extracting the data and have it run on a website automatically so it wouldnt need to be updated manually each month?
you can use the Traffic Estimator service in the AdWords API:
https://developers.google.com/adwords/api/docs/reference/v201409/TrafficEstimatorService
Be warned that this is notoriously inaccurate (which is odd given that you would think Google had its own data to call upon!)
I use the TargetingIdea service in the AdWords API to generate lists of keywords to use for building AdWords campaigns. (https://developers.google.com/adwords/api/docs/reference/v201409/TargetingIdeaService.TargetingIdea)
First off you need an API key - they're not that easy to get and your app needs to offer a whole lot of features to meet the required minimum functionality - take a look here https://developers.google.com/adwords/api/docs/requirements
Once you've jumped over that hurdle you get the data from Google by sending a request to the service. That request includes some targeting criteria like location and language and also a "seed" keyword. You can also specify if you want closely related results or broadly related results.
For example if you sold tractors you'd put 'tractors' in as a seed keyword and then the API would return either closely related terms like 'tractors for sale', 'used tractor spares' etc or more broadly related terms like 'agricultural machinery'.

List emails of clients accounts on Google Apps

You will have to excuse my confusion here...
Basically, we have clients with hosted accounts and I need to somehow get a list of emails per domain name.
Say, test.com is a Google hosted account and that it uses Google's email service for admin#test.com, and several more, how can I find (programmaticaly) this complete list of emails?
I've looked around for a while and it only brought more confusion. I think my question relates to this Google API document.
While I'm usually armed with at least one line of code, I'm really clueless on this issue. Perhaps someone out there might shed light on this issue.
PS: I also tried Google API Explorer, but it didn't help at all.
You should use Google Apps Reporting API and get the Accounts report. Of-course, OAuth is recommended auth approach.
http://code.google.com/googleapps/domain/reporting/google_apps_reporting_api.html#Accounts_Report
Provisioning API can also perform the same task and with a real time list of users:
http://code.google.com/googleapps/domain/provisioning_API_v2_developers_guide.html#Retrieving_Users_in_a_Domain
But, its going to be slower for bigger domains since its a paginated feed. Reporting API on the other downloads a CSV file.

Can you upload data to the Google Analytics API?

There are companies out there that claim to "integrate" data into GA. I know some phone call tracking companies in particular. Is there a way that they are uploading data to GA through the API or are they using some other method that doesn't require that?
There is no upload mechanism into Google Analytics besides manual __utm.gif calls like in the browser. Both Google Analytics APIs (Data Export and Management) are completely Read-Only.
There are a few ways these solutions work, but one of them is to generate a unique identifier for the person calling in to give the person on the other line. That code is linked to their referral information (grabbing from the cookies). Another solution is to have the customer manually input their phone number. That phone number is then dialed by the software and connected to the live person, and in the background the phone number is linked to the source information from the cookies.
Then, the person receiving the call either inputs the code it into the system, or automatically has the user's information, and at the completion of the call, depending on how it is resolved, can generate things like e-commerce transactions or particular pageviews for Goals, so it can generate __utm.gif calls with the relevant campaign and user data appended. As far as Google Analytics is concerned, the request formed is the same user. The only thing that will be different is the User Location (which is fairly inaccurate to begin with.)
ie, if I take the __utm.gif call from my computer, paste it to you, and you click it, Google will see that as an another pageview on this visit, and for most purposes ignore that the differing locations.
Well, Google Analytics works off the a tracking GIF with all kinds of data appended to it, so it can certainly be reproduced by these phone call tracking folks without a problem.
Phone call comes, request the 1x1.gif from google with tracking data suiting your needs, and the hit+data will soon register on GA.
http://www.google-analytics.com/__utm.gif?data-here&account=UA-blah&more-stuff
There are several options to send tracking data to Google analytics.
Use a library which implements the ga.js script server-side
When you use Google Analytics in the way described by Google, you include a script on your website. This script sends data from the visitors browser to the Google Analytics server.
This script has been reverse engineered and implemented in server-side libraries. Now you can send the same data from the server to the Google Analytics server. You can use PHP-GA for PHP or pyga for Python.
Use the Google Analytics measurement protocol
The Google Analytics measurement protocol is a new API to send data to Google Analytics. You can send data by sending POST requests to the API.