Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #25373 > unrolled thread
| Started by | Gitin Kakkar <gitin.k@gmail.com> |
|---|---|
| First post | 2014-07-15 05:09 -0700 |
| Last post | 2014-07-17 09:13 +0200 |
| Articles | 7 — 3 participants |
Back to article view | Back to comp.lang.javascript
Google Analytics API from JavaScript Gitin Kakkar <gitin.k@gmail.com> - 2014-07-15 05:09 -0700
Re: Google Analytics API from JavaScript "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-07-15 17:20 +0200
Re: Google Analytics API from JavaScript gitin.kakkar@paytm.com - 2014-07-16 06:06 -0700
Re: Google Analytics API from JavaScript "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-07-16 17:19 +0200
Re: Google Analytics API from JavaScript gitin.kakkar@paytm.com - 2014-07-16 22:04 -0700
Re: Google Analytics API from JavaScript gitin.kakkar@paytm.com - 2014-07-16 22:56 -0700
Re: Google Analytics API from JavaScript "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-07-17 09:13 +0200
| From | Gitin Kakkar <gitin.k@gmail.com> |
|---|---|
| Date | 2014-07-15 05:09 -0700 |
| Subject | Google Analytics API from JavaScript |
| Message-ID | <2aff779e-8da5-4f65-8651-f8cf88379d53@googlegroups.com> |
How can we access and use Google Analytics API from Javascript so that I access all analysis of my website from backend??
[toc] | [next] | [standalone]
| From | "Evertjan." <exxjxw.hannivoort@inter.nl.net> |
|---|---|
| Date | 2014-07-15 17:20 +0200 |
| Message-ID | <XnsA36BB06D098FCeejj99@194.109.133.133> |
| In reply to | #25373 |
Gitin Kakkar <gitin.k@gmail.com> wrote on 15 jul 2014 in comp.lang.javascript: > How can we access and use Google Analytics API from Javascript so that I > access all analysis of my website from backend?? Is this an exam question? Do you mean Javascript serverside or clientside, or both? Read the guides and develop what you want: <https://developers.google.com/analytics/devguides/reporting/> -- Evertjan. The Netherlands. (Please change the x'es to dots in my emailaddress)
[toc] | [prev] | [next] | [standalone]
| From | gitin.kakkar@paytm.com |
|---|---|
| Date | 2014-07-16 06:06 -0700 |
| Message-ID | <0ce8e975-4348-4621-8bd9-a9b89763f757@googlegroups.com> |
| In reply to | #25379 |
server side.
[toc] | [prev] | [next] | [standalone]
| From | "Evertjan." <exxjxw.hannivoort@inter.nl.net> |
|---|---|
| Date | 2014-07-16 17:19 +0200 |
| Message-ID | <XnsA36CB04CE3C3Aeejj99@194.109.133.133> |
| In reply to | #25401 |
gitin.kakkar@paytm.com wrote on 16 jul 2014 in comp.lang.javascript: [please quote whay you are replying on, this is usenet not some GGroup.] > server side. On what server platform, ASP perhaps? -- Evertjan. The Netherlands. (Please change the x'es to dots in my emailaddress)
[toc] | [prev] | [next] | [standalone]
| From | gitin.kakkar@paytm.com |
|---|---|
| Date | 2014-07-16 22:04 -0700 |
| Message-ID | <ed4009ce-0043-4b45-aa7d-5ba25051d7bd@googlegroups.com> |
| In reply to | #25404 |
I am working on Linux.
[toc] | [prev] | [next] | [standalone]
| From | gitin.kakkar@paytm.com |
|---|---|
| Date | 2014-07-16 22:56 -0700 |
| Message-ID | <5168d535-20db-405e-a38d-77cf4aef7dad@googlegroups.com> |
| In reply to | #25412 |
On Thursday, July 17, 2014 10:34:22 AM UTC+5:30, gitin....@paytm.com wrote:
> I am working on Linux.
var googleapis = require('googleapis');
var client;
googleapis
.discover('plus', 'v1')
.execute(function(err, data) {
client = data;
});
var CLIENT_ID = googleapis.client_id;
var CLIENT_SECRET = googleapis.client_secret;
CLIENT_ID='xxxxx.apps.googleusercontent.com';
var oauth2 = new googleapis.OAuth2Client(CLIENT_ID, 'postmessage');
var SERVICE_ACCOUNT_EMAIL = 'xxxx@developer.gserviceaccount.com';
var SERVICE_ACCOUNT_KEY_FILE = '/key.pem';
var jwt = new googleapis.auth.JWT(
SERVICE_ACCOUNT_EMAIL,
SERVICE_ACCOUNT_KEY_FILE,
null,
['https://www.googleapis.com/auth/analytics.readonly']);
var client;
googleapis
.discover('analytics', 'v3')
.execute(function(err, data) {
client = data;
jwt.authorize(function(err, result) {
//console.log(result);
oauth2.setCredentials({
access_token: result.access_token
});
client.analytics.data.ga.get({
"ids": "ga:id",
"start-date": '2014-06-15',
"end-date": '2014-06-30',
"metrics": "ga:users",
"dimensions":"ga:userType,ga:browser,ga:browserVersion"
})
.withAuthClient(oauth2)
.execute(function(err, result) {
console.log(result);
});
});
});
This code is running but it always returns NULL, it may be because it is not able to retrieve anything from GA. Kindly help.
[toc] | [prev] | [next] | [standalone]
| From | "Evertjan." <exxjxw.hannivoort@inter.nl.net> |
|---|---|
| Date | 2014-07-17 09:13 +0200 |
| Message-ID | <XnsA36D5DEB6E844eejj99@194.109.133.133> |
| In reply to | #25412 |
gitin.kakkar@paytm.com wrote on 17 jul 2014 in comp.lang.javascript: > I am working on Linux. Can a linus server use javascript? On a server a "platform" in my view is not the operating system but the serverside implementor of web-serving. Sorry, I will not go on with you, if you do not quote where you are responding on. -- Evertjan. The Netherlands. (Please change the x'es to dots in my emailaddress)
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.javascript
csiph-web