Questions tagged [google-analytics-api]

A set of APIs for building custom reporting solutions and programmatically managing existing Google Analytics accounts and users.

Google Analytics is a free data collection and analysis platform by Google. The Reporting and Management APIs are for developers already tracking data with the Google Analytics collection libraries. See also the google-analytics tag for general information.

The Reporting APIs

Save time by automating complex reporting tasks and integrate Google Analytics data with other data for deeper insights about your business with these Reporting APIs:

The Management API

Authorized users can programmatically access and manage Google Analytics accounts, users, and data with the Management API.

In addition to managing all account levels and users, you can also use this API to manage certain types of data, like upload cost data to Google Analytics for non-Google paid campaigns, retrieve account data to use with the Reporting APIs, and manage content experiments.

Demos & Tools

Developers to discover what's possible with the Google Analytics Platform. Explore what’s possible and learn how to build powerful and flexible applications with the Google Analytics Demos & Tools.

More links:

3781 questions
17
votes
2 answers

Google Analytics measurement protocol authentication?

I'm looking at Googles Measurement Protocol, which gives you a way to send google analytics information from your server. However, there doesn't seem to be any authentication required. Have I missed something? Otherwise, what's to stop other people…
steve cook
  • 2,916
  • 2
  • 24
  • 46
17
votes
2 answers

Google Analytics - Visit duration 0 sec

I am using Google Web Analytics Online Tool to monitor visits on my site. What bugs me is that often I see that records contain the folloowing entries: Page Visits: 1.00 Average Visit Duration: 00:00:00 Bounce Rate: 100% What does that mean? If the…
Dantes
  • 2,693
  • 5
  • 24
  • 33
16
votes
5 answers

Google API access using Service Account oauth2client.client.CryptoUnavailableError: No crypto library available

I am trying to create a service account app so that I can access Google Analytics api using Python. Two things are confusing me. First, when I use the following code: `from oauth2client.client import SignedJwtAssertionCredentials client_email =…
user3277225
  • 441
  • 1
  • 5
  • 16
16
votes
2 answers

Integrating Google Analytics into GWT application

This should be totally simple but I can't get it working no matter what I try. I'm trying to use Google Analytics with GWT application. From what I understood, there are two way to do it: First is synchronous, by inserting tracking code at the end…
Domchi
  • 10,097
  • 6
  • 50
  • 63
16
votes
1 answer

How to pull Google Analytics stats?

Is Google API Ruby client the best option? I have a site example.com with users and I want them to see their google analytics stats on example.com, how can I do it ? I can see the example but I'm not able to figure out how to begin.
16
votes
1 answer

Google Analytics V2 not recording stats from Android app

I'm using EasyTracker from the SDK for Android V2.0 beta 3. I've followed all the steps described at https://developers.google.com/analytics/devguides/collection/android/v2/, and have ensured that there are hyphen characters and not en dashes in my…
Daniel
  • 163
  • 2
  • 6
16
votes
5 answers

How do I use a Service Account to Access the Google Analytics API V3 with .NET C#?

I realized this question has been previously asked but with little in the way of example code, so I am asking again but with at least a little bit of direction. After hours of searching, I have come up with the following partial…
Richard Collette
  • 4,768
  • 4
  • 42
  • 71
15
votes
2 answers

Analytics API & PHP - Get reports in different format

The following code returns an object of Google_Service_AnalyticsReporting_GetReportsResponse $body = new Google_Service_AnalyticsReporting_GetReportsRequest(); $body->setReportRequests($aRequests); return…
Nick
  • 2,951
  • 2
  • 24
  • 47
15
votes
4 answers

Google API Oauth2: Only one refresh token for all users?

I am using OAuth2 Authentication, and I have a CMS with multiple users, each with their own profiles. It happens that our company has a Google account with access to multiple Analytics accounts. For each user who uses the CMS, I connect to the…
15
votes
5 answers

Profiling the Performance of a Google App Script

I've written a Google App Script to pull in Google Analytics data into a Google Spreadsheet. It's a fairly long running script making multiple requests to the GA Reporting API, it also uses Google App's ScriptDB. Is there a good way of profiling…
15
votes
9 answers

Google Analytics Access with C#

I know that there is no official API for Google Analytics but is there a way to access Google Analytics Reports with C#?
15
votes
2 answers

Get Google Analytics "Visitors Flow" data from API

I'm trying to gather information from Google Analytics to build a recommendation engine for my site. The site consists of many pages, so I'm tracking the number of times a user clicks, for example, from page A to page B. Currently I can measure the…
14
votes
1 answer

gabba gem not tracking correctly

I use Google Analytics to track pageviews, etc. but late last week I had the desire to track an event on the backend. I discovered gabba. I have a method within my User model that looks like this: def track_ga(event_name, cookiea, cookiez,…
13
votes
3 answers

Google Analytics API v3 authorization to allow access to my data

I am developing an app that allows users to see my own Google Analytics Data using Google API v3. Everything I researched seems to indicate that users need to login into their Google accounts and grant my app the access before I can start querying…
V S
  • 131
  • 1
  • 1
  • 4
13
votes
2 answers

Google Analytics gtag.js ready callback

I try to update my Google Analytics implementation from analytics.js to the new gtag.js. In the old implementation I am using the ready callback function. ga(function() { console.log('Google analytics is ready'); }); How can I implement a…
xela84
  • 214
  • 2
  • 9