Can i access google fit API from java code and collect data in the background say every one hour - google-fit

My need is to get data of say 10 google fit users (example my project team-mates) I want to analyse their data and do some scoring to create fitness competition within my team.
If I have all these google fit and password Will I be able to read the data from a java application and save it all in one DB? I will analyze these data and provide score and targets
Finally: I will have a separate mobile app that will be using the data from my java application

Use JobScheduler to schedule job

Related

ABS.STAT API JSON for new period data

i am trying to automate downloading online statistics into my financial models.
i am using australian statistics database http://stat.data.abs.gov.au/index.aspx? to automatically pull cpi data via an api json link converted into a power query and excel's "get data from web" functionality.
however, i can only bring the existing data, but can't make it add a new period of data when it's published on the website. i'd be happy with either adding new data column or replacing existing data e.g. so that i always have last four quarters.
i'm not an expert and i can't find anything useful because i'm probably not using the right terms in my google search!
any advice would be much appreciated

Export my analytics data and put them in a database

I am looking to export the analytics data towards a database sql. Do you know one tools who could help me?
Do you know how I can see on Google analytics the traffic resulting from a particular URL??
Thank you all!
You have several options:
UI export: in the top/right corner of your reports you should have an option to download data in various formats (XLS, CSV...)
API: you can use the reporting API to get it out in a programmatic/automated way
One thing you won't be able to do with the free version no matter what you try:
Reconstruct the entire analytics data: whether with the UI or API, you're limited to querying only 7 dimensions maximum at a time (eg ga:country, ga:deviceCategory etc...), and cannot combine certain dimensions together (no official list available, it's trial and error to find out), whereas there are dozens of dimensions available.
So the question for you becomes:
How much resources do I want to invest into partially reverse-engineering Google Analytics vs. the value it brings me vs. what it would cost to get alternative analytics solutions?
I found a cloud based solution which exports raw google analytics data to MySQL database. Setup is simple, all you need to do is add your Google Analytics connection and a database to which the data needs to be exported.
MySQL, PostgreSQL, SQL Server and BigQuery are the supported destinations. It creates a few custom dimensions in your Google Analytics account and Tag in Google Tag Manager to send hits to Google Analytics. Data is exported from Google Analytics to the selected destination every day.
I have been using it for last three months now. Hope this helps.
Exporting the analytics data is a thorny one.
My understanding is that paid GA usage allows the export of all collected GA data.
But free usage does not.
For free usage, all you are going to be able to do, realistically, is to create a report over your GA data (in Data Studio or Google Sheets) that contains the rows and columns you want, and then collect this information and squirt it into a SQL table. You are also liable to come up against sampling.
Re traffic from particular URL, the news is better: just filter on Hostname and Page.

Google Analytics - Retrieve Real Time data to a database

I have been searching alot in the internet and can't find an answer.
Is it possible to retrieve real time data from GA to let's say MSSQL?
I would like to store these data somewhere so i can reuse them in some other applications to view real time data.
Yes the Real-time Google Analytics API lets you request the data for what is currently happening on your site. If memory services its basically the last 5 minutes of data that is returned.
There are a few things you should know.
the data that you can get is very limited because the data hasn't completed processing. Check dimensions and metrics reference.
The Real Time Reporting API, in limited beta, is available for developer preview only. Sign up to access the API.
It normally doesn't take that long to get access and you wont get an email from Google stating you have access. Just try again the next day if it works you are in.
Answer to question in comments:
Before you can request data from a Google API you need to register a project on Google developer console. Once you have done that you can find the project number on the settings page

how to push Google Analytics data into mysql tables

I see many tutos to download GA data to a google spreadsheet and refresh it automatically
but none to export data into mysql table(s)
Is it possible ?
If yes where can i find tutos or a freelancer with skills on this subject
If yes is it possible to store the data of several UA in the same table ?
Thx
Yes, you can do that with the Google Analytics core reporting api and you can use their query explorer to see what data you can pull from it.
Also here is all their libraries and sample code that you can use as a tutorial. As far as hiring someone, I would check out the job board here or odesk.com.
if you don't want to play around with code and development, just go ahead and use Analytics Canvas that provides easy data import via API from Google Analytics, which you can then easily export to SQL / MySQL / any other database. All using simple and intuitive graphic interface.
I usually use another solution that does not require coding — Skyvia tool: Google Analytics and MySQL Integration. It allows me to create a copy of Google Analytics report data in MySQL and keep it up-to-date with little to no configuration efforts. I don’t even need to prepare the schema — Skyvia can automatically create a table for my report data. You can load 10000 records per month for free — this is enough for me.

Limits to application building in Google Apps Script

We are a Google Apps for Your Domain enterprise account, and Real Estate brokerage. We want to build a web application that ties together several Google Apps services. It would be great if we could do it all in Google Apps Script, but at the same time may stretch the limits of what's possible in Google Apps Script. We do not have the time or resources to do full application development using Google Web Toolkit (GWT). Is a framework approach the right solution?
We want to build an application that allows our agents to create a real-estate listing record. Each record is large, with 300 - 400 form fields per record depending on the property type. Many of the fields are 'lookup' fields with specific values in either a select-list format, or multiple checkbox format. (e.g. roof-type = choose one: slate, shingle, rolled-roof; appliances = choose all: refrigerator, stove, dishwasher; etc.)
Each record will also need associated photos in original high resolution format and also smaller resolution sets for display in various contexts. Each record would have 24-50 1MB photos. I'm thinking that we could use and integrate Google Drive for the photos because the process can be simplified for the user to drag and drop a folder from desktop to Google Drive. Having the images stored in Google Drive, and only referenced from the application would solve part of the implied storage question. I read that there is a 200MB ScriptDb Quota in Google Apps Script so I can see that being a potential deal-breaker just for the 'data' alone. I don't have an exact database storage requirement, but I know we'll have 700 records to start and that number will grow to several thousand.
The users of the application are all internal, so GAFYD auth integration is a nice benefit.
There is no form api currently, so how do we create the data entry form in the first place? It appears we would need to manually create the form, or else create a sample spreadsheet to auto-generate the form. But then how do we enhance the form to modify the select lists and attach validation rules, and dynamic form behaviors like creating/showing/hiding additional elements based on user input (e.g. enter # of rooms; then enter dimensions for each room).
Another potential showstopper is the resizing of photos. We want access to original photos in order to create further marketing materials, however in the application UI we would need to use various sized images at smaller dimensions for efficiency. (e.g. show list of properties with one thumbnail to represent each record) I guess there would be methods in the Google Drive api to create sub-folders to store the resized images, but is there access to graphics manipulation software like gd (maybe through an API to picasa)?
A record should be viewable in different layouts and views. For example full record detail, summary view, marketing flyer view.
Once a record is created, messages need to be sent to the agent creating the record, plus an internal team who processes the record for workflows including copy writing/review + marketing. That seems to potentially fit with the new Google Groups? Once the record is 'approved' then the application needs to generate a marketing email to several hundred external recipients; selected based on business rules from various pools. So the application would need additional storage, or possibly address-book integration to be able to manage contacts.
Future edits to records (e.g. price changes, photo changes) need to trigger the review/approval workflow.
Is Google Apps Script capable of handling the size, scope and complexity of this type of application? Or, would the recommended route be using a micro framework such as http://bcosca.github.com/fatfree/ to tie together all the Google Apps components using their respective APIs?
There is no form api currently, so how do we create the data entry
form in the first place?
There are two, actually: both UiApp (and the drag-and-drop GUI Builder for it) and HtmlService can show arbitrarily complex forms.
I'm thinking that we could use and integrate Google Drive for the
photos because the process can be simplified for the user to drag and
drop a folder from desktop to Google Drive.
Drive is integrated with Apps Script.
I don't have an exact database storage requirement, but I know we'll
have 700 records to start and that number will grow to several
thousand.
You might want to try Google Cloud SQL as your storage, which is 100% natively supported in Apps Script and is a "real" SQL database. However, several thousands records is tiny if you are storing the photos in Drive... ScriptDb could probably scale to several million records in that case.
Google Groups and Contacts are integrated.
Google's documentation can be found here: https://developers.google.com/google-apps/
Google Apps Script is sometimes surprisingly powerful, but it won't be very fast for the amount of data you're implying.
As you said, ScriptDB has a size limit, so it can't store everything. Spreadsheets are limited to 256 columns per sheet and 400000 cells. My way around this is splitting my data into a set of spreadsheets with a set of sheets. If you're in real estate, you can probably split your data by region and neighborhood/area to achieve something similar. If you really want to compact things, you can store a row of data as a stringified JSON object in one cell. However, it will no longer be human-readable.
Unless you're willing to pay extra for storage, it sounds like your pictures will fill up a Drive account fairly quickly. I'm not familiar with images in gadgets, so I'm not sure if they can be embedded from Drive.
I have no experience with Forms, but you can build a gadget using UiApp and call appendRow on a spreadsheet sheet to add the contents of all your fields. And by building your app like that, you can specify valid values for things (and have those read from a "config" spreadsheet).