question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't perform authentication with guess-ga

See original GitHub issue
  1. I created a project in google console.
  2. I created a private key with no restrictions
  3. I opened a google analytics account
  4. I added analytics.js and used angulartics2 for Angular (and the routes recordings worked)
  5. Running :
  plugins: [
    new GuessPlugin({
      debug: true,
      GA: viewId,
      runtime: {
        delegate: false
      },
      routeProvider() {
        return parseRoutes('.');
      }
    })
  ]
};

Can’t seem to pass this code in main.js:

 client = google_oauth2_node_1.auth({
                  clientId: clientId,
                  clientSecret: clientSecret,
                  scope: scope
              }).then(function (token) {

Opens a new chrome tab and clicking on my user get’s me:

Sign in with Google temporarily disabled for this app This app has not been verified yet by Google in order to use Google Sign In.

Also when trying:

fetch({
  key,
  viewId,
  period: {
    startDate: new Date('2016-1-1'),
    endDate: new Date('2020-3-3')
  }
}).then(g => {
  writeFileSync('data.json', JSON.stringify(g, null, 2));
}).catch((err) => {
  console.log(err);
  throw err;
});

throws Login Required. I tried to give guess js read only permissions by email (mgechev@…) in google analytics but it didn’t work.

versions: “guess-parser”: “0.4.15”, “guess-webpack”: “0.4.15”, “guess-ga”: “0.4.14” Angular 8.2.14

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

4reactions
kasperstorgaardcommented, Feb 12, 2020

@slavoroi update, so it turns out the jwt option was not meant for an auth client, just the credentials. (it then creates the JWT client on the inside)

const {GuessPlugin} = require('guess-webpack');
const {parseRoutes} = require('guess-parser');
const credentials = require('./credentials.json');
const viewId = '123456789';

module.exports = {
  plugins: [
    new GuessPlugin({
      debug: true,
      jwt: credentials,
      GA: viewId,
      routeProvider() {
        return parseRoutes('.');
      },
      // not sure what this does, I could make it work without it
      runtime: {
        delegate: false
      }
    })
  ]
};
2reactions
kasperstorgaardcommented, Feb 8, 2020

@mgechev I’ll take a stab at it

Read more comments on GitHub >

github_iconTop Results From Across the Web

Total War - Can heroes enter settlements? - Steam Community
They always refuse to do so, no matter which settlement I am trying to send them to. ... No; independent heroes cannot enter...
Read more >
guess-webpack - npm Package Health Analysis - Snyk
The guess-ga plugin will extract report from Google Analytics for the last year. For custom period look at the section below.
Read more >
"Authentication cannot be performed" when attempting to use ...
When you open CCH IntelliForms you receive the following message: "Authentication cannot be performed. Please enter a valid Tax Research username and ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found