Get visitor Latitude and Longitude from Google analytics through BigQuery - sql

I've been using BigQuery (SQL)for a bit but now need to get some more specific location data. At the moment, our Google analytics table schema has the usual:
geonetwork.Metro, geoNetwork.region etc etc - but the geoNetwork.city data is pretty hit and miss.
So I'm wondering if anyone knows how I can grab Latitude and Longitude from the Google analytics that feeds into BigQuery. I've read that lat and long is available in the Google analytics real-time reporting API - but wondering if there's a way to get it into bigquery.
Any ideas would be awesome and much appreciated!

BigQuery Export Schema is documented here and now contains lat/long columns.

Related

Segment import from Google Analytics to BigQuery

I have my BigQuery and Google Analytics accounts linked. In Google Analytics I can filter users using segments and perform analysis on them. I want to use the same segment (that I have created in Google Analytics) in BigQuery so that I can filter users and further do the processing on filtered data. Is there any way I can import a segment from Google Analytics to BigQuery and then use it? I have tried to find solutions on the internet but no luck. Can you guys please help me with this?

How can I customize a data set for Google BigQuery? Can I export a file? How do I test it to see if it meets my needs?

I would like to improve the quality of existing data by using the Google BigQuery API to help validate the accuracy of existing data.
I dont see information on the types of data elements contained in the BigQuery and dont understand how to use an API if I just want to see what types of data are contained in there.
I tried looking for instructions and data elements in the Google Health Care API and Google BigQuery documentation and only saw how to set up a payment option.
I am a newbie at programming and wanted to do some preliminary research on these data sets prior to bringing them to our technical team.
I expect to see a list of relevant results based on a custom query.
You can see the data types supported
by Google BigQuery here and the conversion between different types here.
Also you can try out the BigQuery APIs in the OAuthPlayGround.

Analyze data in Google Cloud Datastore using Google Data Studio

I am new to databases, and have some data stored as entities in Google Cloud Datastore. I would like to be able to analyze and plot this data in a web interface, and it seems like Google Data Studio provides an easy-to-use way to do this. However, I'm a bit confused as to how I can actually use the two interfaces together; it seems like either Google Cloud Storage or Google BigQuery could be a middleman in between, but I'm not sure how this might work. Could anyone advise on whether using Google Data Studio would be the best approach to plotting/analyzing data in Google Cloud Datastore, and if so, offer tips on how I could go about this? There are a large number of tutorials but it seems like none that I've found have explained how to load data from the Datastore into a useable file for Data Studio.
Thanks!
As Graham Polley says, the question is answered here. The workaround to connect Cloud Datastore to Google Data Studio is to first export Datastore entities to BigQuery, as explained in this guide.
Then see this in order to connect Data Studio to BigQuery tables.
Finally in this blog post, there's a tutorial for building a dashboard with Google Data Studio and BigQuery.

Getting a user's marketing source from Google Analytics

I'm a backend developer who has no experience with Google Analytics, but I've a requirement to find a way to collect the Marketing Medium/Source for each user from Google Analytics and save it in my database, I've been searching and looking how to get it from an API request but I didn't find a way yet, could you guys help?
You can use the Google Python API to fetch the Google Analytics data. You can read more here.
Medium and Source information can be found out by using the dimension ga:sourceMedium
You can find more info about dimensions and metrics here
Following which you can setup a daily script and fetches the data from your Google Analytics account and dumps data into csv which you can successively load into your database using libraries such as psycopg2.

Write Data from Google Spreadsheets to a BigQuery Table

I'm trying to write data from Google Spreadsheets to a BigQuery Table.
Are there any sources which I can tap into to learn how to do this?
(Something like this would be awesome:
https://developers.google.com/apps-script/articles/bigquery_tutorial)
Thanks.
What have you tried so far?
Before writing actual code, I see two ways:
Send data through a POST request, using https://developers.google.com/apps-script/reference/url-fetch/url-fetch-app and https://developers.google.com/bigquery/loading-data-into-bigquery#loaddatapostrequest.
Otherwise you could upload the data to Google Cloud Storage, and insert a job that loads it into BigQuery. Take a look at http://blog.knoldus.com/2013/01/19/google-apps-script-to-store-data-on-google-cloud-sorage/.