Is it possible to track how often and/or when a Facebook user is using any facebook app? What if they have installed one of your apps, can this be used to collect statistics about app usage? For instance, you could say that a user spent 8 hours playing Farmville in the past 24 hours. Or even total usage of a specific app. What statistic can be collected about the use of facebook apps and how can this be done?
When you register your application, you can get detailed analytics about the demographics of your users and how users are sharing from your application with Insights.
The Graph API provides programmatic access to all of this data so you can integrate Platform data into your own, custom analytics systems.
To download Insights data, you first need to obtain an OAuth access token associated with your application via the OAuth Client Credentials Flow. You can obtain an access token for your application with:
curl -F grant_type=client_credentials \
-F client_id=your_app_id \
-F client_secret=your_app_secret \
https://graph.facebook.com/oauth/access_token
Once you have your application access token, you can download analytics data for your application at:
https://graph.facebook.com/app_id/insights?access_token=...
That URL outputs all of the analytics data available via the API, including the total number of users, number of active users, and a number of other detailed metrics. For example, you can get the number of users who have seen pages shared from your site with:
https://graph.facebook.com/app_id/insights/share_views/day?access_token=...
You can use since and until to specify the time range for which you want data. Both arguments accept times in almost any valid date format:
https://graph.facebook.com/app_id/insights?access_token=...&since=yesterday
Explore the Insights product and the base /insights URL for more a complete list of metrics available.
I hope it will help you.
App statistics can be extracted from insights, metrics, and application tables through FQL.
Related
I'm using Google plus API in my website to Sign In users and it does work great, However because I only need the user email since I create my own Auth Token I no longer need to use Google plus API because Gmail API provide all the information I need Also give more daily query Which is 1,000,000,000 compared to 20,000,000 for Google plus API.
The Problem is:
When I used Gmail API I got the same information that Google plus API provided, Which is great.
However, going to my dashboard inside Google Cloud Console >> OAuth consent screen Tap >> OAuth rate limits.
It says that Your token grant rate = Your current per day token grant rate limit is 10,000 grants per day. The per day token grant rate resets every day
So, Do I miss something?
Note: When I switched to Gmail API, I did change the client key, secret key, and Google Sign In URL.
There is a difference between the OAuth Rate Limits and the Gmail API Usage Limits. When designing your app you have two take into consideration these two factors:
1) OAuth
The OAuth Rate Limits refers to the number of tokens that your application can request to Google in order to be able to have permission to sensitive scopes from the users that are utilizing your app and in that way allow to access their data (how much data depends in the scopes) when calling the Gooogle's APIs.
2) Gmail API
The Gmail API Usage Limits refers to the number of requests that your app can do to the API, no matter the number of users(as long as it doesn't surpass the limit) because it was previously checked by the OAuth rate limit.
I have been exploring some with the Google Analytics Core API. I reached the point where I wish to collect queries from external/other sources. Yes, I do know for some people this may sound a bit stupid, since this is very sensitive data for some companies or whatever. Anyhow, is this possible? Is it some kind of identification that can be found in the dashboard of Google API:s? That lets others to get access of the same data, but from other API requests?
I have tried other webpages view ID:s but without success.
I can not find any documentation about this matter either.
This is possible on the Adobe Analytics API. So I see no reason why it shouldnt be able to do on Google Analytics?
Edited, scenario added.
Im trying to figure out how many sessions a website for which I do not
own has.
I want access of the data in google analytics that my company has. I'm wondering if this is possible to get their data from my API requests based on their identifications,etc. I want to create my own dashboard with many different Google analytics sources. Or, do I need to use the same client_secrets that is connected in the Google API dashboard of the owners?
Kind regards, Peter
You should understand the difference between private and public data. Private data is owned by a user public data is owned by no one. Searching for public videows on YouTube would be a good example of public data.
Google Analytics data is private it is owned by the person or people who have access to that Google analytics account. You can not access the data associated with my website unless I grant you access to it. If you are working on an application and need to access someone else's Google analytics data then you can use Oauth2 (using client id and secret) and have them authenticate the application and you will be able to access their data.
You can not access Google Analytics data that you do not have permission to access. We get permission by using Oauth2 or a service account.
If you have been added to your companies google analytics account and you have access to it then you can use the Google Analytics API to access the data for those accounts. By going though the management api you will be able to see all of the accounts that you have access to and use that to make your dashboard.
Just remember though the Google Analytics api returns raw data not graphs you will have to create your dashboard yourself. or try checking out the embedded api but that will only work with one view at a time i as far as i know.
how can you count the count number of tweets for a specific hashtag on twitter? is there a way to avoid php and creating twitter app on the twitter developer site?
i might want to use go or c++ instead of php.
Thanks,
Geri
In order to count Tweets in real-time, you will need to use the Twitter Streaming APIs, in particular the statuses/filter endpoint. Using the track parameter with the hashtag you are interested in, you will receive matching Tweets in real-time.
In order to get started, you will need to create credentials for your Twitter app on https://apps.twitter.com/, then consume the API from your favorite language. The fastest way is to use an existing library which will handle the authentication and the connection to the Twitter API for you.
If you want to use Go, I definitely recommend twittergo by #kurrik which supports the Streaming APIs. For other languages, you can take a look at this page on Twitter Libraries.
You can also use tweepy a python API to access twitter APIS . But first you should have twitter streaming API access for that you should have an account at apps.twitter.com
You will always need to create an app on the Twitter Developer portal https://apps.twitter.com/ as this is where you get to manage your API OAuth keys. As Romain says, the best option here would be to use the Streaming API.
I'm looking for a way to retrieve and then display (with some Highcharts - like library) the current traffic we have on the website. The same way google analytics displays it on the gioogle analytics admin dashboard, but I'd like to retrieve with some API and display it directly on our custom dashboard.
After reading through the complete google analytics documentation, I've understood that
"Google Analytics API doesn’t support real-time stats yet… but this is
still useful if you want to display pageviews or number of visits on
your site and have it automatically update."
So my question is, is there another API to retrieve and display the current/instant traffic on a website on our custom admin dashboard. Or, is there a workaround (with AJAX ?) to do so with the google analytics API ? ( i've seen that you can retrieve the amount visitors on a given perido, so even if this is not real time, fo now it gets as close as I can to my goal)
I'm working with php and javscript
Thanks
No - the current API doesn't currently support true real-time statistics. It is the most highly requested feature though:
Google Analytics developer issues and feature requests
Access to Real Time Data
We develop services which integrate with the API. On average I estimate the latency is about 1-3 hours. I believe the larger your dataset it the longer the latency.
I am building a service like Wix.com, users can build simple mutli-pages website with ease. Every website will be including in a global Google Analytics account with a unique profile, then the tracking code is to be placed in the website pages.
Now, on the website dashboard i want to show the online visitors and the total number of visists for the website for each website separatly, trying to do so i have :
Tried using GAPI (http://code.google.com/p/gapi-google-analytics-php-interface/) but due to Google Analytics major update it doesn't work anymore.
I found Google Core reporting API for Analytics, but i believe it's made for 3rd party applications that accesses GA data for their clients, meaning that the user should have a Google account and GA profile for the website, and the App just connects to the account and retrieves data. And this of course isn't the case here; i can't ask the user to create a Google account and embed the tracking code in the website HTML; else what am i here for ?
Got the picture ? I need the simplest method to do this, no fancy stuff.
PS: Minutes ago i found this: Google Analytics Query Explorer (http://ga-dev-tools.appspot.com/explorer/), it's a 3rd party app that builds custom queries for GA and gives you the link, something like that :
https://www.googleapis.com/analytics/v3/data/ga?ids= (the ID) &dimensions=ga%3AvisitCount&metrics=ga%3Avisitors&segment=gaid%3A%3A-1&start-date=2013-02-01&end-date=2013-02-23&max-results=50
Now, trying to access the URL (thinking; this is easy :) ) the respond is a request for login first :
{"error":{"errors":[{"domain":"global","reason":"required","message":"Login Required","locationType":"header","location":"Authorization"}],"code":401,"message":"Login Required"}}
Thanks in advance.
Unless you have fewer than 50 clients this plan is not going to work the way you're asking for. (There is a limit of 50 profiles per account.)
The client will have to make their own GA number and provide it to you as a setting for their website.
In order to display the customers reports on a dashboard on your site you're also going to have to get them to authorize a GA App you create for access.