Analytics
6K members online now
Discuss regaining access to Analytics accounts, restoring accounts, changing user access levels, and navigating the homepage
 
Guide Me
star_border
Reply

Error: Invalid value 'ga:<profileid>' for ids parameter.

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

I have an service built up using node.js where I would have to get the page views for my page through google analytics. But whenever I make a call to the google analytics i get the following error.


Error: Invalid value 'ga:<profileid>' for ids parameter.

 

Below is my code:

var GA = require('googleanalytics'),
    util = require('util'),
    config = {
        "token": vToken

    },
    ga = new GA.GA(config);

  var options = {
      'ids': 'ga:<profileid>',
      'start-date': '2016-02-01',
      'end-date': '2016-02-19',
      'dimensions': 'ga:pagePath',
      'metrics': 'ga:pageviews',
      'sort': '-ga:pagePath'
  };

  ga.get(options, function(err, entries) {
      console.log(err, entries);
      next('','');
  });

I have given the correct profile id instead of the <profileid> but I am not sure why am I getting the error.

 

Is there an issue with the code?

1 Expert replyverified_user

Re: Error: Invalid value 'ga:<profileid>' for ids parameter.

Rising Star
# 2
Rising Star
Hi Shriram,

Most errors that we've had with the API have been toked issues.. that said, you may have better luck in the core reporting API communities:

https://developers.google.com/analytics/devguides/reporting/core/v3/help

Best,

Theo Bennett
Analytics Evangelist at MoreVisibility | Contact Me
Connect on LinkedIn

Re: Error: Invalid value 'ga:<profileid>' for ids parameter.

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭
Hi Theo,

Thanks. I would contact the support.

Regards,
Shriram