google-analytics-api

Google Analytics API oauth exception “invalid_grant” with Service Account. Same code on two servers. Only one works

旧巷老猫 提交于 2019-11-27 22:19:45
问题 I'm querying the Analytics API via a Service Account . I have written the code on the dev server and it works without issues. When running the same code on the production server, it throws this: Google_AuthException: Error refreshing the OAuth2 token, message: '{ "error" : "invalid_grant" }' I've tried creating another Service account, and the behavior is the same. The oAuth IETF draft (http://tools.ietf.org/html/draft-ietf-oauth-v2-31) says this about the error: invalid_grant The provided

Automated use of google-api-dotnet-client with OAuth 2.0

我的未来我决定 提交于 2019-11-27 19:32:44
问题 I have a bunch of keys : client id, client secret, api key But all the documentation show authentication using human interaction. How do I use the dot net libraries for interacting with the Google API v3 and the AnalyticsService without user interaction? If I just use the API Key, I get "Google.Apis.Requests.RequestError Login Required" There are no samples that I can find anywhere that do this. EDIT : this is for one Google Analytics account, I have full access to it, username, password,

Scraping Real Time Visitors from Google Analytics

冷暖自知 提交于 2019-11-27 19:04:02
I have a lot of sites and want to build a dashboard showing the number of real time visitors on each of them on a single page. (would anyone else want this?) Right now the only way to view this information is to open a new tab for each site. Google doesn't have a real-time API, so I'm wondering if it is possible to scrape this data. Eduardo Cereto found out that Google transfers the real-time data over the realtime/bind network request. Anyone more savvy have an idea of how I should start? Here's what I'm thinking: Figure out how to authenticate programmatically Inspect all of the realtime

Use Google Analytics API to show information in C#

天涯浪子 提交于 2019-11-27 16:57:07
I been looking for a good solution all day but google evolve so fast that I can't find something working. What I want to do is that, I have a Web app that has an admin section where user need to be logged in to see the information. In this section I want to show some data from GA, like pageviews for some specific urls. Since it's not the user information that I'm showing but the google analytics'user I want to connect passing information (username/password or APIKey) but I can't find out how. All the sample I found use OAuth2 (witch, if I understand, will ask the visitor to log in using google

Using Google Analytics to show subset of data for customers of web application using embed api

旧巷老猫 提交于 2019-11-27 15:05:22
问题 I'm developing an application where each 'business' has it's own page (or rather many pages): For example example. com/business/abc/ So, for the logged in business owners in the system I would like give a feature 'View page analytics'. It would display how many visits (and maybe a couple of other things) that particular page has had. Is there a way of doing this using the Google Analytics API with my constraints: I don't want customers to provide their own UA code I don't want them to require

How to obtain Google service account access token javascript

让人想犯罪 __ 提交于 2019-11-27 12:10:19
I'm trying to set up an analytics dashboard of my site for my leadership to view site usage. I don't want them to have to have a google account or to add them individual to see the results. I've set up a service account and OAuth2 access. All the tutorials I find show code like this: gapi.analytics.auth.authorize({ clientid: 'Service account client ID', serverAuth: { access_token: 'XXXXXXXXXXXXXXXXX' } And all the documentation talks about "...once you recieve your access token...." But none of them actually say how to get that! I see Certificate Fingerprints, Public key fingerprints. I also

Google Analytics API on Codeigniter website

谁说胖子不能爱 提交于 2019-11-27 11:48:46
问题 I've been trying to get Google API to work on my website for days now, but not getting it to work. Everywhere I search I find outdated examples... I need it to work with codeigniter and all I want to do is to fetch data from Google Analytics to show in the admin dashboard on my codeigniter website. I understand that I need a Service Account, if I don't want to be authenticating everytime I look at the dashboard(?) Can anyone please help me with getting this to work? Thank you so much in

What is the client ID when sending tracking data to google analytics via the measurement protocol?

时光总嘲笑我的痴心妄想 提交于 2019-11-27 11:25:44
I want to use Google's new measurement protocol for sending tracking events from my server instead of JavaScript. This page says the client ID is required: https://developers.google.com/analytics/devguides/collection/protocol/v1/devguide#required And this page says it's optional: https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#visitor Plus, the format defined in these docs is different- the first page gives an integer as an example and just says it's "a unique value" while the second link says it should be a UUID. If I send either user IDs or generated UUIDs

OAuth 2.0 with Google Analytics API v3

和自甴很熟 提交于 2019-11-27 11:14:48
I used to be able to query the Google Analytics API with my account's login & password. Google is now using OAuth for authentication which is great... The only issue is that I only need ONE access token. I don't wanna allow other users to fetch THEIR analytics data. I just wanna be able to fetch MY data. Is there a way I can generate an access token only for my app or my analytics account? I know such solutions exists... For instance, Twitter provides what they call a "single-user oauth" for apps that don't require a specific user to sign in. One again, all I'm trying to accomplish here is to

Google Analytics API - Get page view information for specific URLs

坚强是说给别人听的谎言 提交于 2019-11-27 10:21:30
I am looking to implement a page view tracking system on one of my websites. The website is a directory where suppliers can advertise their services. Suppliers have a unique profile page on the site, e.g mysite.com/directory/abc-profile.html The idea is that suppliers can log in to their account area on the site and view stats on how many people are visiting their profile. Ideally I want to display this as : Total views | Total today | This week | This month | This year It does not matter if the data is not completely up to date. I already have Google Analytics tracking code installed on the