Ruby: Fetch data from google analytics? - ruby

I want to gather google analytics data for daily/monthly report. All visitors, visitors for specific path and conversion rate. Setting for google analytics is already done (I think).
I searched ruby libraries, but many informations are out-of-dated and google api is sometimes update.
Now(2012-09-28) what library is popular? And How to get data? I searched ruby-toolbox, but both two libraries are still active?
Libralies
'garb'
https://github.com/vigetlabs/garb
'google-api-client'
http://code.google.com/p/google-api-ruby-client/
Purpose:
My first step: view data
My second step: edit data(Add note or notation)
thanks,

Google-Api-Client works fine, is an official client and is constantly updated, just check the commit logs and you will see. Note that this API is not for Google Analytics only but for any Google API that uses the Google Discovery API. You should try that.
Regardless of the client that you use make sure it's compatible with the latest version of the API. If it's built using the Google API Discovery service it's a plus because that means the client library will have support for new methods as soon as they are available. It's like an API for building API clients.
GARB on the other hand seems to be abandoned for a while and is probably missing out on several features that came recently.
Note that the Google Analytics API are currently read only. So no client library will support that since there's no API for writing annotations. There's a feature request for that though.

Related

Google Analytics Data API: missing flag for identifying `golden` data

I've been using such API for generating reports over Google Analytics:
https://developers.google.com/analytics/devguides/reporting/core/v4/rest/v4/reports/batchGet
This API has result field isDataGolden:
Indicates if response to this request is golden or not. Data is golden when the exact same request will not produce any new results if asked at a later point in time.
Currently Google Analytics has new API for generating such reports:
https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1beta/properties/batchRunReports
But there is no analogue of isDataGolden field in this API
Question:
Is such flag will be added to new API, or maybe there is another instrument to get only golden data from new API?
p.s.:
I need to use this new API, since old one does not support new analytics properties without Universal Analytics view_id
The Google analytics data api is used for extracting data from google analytics ga4 accounts. The reporting api is used for extracting data from Universal analytics accounts. These are two different systems and should not be compared. You can not use the Google analytics data api to extract data from universal analytics accounts with view ids.
If you check the documentation for RunReportResponse which is the response returned from running a reporting in google analytics data. You will find that there is no is golden property or any property of that nature.
Remember this api is still in beta the team is still working on it. One may appear in the future. You will need to wait to find out if google will add any field like this in the future as anyone who would know is probably under NDA and cant tell you.

Go YouTube API: What use instead of liveBroadcasts.control method to display slate?

Re golang YouTube API, I would like to know what calls to perform to make a slate image appear in the middle of a livestream. Reading the API documentation here, it's suggested that the "control" operation is used to achieve this, however, this operation is not supported by the API in the latest version. I did find this functionality in a prior version (v0.3.2); why would this have been removed and what is the replacement ?
Cheers,
Saxon
The API behavior you're experiencing is documented officially, as per this excerpt from the official specification of the liveBroadcasts.control API endpoint:
Note: The liveBroadcasts.control method has been deprecated and will stop working on or after 1 October 2020. After that date, all calls to this method will return a forbidden (403) error, and the method will later be completely removed.
Clients can still implement their own slating by adding an overlay to the video sent to YouTube’s ingestion servers. See deprecation announcement.
There's nothing you can do about that, but only to file a feature request directly to Google in the attempt to make the company reinstate the feature that it retracted from the current API.
In my opinion (which is based on the experience of several years of monitoring the SO tags youtube-api, youtube-data-api and youtube-livestreaming-api), waiting for Google to respond to you here on SO is waste of time. Just do what I already recommended you to do in my comments posted under your question above: reach out directly to Google (through the company's official issue tracker site) for to obtain official accounts from the company's staff.

Can we use the Yammer search API v2? Is it official?

When searching in Yammer it uses an /api/v2/search endpoint like this:
https://www.yammer.com/api/v2/search/models?search=test&start=0&size=20&model_types=threads&_network=xxxxxxx&relevance=DEFAULT
Compared to the v1 search endpoint this returns more data. We need this data. And we successfully tested using this v2 endpoint.
Now the question: Is this v2 search endpoint safe to use? Is it "official"? Maybe somebody from Yammer reads along - on their Help page it says:
We encourage you to post all programming questions to StackOverflow
with a #yammer hashtag
So here we are. Any help is appreciated.
The Yammer v2 search API endpoint is not yet officially supported for third-party use. This is because we anticipate the need to make changes to it as we build it out. There are no plans to lock developers out of experimenting with the v2 search API. However, when developing any important functionality against this API, automated testing should be used to detect any unannounced breaking changes that we make while we continue to build it out.

Create New View for Google Analytics with Ruby

I was wondering how to create a new view for google analytics with ruby using the current 0.8.6 version of the library or otherwise? This would be after I have gotten the appropriate access token.
The specific call is here: https://developers.google.com/analytics/devguides/config/mgmt/v3/mgmtReference/management/profiles/insert
Any tips would be very much appreciated!
Write operations in the Management API (e.g. create, update, delete, patch) for Web Property, View (Profile), and Goal resources is currently available as a developer preview in limited beta. If you're interested in using these features, request access to the beta
It can take a while to get access it took me over a month you might want to start there first. While you are waiting I suggest you look at the normal ruby google analytics core reporting API examples once you are familiar with those you should be able to get the insert views working.

Unable to google Google-API directory

I know its silly, but previously this URL used to show me all available google open source API's Pervious working API link but now its showing some other page. I am tired of searching the complete API directory. I want to pick one to learn. I have managed to find a similar page which shows only partial API's directory. Google API directory Can any one provide me the correct URL to see complete directory?
I must admit, it's a mess if you take a fresh start.
Accessing Google Apis can be basically be done in two ways.
The old way : Google Data Java Client Library (a.k.a. "gdata-java-client") : docs here. Implemented services can be found at Google Api Docs (the link you are referring to).
The new way : Google API Client Library for Java (a.k.a. "google-api-java-client") : docs here. The Api explorer shows the generated client libraries using the new infrastructure. Or this list.
Both libraries are available for different languages and for different Google services. GData is the most mature library and supports most services.
The new way however is more flexible : the client libraries and even the docs can be automatically generated for any Google service that is ready to transition to the new infrastructure. On the downside, not all Google services have a client library ready for the new infrastructure (e.g. Contacts).
You can access services that are not yet transitioned but you have to write your own XML model.
There is a migration guide to move from GData to new infrastructure.
try to find it on this page:
http://www.programmableweb.com/apis/directory/1?company=Google
or you can explore some apis here: (i don't know if thats all)
http://code.google.com/apis/explorer/
or just search what you need on:
http://developers.google.com

Resources