Code Monkey home page Code Monkey logo

nodejs-analytics-data's Introduction

THIS REPOSITORY IS DEPRECATED. ALL OF ITS CONTENT AND HISTORY HAS BEEN MOVED TO GOOGLE-CLOUD-NODE

Google Cloud Platform logo

release level npm version

Data client for Node.js

A comprehensive list of changes in each version may be found in the CHANGELOG.

Read more about the client libraries for Cloud APIs, including the older Google APIs Client Libraries, in Client Libraries Explained.

Table of contents:

Quickstart

Before you begin

  1. Select or create a Cloud Platform project.
  2. Enable the Google Analytics Data API.
  3. Set up authentication with a service account so you can access the API from your local workstation.

Installing the client library

npm install @google-analytics/data

Using the client library

/**
 * TODO(developer): Uncomment this variable and replace with your
 *   Google Analytics 4 property ID before running the sample.
 */
// propertyId = 'YOUR-GA4-PROPERTY-ID';

// Imports the Google Analytics Data API client library.
const {BetaAnalyticsDataClient} = require('@google-analytics/data');

// Using a default constructor instructs the client to use the credentials
// specified in GOOGLE_APPLICATION_CREDENTIALS environment variable.
const analyticsDataClient = new BetaAnalyticsDataClient();

// Runs a simple report.
async function runReport() {
  const [response] = await analyticsDataClient.runReport({
    property: `properties/${propertyId}`,
    dateRanges: [
      {
        startDate: '2020-03-31',
        endDate: 'today',
      },
    ],
    dimensions: [
      {
        name: 'city',
      },
    ],
    metrics: [
      {
        name: 'activeUsers',
      },
    ],
  });

  console.log('Report result:');
  response.rows.forEach(row => {
    console.log(row.dimensionValues[0], row.metricValues[0]);
  });
}

runReport();

Samples

Samples are in the samples/ directory. Each sample's README.md has instructions for running its sample.

Sample Source Code Try it
Get Common Metadata source code Open in Cloud Shell
Get Metadata By Property Id source code Open in Cloud Shell
Quickstart source code Open in Cloud Shell
Quickstart_json_credentials source code Open in Cloud Shell
Quickstart_oauth2 source code Open in Cloud Shell
Run Batch Report source code Open in Cloud Shell
Run Pivot Report source code Open in Cloud Shell
Run Realtime Report source code Open in Cloud Shell
Run Realtime Report With Multiple Dimensions source code Open in Cloud Shell
Run Realtime Report With Multiple Metrics source code Open in Cloud Shell
Run Report source code Open in Cloud Shell
Run Report With Aggregations source code Open in Cloud Shell
Run Report With Cohorts source code Open in Cloud Shell
Run Report With Date Ranges source code Open in Cloud Shell
Run Report With Dimension And Metric Filters source code Open in Cloud Shell
Run Report With Dimension Exclude Filter source code Open in Cloud Shell
Run Report With Dimension Filter source code Open in Cloud Shell
Run Report With Dimension In List Filter source code Open in Cloud Shell
Run Report With Multiple Dimension Filters source code Open in Cloud Shell
Run Report With Multiple Dimensions source code Open in Cloud Shell
Run Report With Multiple Metrics source code Open in Cloud Shell
Run Report With Named Date Ranges source code Open in Cloud Shell
Run Report With Ordering source code Open in Cloud Shell
Run Report With Pagination source code Open in Cloud Shell
Run Report With Property Quota source code Open in Cloud Shell

The Google Analytics Data Node.js Client API Reference documentation also contains samples.

Supported Node.js Versions

Our client libraries follow the Node.js release schedule. Libraries are compatible with all current active and maintenance versions of Node.js. If you are using an end-of-life version of Node.js, we recommend that you update as soon as possible to an actively supported LTS version.

Google's client libraries support legacy versions of Node.js runtimes on a best-efforts basis with the following warnings:

  • Legacy versions are not tested in continuous integration.
  • Some security patches and features cannot be backported.
  • Dependencies cannot be kept up-to-date.

Client libraries targeting some end-of-life versions of Node.js are available, and can be installed through npm dist-tags. The dist-tags follow the naming convention legacy-(version). For example, npm install @google-analytics/data@legacy-8 installs client libraries for versions compatible with Node.js 8.

Versioning

This library follows Semantic Versioning.

This library is considered to be in preview. This means it is still a work-in-progress and under active development. Any release is subject to backwards-incompatible changes at any time.

More Information: Google Cloud Platform Launch Stages

Contributing

Contributions welcome! See the Contributing Guide.

Please note that this README.md, the samples/README.md, and a variety of configuration files in this repository (including .nycrc and tsconfig.json) are generated from a central template. To edit one of these files, make an edit to its templates in directory.

License

Apache Version 2.0

See LICENSE

nodejs-analytics-data's People

Contributors

alexander-fenster avatar anweshan avatar bcoe avatar fhinkel avatar gcf-owl-bot[bot] avatar google-cloud-policy-bot[bot] avatar ikuleshov avatar justinbeckwith avatar parthea avatar release-please[bot] avatar renovate-bot avatar sofisl avatar surferjeffatgoogle avatar yoshi-automation avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nodejs-analytics-data's Issues

Please add runFunnelReport function

Thanks for stopping by to let us know something could be better!

PLEASE READ: If you have a support contract with Google, please create an issue in the support console instead of filing on GitHub. This will ensure a timely response.

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Describe the solution you'd like
A clear and concise description of what you want to happen.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.

Report with named date ranges: runs a report using named date ranges failed

This test failed!

To configure my behavior, see the Flaky Bot documentation.

If I'm commenting on this issue too often, add the flakybot: quiet label and
I will stop commenting.


commit: ae646a5
buildURL: Build Status, Sponge
status: failed

Test output
Command failed: node ./runReportWithNamedDateRanges.js 222596558
16 UNAUTHENTICATED: Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.

Error: Command failed: node ./runReportWithNamedDateRanges.js 222596558
16 UNAUTHENTICATED: Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.

at checkExecSyncError (child_process.js:635:11)
at Object.execSync (child_process.js:671:15)
at execSync (test/runReportWithNamedDateRanges.test.js:24:28)
at Context.<anonymous> (test/runReportWithNamedDateRanges.test.js:31:20)
at processImmediate (internal/timers.js:461:21)</pre></details>

Quickstart: should run quickstart failed

This test failed!

To configure my behavior, see the Flaky Bot documentation.

If I'm commenting on this issue too often, add the flakybot: quiet label and
I will stop commenting.


commit: ae646a5
buildURL: Build Status, Sponge
status: failed

Test output
Command failed: node ./quickstart.js 222596558
16 UNAUTHENTICATED: Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.

Error: Command failed: node ./quickstart.js 222596558
16 UNAUTHENTICATED: Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.

at checkExecSyncError (child_process.js:635:11)
at Object.execSync (child_process.js:671:15)
at execSync (test/quickstart.test.js:24:28)
at Context.<anonymous> (test/quickstart.test.js:31:20)
at processImmediate (internal/timers.js:461:21)</pre></details>

Realtime report: should run realtime failed

This test failed!

To configure my behavior, see the Flaky Bot documentation.

If I'm commenting on this issue too often, add the flakybot: quiet label and
I will stop commenting.


commit: ae646a5
buildURL: Build Status, Sponge
status: failed

Test output
Command failed: node ./runRealtimeReport.js 222596558
16 UNAUTHENTICATED: Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.

Error: Command failed: node ./runRealtimeReport.js 222596558
16 UNAUTHENTICATED: Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.

at checkExecSyncError (child_process.js:635:11)
at Object.execSync (child_process.js:671:15)
at execSync (test/runRealtimeReport.test.js:24:28)
at Context.<anonymous> (test/runRealtimeReport.test.js:31:20)
at processImmediate (internal/timers.js:461:21)</pre></details>

Synthesis failed for nodejs-analytics-data

Hello! Autosynth couldn't regenerate nodejs-analytics-data. ๐Ÿ’”

Here's the output from running synth.py:

o/lint.sh
.kokoro/populate-secrets.sh
.kokoro/presubmit/node10/common.cfg
.kokoro/presubmit/node12/common.cfg
.kokoro/presubmit/node12/samples-test.cfg
.kokoro/presubmit/node12/system-test.cfg
.kokoro/presubmit/node12/test.cfg
.kokoro/publish.sh
.kokoro/release/docs-devsite.cfg
.kokoro/release/docs-devsite.sh
.kokoro/release/docs.cfg
.kokoro/release/docs.sh
.kokoro/release/publish.cfg
.kokoro/samples-test.sh
.kokoro/system-test.sh
.kokoro/test.bat
.kokoro/test.sh
.kokoro/trampoline.sh
.kokoro/trampoline_v2.sh
.mocharc.js
.nycrc
.prettierignore
.prettierrc.js
.trampolinerc
CODE_OF_CONDUCT.md
CONTRIBUTING.md
LICENSE
README.md
api-extractor.json
renovate.json
samples/README.md
2020-11-17 02:24:52,225 synthtool [DEBUG] > Post-processing GAPIC library...
DEBUG:synthtool:Post-processing GAPIC library...
2020-11-17 02:24:52,226 synthtool [DEBUG] > Installing dependencies...
DEBUG:synthtool:Installing dependencies...

> [email protected] postinstall /home/kbuilder/.cache/synthtool/nodejs-analytics-data/node_modules/protobufjs
> node scripts/postinstall


> @google-analytics/[email protected] prepare /home/kbuilder/.cache/synthtool/nodejs-analytics-data
> npm run compile-protos && npm run compile


> @google-analytics/[email protected] compile-protos /home/kbuilder/.cache/synthtool/nodejs-analytics-data
> compileProtos src

installing semver@^7.1.2
installing tmp@^0.2.0
installing uglify-js@^3.7.7
installing espree@^7.0.0
installing escodegen@^2.0.0
installing estraverse@^5.1.0

> @google-analytics/[email protected] compile /home/kbuilder/.cache/synthtool/nodejs-analytics-data
> tsc -p . && cp -r protos build/

npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.1.2 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

added 646 packages from 760 contributors and audited 647 packages in 28.286s

58 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

2020-11-17 02:25:21,169 synthtool [DEBUG] > Running prelint...
DEBUG:synthtool:Running prelint...

> @google-analytics/[email protected] prelint /home/kbuilder/.cache/synthtool/nodejs-analytics-data
> cd samples; npm link ../; npm i


> @google-analytics/[email protected] prepare /home/kbuilder/.cache/synthtool/nodejs-analytics-data
> npm run compile-protos && npm run compile


> @google-analytics/[email protected] compile-protos /home/kbuilder/.cache/synthtool/nodejs-analytics-data
> compileProtos src


> @google-analytics/[email protected] compile /home/kbuilder/.cache/synthtool/nodejs-analytics-data
> tsc -p . && cp -r protos build/

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

audited 647 packages in 14.333s

58 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

/home/kbuilder/.nvm/versions/node/v14.15.1/lib/node_modules/@google-analytics/data -> /home/kbuilder/.cache/synthtool/nodejs-analytics-data
/home/kbuilder/.cache/synthtool/nodejs-analytics-data/samples/node_modules/@google-analytics/data -> /home/kbuilder/.nvm/versions/node/v14.15.1/lib/node_modules/@google-analytics/data -> /home/kbuilder/.cache/synthtool/nodejs-analytics-data
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.1.2 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

added 137 packages from 118 contributors and audited 225 packages in 4.88s

58 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

2020-11-17 02:25:41,994 synthtool [DEBUG] > Running fix...
DEBUG:synthtool:Running fix...

> @google-analytics/[email protected] fix /home/kbuilder/.cache/synthtool/nodejs-analytics-data
> gts fix

version: 14

/home/kbuilder/.cache/synthtool/nodejs-analytics-data/src/v1alpha/alpha_analytics_data_client.ts
  94:48  error  'window' is not defined  no-undef

โœ– 1 problem (1 error, 0 warnings)

Error: Command failed with exit code 1: node ./node_modules/eslint/bin/eslint --fix **/*.ts **/*.js **/*.tsx **/*.jsx --no-error-on-unmatched-pattern
    at makeError (/home/kbuilder/.cache/synthtool/nodejs-analytics-data/node_modules/execa/lib/error.js:59:11)
    at handlePromise (/home/kbuilder/.cache/synthtool/nodejs-analytics-data/node_modules/execa/index.js:114:26)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async run (/home/kbuilder/.cache/synthtool/nodejs-analytics-data/node_modules/gts/build/src/cli.js:120:17) {
  shortMessage: 'Command failed with exit code 1: node ./node_modules/eslint/bin/eslint --fix **/*.ts **/*.js **/*.tsx **/*.jsx --no-error-on-unmatched-pattern',
  command: 'node ./node_modules/eslint/bin/eslint --fix **/*.ts **/*.js **/*.tsx **/*.jsx --no-error-on-unmatched-pattern',
  exitCode: 1,
  signal: undefined,
  signalDescription: undefined,
  stdout: undefined,
  stderr: undefined,
  failed: true,
  timedOut: false,
  isCanceled: false,
  killed: false
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @google-analytics/[email protected] fix: `gts fix`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @google-analytics/[email protected] fix script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/kbuilder/.npm/_logs/2020-11-17T10_25_46_713Z-debug.log
2020-11-17 02:25:46,721 synthtool [ERROR] > Failed executing npm run fix:

None
ERROR:synthtool:Failed executing npm run fix:

None
Traceback (most recent call last):
  File "/home/kbuilder/.pyenv/versions/3.6.9/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/home/kbuilder/.pyenv/versions/3.6.9/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/tmpfs/src/github/synthtool/synthtool/__main__.py", line 102, in <module>
    main()
  File "/tmpfs/src/github/synthtool/env/lib/python3.6/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/tmpfs/src/github/synthtool/env/lib/python3.6/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/tmpfs/src/github/synthtool/env/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/tmpfs/src/github/synthtool/env/lib/python3.6/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/tmpfs/src/github/synthtool/synthtool/__main__.py", line 94, in main
    spec.loader.exec_module(synth_module)  # type: ignore
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/kbuilder/.cache/synthtool/nodejs-analytics-data/synth.py", line 41, in <module>
    node.postprocess_gapic_library()
  File "/tmpfs/src/github/synthtool/synthtool/languages/node.py", line 194, in postprocess_gapic_library
    fix(hide_output=hide_output)
  File "/tmpfs/src/github/synthtool/synthtool/languages/node.py", line 179, in fix
    shell.run(["npm", "run", "fix"], hide_output=hide_output)
  File "/tmpfs/src/github/synthtool/synthtool/shell.py", line 39, in run
    raise exc
  File "/tmpfs/src/github/synthtool/synthtool/shell.py", line 33, in run
    encoding="utf-8",
  File "/home/kbuilder/.pyenv/versions/3.6.9/lib/python3.6/subprocess.py", line 438, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['npm', 'run', 'fix']' returned non-zero exit status 1.
2020-11-17 02:25:46,802 autosynth [ERROR] > Synthesis failed
2020-11-17 02:25:46,803 autosynth [DEBUG] > Running: git reset --hard HEAD
HEAD is now at 6ecdf6c chore: release 1.1.0 (#32)
2020-11-17 02:25:46,823 autosynth [DEBUG] > Running: git checkout autosynth
Switched to branch 'autosynth'
2020-11-17 02:25:46,842 autosynth [DEBUG] > Running: git clean -fdx
Removing __pycache__/
Removing build/
Removing node_modules/
Removing package-lock.json
Removing samples/node_modules/
Removing samples/package-lock.json
Traceback (most recent call last):
  File "/home/kbuilder/.pyenv/versions/3.6.9/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/home/kbuilder/.pyenv/versions/3.6.9/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/tmpfs/src/github/synthtool/autosynth/synth.py", line 354, in <module>
    main()
  File "/tmpfs/src/github/synthtool/autosynth/synth.py", line 189, in main
    return _inner_main(temp_dir)
  File "/tmpfs/src/github/synthtool/autosynth/synth.py", line 334, in _inner_main
    commit_count = synthesize_loop(x, multiple_prs, change_pusher, synthesizer)
  File "/tmpfs/src/github/synthtool/autosynth/synth.py", line 65, in synthesize_loop
    has_changes = toolbox.synthesize_version_in_new_branch(synthesizer, youngest)
  File "/tmpfs/src/github/synthtool/autosynth/synth_toolbox.py", line 259, in synthesize_version_in_new_branch
    synthesizer.synthesize(synth_log_path, self.environ)
  File "/tmpfs/src/github/synthtool/autosynth/synthesizer.py", line 120, in synthesize
    synth_proc.check_returncode()  # Raise an exception.
  File "/home/kbuilder/.pyenv/versions/3.6.9/lib/python3.6/subprocess.py", line 389, in check_returncode
    self.stderr)
subprocess.CalledProcessError: Command '['/tmpfs/src/github/synthtool/env/bin/python3', '-m', 'synthtool', '--metadata', 'synth.metadata', 'synth.py', '--']' returned non-zero exit status 1.

Google internal developers can see the full log here.

Quickstart with json credentials: should run quickstart failed

This test failed!

To configure my behavior, see the Flaky Bot documentation.

If I'm commenting on this issue too often, add the flakybot: quiet label and
I will stop commenting.


commit: ae646a5
buildURL: Build Status, Sponge
status: failed

Test output
Command failed: node ./quickstart_json_credentials.js 222596558 /secrets/gfile/service-account.json
16 UNAUTHENTICATED: Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.

Error: Command failed: node ./quickstart_json_credentials.js 222596558 /secrets/gfile/service-account.json
16 UNAUTHENTICATED: Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.

at checkExecSyncError (child_process.js:635:11)
at Object.execSync (child_process.js:671:15)
at execSync (test/quickstart_json_credentials.test.js:24:28)
at Context.<anonymous> (test/quickstart_json_credentials.test.js:34:20)
at processImmediate (internal/timers.js:461:21)</pre></details>

Trying to import google analytics

Thanks for stopping by to ask us a question! Please make sure to include:

  • What you're trying to do
    I'm trying to import @google-analytics/data

  • What code you've already tried
    image

  • Any error messages you're getting
    image

PLEASE READ: If you have a support contract with Google, please create an issue in the support console instead of filing on GitHub. This will ensure a timely response.

Report with dimension exclude filter: should run a report using a filter with `not_expression` failed

This test failed!

To configure my behavior, see the Flaky Bot documentation.

If I'm commenting on this issue too often, add the flakybot: quiet label and
I will stop commenting.


commit: ae646a5
buildURL: Build Status, Sponge
status: failed

Test output
Command failed: node ./runReportWithDimensionExcludeFilter.js 222596558
16 UNAUTHENTICATED: Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.

Error: Command failed: node ./runReportWithDimensionExcludeFilter.js 222596558
16 UNAUTHENTICATED: Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.

at checkExecSyncError (child_process.js:635:11)
at Object.execSync (child_process.js:671:15)
at execSync (test/runReportWithDimensionExcludeFilter.test.js:24:28)
at Context.<anonymous> (test/runReportWithDimensionExcludeFilter.test.js:31:20)
at processImmediate (internal/timers.js:461:21)</pre></details>

Oauth2 support

The only sample you appear to have works with service accounts. Does this library also support normal Oauth2 authentication or just service account authentication?

I tried setting the GOOGLE_APPLICATION_CREDENTIALS to a normal Oauth2 cred file and i get the following error message.

(node:14561) UnhandledPromiseRejectionWarning: Error: The incoming JSON object does not contain a client_email field
    at JWT.fromJSON (/home/linda/WebstormProjects/google_nodejs_samples/node_modules/google-gax/node_modules/google-auth-library/build/src/auth/jwtclient.js:195:19)
    at GoogleAuth._cacheClientFromJSON (/home/linda/WebstormProjects/google_nodejs_samples/node_modules/google-gax/node_modules/google-auth-library/build/src/auth/googleauth.js:301:16)
    at ReadStream.<anonymous> (/home/linda/WebstormProjects/google_nodejs_samples/node_modules/google-gax/node_modules/google-auth-library/build/src/auth/googleauth.js:335:36)
    at ReadStream.emit (events.js:228:7)
    at endReadableNT (_stream_readable.js:1185:12)
    at processTicksAndRejections (internal/process/task_queues.js:81:21)

Run report with cohorts: should run report with cohorts failed

This test failed!

To configure my behavior, see the Flaky Bot documentation.

If I'm commenting on this issue too often, add the flakybot: quiet label and
I will stop commenting.


commit: ae646a5
buildURL: Build Status, Sponge
status: failed

Test output
Command failed: node ./runReportWithCohorts.js 222596558
16 UNAUTHENTICATED: Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.

Error: Command failed: node ./runReportWithCohorts.js 222596558
16 UNAUTHENTICATED: Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.

at checkExecSyncError (child_process.js:635:11)
at Object.execSync (child_process.js:671:15)
at execSync (test/runReportWithCohorts.test.js:24:28)
at Context.<anonymous> (test/runReportWithCohorts.test.js:31:20)
at processImmediate (internal/timers.js:461:21)</pre></details>

Your .repo-metadata.json file has a problem ๐Ÿค’

You have a problem with your .repo-metadata.json file:

Result of scan ๐Ÿ“ˆ:

  • api_shortname 'analytics-data' invalid in .repo-metadata.json

โ˜๏ธ Once you address these problems, you can close this issue.

Need help?

  • Schema definition: lists valid options for each field.
  • API index: for gRPC libraries api_shortname should match the subdomain of an API's hostName.
  • Reach out to go/github-automation if you have any questions.

Report with dimension and metric filters: should run a report with dimension and metric filters failed

This test failed!

To configure my behavior, see the Flaky Bot documentation.

If I'm commenting on this issue too often, add the flakybot: quiet label and
I will stop commenting.


commit: ae646a5
buildURL: Build Status, Sponge
status: failed

Test output
Command failed: node ./runReportWithDimensionAndMetricFilters.js 222596558
16 UNAUTHENTICATED: Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.

Error: Command failed: node ./runReportWithDimensionAndMetricFilters.js 222596558
16 UNAUTHENTICATED: Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.

at checkExecSyncError (child_process.js:635:11)
at Object.execSync (child_process.js:671:15)
at execSync (test/runReportWithDimensionAndMetricFilters.test.js:24:28)
at Context.<anonymous> (test/runReportWithDimensionAndMetricFilters.test.js:31:20)
at processImmediate (internal/timers.js:461:21)</pre></details>

Get metadata by property id: should retrieve available dimensions and metrics available for a Google Analytics 4 property, including custom fields failed

This test failed!

To configure my behavior, see the Flaky Bot documentation.

If I'm commenting on this issue too often, add the flakybot: quiet label and
I will stop commenting.


commit: ae646a5
buildURL: Build Status, Sponge
status: failed

Test output
Command failed: node ./getMetadataByPropertyId.js 222596558
16 UNAUTHENTICATED: Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.

Error: Command failed: node ./getMetadataByPropertyId.js 222596558
16 UNAUTHENTICATED: Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.

at checkExecSyncError (child_process.js:635:11)
at Object.execSync (child_process.js:671:15)
at execSync (test/getMetadataByPropertId.test.js:24:28)
at Context.<anonymous> (test/getMetadataByPropertId.test.js:31:20)
at processImmediate (internal/timers.js:461:21)</pre></details>

Synthesis failed for nodejs-analytics-data

Hello! Autosynth couldn't regenerate nodejs-analytics-data. ๐Ÿ’”

Here's the output from running synth.py:

ux1_x86_64.whl
Collecting protobuf==3.13.0 (from -r /home/kbuilder/.cache/bazel/_bazel_kbuilder/a732f932c2cbeb7e37e1543f189a2a73/external/gapic_generator_python/requirements.txt (line 6))
  Using cached https://files.pythonhosted.org/packages/30/79/510974552cebff2ba04038544799450defe75e96ea5f1675dbf72cc8744f/protobuf-3.13.0-cp36-cp36m-manylinux1_x86_64.whl
  Saved ./protobuf-3.13.0-cp36-cp36m-manylinux1_x86_64.whl
Collecting pypandoc==1.5 (from -r /home/kbuilder/.cache/bazel/_bazel_kbuilder/a732f932c2cbeb7e37e1543f189a2a73/external/gapic_generator_python/requirements.txt (line 7))
  Using cached https://files.pythonhosted.org/packages/d6/b7/5050dc1769c8a93d3ec7c4bd55be161991c94b8b235f88bf7c764449e708/pypandoc-1.5.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmpfs/tmp/tmpj4n7o3ft/setuptools-tmp/setuptools/__init__.py", line 6, in <module>
        import distutils.core
      File "/tmpfs/src/github/synthtool/env/lib/python3.6/site-packages/_distutils_hack/__init__.py", line 83, in create_module
        return importlib.import_module('setuptools._distutils')
      File "/home/kbuilder/.pyenv/versions/3.6.9/lib/python3.6/importlib/__init__.py", line 126, in import_module
        return _bootstrap._gcd_import(name[level:], package, level)
    ModuleNotFoundError: No module named 'setuptools._distutils'
    
    ----------------------------------------
 (Command "python setup.py egg_info" failed with error code 1 in /tmpfs/tmp/pip-build-20x9_gmb/pypandoc/
)
ERROR: no such package '@gapic_generator_python_pip_deps//': pip_import failed: Collecting click==7.1.2 (from -r /home/kbuilder/.cache/bazel/_bazel_kbuilder/a732f932c2cbeb7e37e1543f189a2a73/external/gapic_generator_python/requirements.txt (line 1))
  Using cached https://files.pythonhosted.org/packages/d2/3d/fa76db83bf75c4f8d338c2fd15c8d33fdd7ad23a9b5e57eb6c5de26b430e/click-7.1.2-py2.py3-none-any.whl
  Saved ./click-7.1.2-py2.py3-none-any.whl
Collecting google-api-core==1.22.1 (from -r /home/kbuilder/.cache/bazel/_bazel_kbuilder/a732f932c2cbeb7e37e1543f189a2a73/external/gapic_generator_python/requirements.txt (line 2))
  Using cached https://files.pythonhosted.org/packages/e0/2d/7c6c75013105e1d2b6eaa1bf18a56995be1dbc673c38885aea31136e9918/google_api_core-1.22.1-py2.py3-none-any.whl
  Saved ./google_api_core-1.22.1-py2.py3-none-any.whl
Collecting googleapis-common-protos==1.52.0 (from -r /home/kbuilder/.cache/bazel/_bazel_kbuilder/a732f932c2cbeb7e37e1543f189a2a73/external/gapic_generator_python/requirements.txt (line 3))
  Using cached https://files.pythonhosted.org/packages/03/74/3956721ea1eb4bcf7502a311fdaa60b85bd751de4e57d1943afe9b334141/googleapis_common_protos-1.52.0-py2.py3-none-any.whl
  Saved ./googleapis_common_protos-1.52.0-py2.py3-none-any.whl
Collecting jinja2==2.11.2 (from -r /home/kbuilder/.cache/bazel/_bazel_kbuilder/a732f932c2cbeb7e37e1543f189a2a73/external/gapic_generator_python/requirements.txt (line 4))
  Using cached https://files.pythonhosted.org/packages/30/9e/f663a2aa66a09d838042ae1a2c5659828bb9b41ea3a6efa20a20fd92b121/Jinja2-2.11.2-py2.py3-none-any.whl
  Saved ./Jinja2-2.11.2-py2.py3-none-any.whl
Collecting MarkupSafe==1.1.1 (from -r /home/kbuilder/.cache/bazel/_bazel_kbuilder/a732f932c2cbeb7e37e1543f189a2a73/external/gapic_generator_python/requirements.txt (line 5))
  Using cached https://files.pythonhosted.org/packages/b2/5f/23e0023be6bb885d00ffbefad2942bc51a620328ee910f64abe5a8d18dd1/MarkupSafe-1.1.1-cp36-cp36m-manylinux1_x86_64.whl
  Saved ./MarkupSafe-1.1.1-cp36-cp36m-manylinux1_x86_64.whl
Collecting protobuf==3.13.0 (from -r /home/kbuilder/.cache/bazel/_bazel_kbuilder/a732f932c2cbeb7e37e1543f189a2a73/external/gapic_generator_python/requirements.txt (line 6))
  Using cached https://files.pythonhosted.org/packages/30/79/510974552cebff2ba04038544799450defe75e96ea5f1675dbf72cc8744f/protobuf-3.13.0-cp36-cp36m-manylinux1_x86_64.whl
  Saved ./protobuf-3.13.0-cp36-cp36m-manylinux1_x86_64.whl
Collecting pypandoc==1.5 (from -r /home/kbuilder/.cache/bazel/_bazel_kbuilder/a732f932c2cbeb7e37e1543f189a2a73/external/gapic_generator_python/requirements.txt (line 7))
  Using cached https://files.pythonhosted.org/packages/d6/b7/5050dc1769c8a93d3ec7c4bd55be161991c94b8b235f88bf7c764449e708/pypandoc-1.5.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmpfs/tmp/tmpj4n7o3ft/setuptools-tmp/setuptools/__init__.py", line 6, in <module>
        import distutils.core
      File "/tmpfs/src/github/synthtool/env/lib/python3.6/site-packages/_distutils_hack/__init__.py", line 83, in create_module
        return importlib.import_module('setuptools._distutils')
      File "/home/kbuilder/.pyenv/versions/3.6.9/lib/python3.6/importlib/__init__.py", line 126, in import_module
        return _bootstrap._gcd_import(name[level:], package, level)
    ModuleNotFoundError: No module named 'setuptools._distutils'
    
    ----------------------------------------
 (Command "python setup.py egg_info" failed with error code 1 in /tmpfs/tmp/pip-build-20x9_gmb/pypandoc/
)
INFO: Elapsed time: 2.572s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)
FAILED: Build did NOT complete successfully (0 packages loaded)

Traceback (most recent call last):
  File "/home/kbuilder/.pyenv/versions/3.6.9/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/home/kbuilder/.pyenv/versions/3.6.9/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/tmpfs/src/github/synthtool/synthtool/__main__.py", line 102, in <module>
    main()
  File "/tmpfs/src/github/synthtool/env/lib/python3.6/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/tmpfs/src/github/synthtool/env/lib/python3.6/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/tmpfs/src/github/synthtool/env/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/tmpfs/src/github/synthtool/env/lib/python3.6/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/tmpfs/src/github/synthtool/synthtool/__main__.py", line 94, in main
    spec.loader.exec_module(synth_module)  # type: ignore
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/kbuilder/.cache/synthtool/nodejs-analytics-data/synth.py", line 31, in <module>
    bazel_target=f"//google/analytics/data/{version}:google-analytics-data-{version}-nodejs"
  File "/tmpfs/src/github/synthtool/synthtool/gcp/gapic_bazel.py", line 52, in node_library
    return self._generate_code(service, version, "nodejs", **kwargs)
  File "/tmpfs/src/github/synthtool/synthtool/gcp/gapic_bazel.py", line 183, in _generate_code
    shell.run(bazel_run_args)
  File "/tmpfs/src/github/synthtool/synthtool/shell.py", line 39, in run
    raise exc
  File "/tmpfs/src/github/synthtool/synthtool/shell.py", line 33, in run
    encoding="utf-8",
  File "/home/kbuilder/.pyenv/versions/3.6.9/lib/python3.6/subprocess.py", line 438, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['bazel', '--max_idle_secs=240', 'build', '//google/analytics/data/v1alpha:google-analytics-data-v1alpha-nodejs']' returned non-zero exit status 1.
spec.loader.exec_module(synth_module)  # type: ignore
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/kbuilder/.cache/synthtool/nodejs-analytics-data/synth.py", line 31, in <module>
    bazel_target=f"//google/analytics/data/{version}:google-analytics-data-{version}-nodejs"
  File "/tmpfs/src/github/synthtool/synthtool/gcp/gapic_bazel.py", line 52, in node_library
    return self._generate_code(service, version, "nodejs", **kwargs)
  File "/tmpfs/src/github/synthtool/synthtool/gcp/gapic_bazel.py", line 183, in _generate_code
    shell.run(bazel_run_args)
  File "/tmpfs/src/github/synthtool/synthtool/shell.py", line 39, in run
    raise exc
  File "/tmpfs/src/github/synthtool/synthtool/shell.py", line 33, in run
    encoding="utf-8",
  File "/home/kbuilder/.pyenv/versions/3.6.9/lib/python3.6/subprocess.py", line 438, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['bazel', '--max_idle_secs=240', 'build', '//google/analytics/data/v1alpha:google-analytics-data-v1alpha-nodejs']' returned non-zero exit status 1.
2020-09-02 02:16:57,430 autosynth [ERROR] > Synthesis failed
2020-09-02 02:16:57,430 autosynth [DEBUG] > Running: git clean -fdx
Removing __pycache__/
Traceback (most recent call last):
  File "/home/kbuilder/.pyenv/versions/3.6.9/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/home/kbuilder/.pyenv/versions/3.6.9/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/tmpfs/src/github/synthtool/autosynth/synth.py", line 690, in <module>
    main()
  File "/tmpfs/src/github/synthtool/autosynth/synth.py", line 539, in main
    return _inner_main(temp_dir)
  File "/tmpfs/src/github/synthtool/autosynth/synth.py", line 630, in _inner_main
    ).synthesize(synth_log_path / "sponge_log.log")
  File "/tmpfs/src/github/synthtool/autosynth/synthesizer.py", line 120, in synthesize
    synth_proc.check_returncode()  # Raise an exception.
  File "/home/kbuilder/.pyenv/versions/3.6.9/lib/python3.6/subprocess.py", line 389, in check_returncode
    self.stderr)
subprocess.CalledProcessError: Command '['/tmpfs/src/github/synthtool/env/bin/python3', '-m', 'synthtool', '--metadata', 'synth.metadata', 'synth.py', '--']' returned non-zero exit status 1.

Google internal developers can see the full log here.

Add analytics team to CODEOWNERS

This PR reverts adding @ikuleshov to CODEOWNERS for samples, due to the file being automatically generated.

Rather than adding an exception for one person, I recommend adding a team to .repo-metadata.json, like this.

At which point the CODEOWNERS will be automatically generated with the appropriate values.

Report with multiple dimension filters: runs a report with dimension filters failed

This test failed!

To configure my behavior, see the Flaky Bot documentation.

If I'm commenting on this issue too often, add the flakybot: quiet label and
I will stop commenting.


commit: ae646a5
buildURL: Build Status, Sponge
status: failed

Test output
Command failed: node ./runReportWithMultipleDimensionFilters.js 222596558
16 UNAUTHENTICATED: Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.

Error: Command failed: node ./runReportWithMultipleDimensionFilters.js 222596558
16 UNAUTHENTICATED: Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.

at checkExecSyncError (child_process.js:635:11)
at Object.execSync (child_process.js:671:15)
at execSync (test/runReportWithMultipleDimensionFilters.test.js:24:28)
at Context.<anonymous> (test/runReportWithMultipleDimensionFilters.test.js:31:20)
at processImmediate (internal/timers.js:461:21)</pre></details>

Report with Pagination: should run a report several times, receiving portioned results with pagination failed

This test failed!

To configure my behavior, see the Flaky Bot documentation.

If I'm commenting on this issue too often, add the flakybot: quiet label and
I will stop commenting.


commit: ae646a5
buildURL: Build Status, Sponge
status: failed

Test output
Command failed: node ./runReportWithPagination.js 222596558
16 UNAUTHENTICATED: Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.

Error: Command failed: node ./runReportWithPagination.js 222596558
16 UNAUTHENTICATED: Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.

at checkExecSyncError (child_process.js:635:11)
at Object.execSync (child_process.js:671:15)
at execSync (test/runReportWithPagination.test.js:24:28)
at Context.<anonymous> (test/runReportWithPagination.test.js:31:20)
at processImmediate (internal/timers.js:461:21)</pre></details>

Report with dimension filter: should run a report with a dimension filter failed

This test failed!

To configure my behavior, see the Flaky Bot documentation.

If I'm commenting on this issue too often, add the flakybot: quiet label and
I will stop commenting.


commit: ae646a5
buildURL: Build Status, Sponge
status: failed

Test output
Command failed: node ./runReportWithDimensionFilter.js 222596558
16 UNAUTHENTICATED: Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.

Error: Command failed: node ./runReportWithDimensionFilter.js 222596558
16 UNAUTHENTICATED: Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.

at checkExecSyncError (child_process.js:635:11)
at Object.execSync (child_process.js:671:15)
at execSync (test/runReportWithDimensionFilter.test.js:24:28)
at Context.<anonymous> (test/runReportWithDimensionFilter.test.js:31:20)
at processImmediate (internal/timers.js:461:21)</pre></details>

Report with date ranges: should run a report with date ranges failed

This test failed!

To configure my behavior, see the Flaky Bot documentation.

If I'm commenting on this issue too often, add the flakybot: quiet label and
I will stop commenting.


commit: ae646a5
buildURL: Build Status, Sponge
status: failed

Test output
Command failed: node ./runReportWithDateRanges.js 222596558
16 UNAUTHENTICATED: Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.

Error: Command failed: node ./runReportWithDateRanges.js 222596558
16 UNAUTHENTICATED: Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.

at checkExecSyncError (child_process.js:635:11)
at Object.execSync (child_process.js:671:15)
at execSync (test/runReportWithDateRanges.test.js:24:28)
at Context.<anonymous> (test/runReportWithDateRanges.test.js:31:20)
at processImmediate (internal/timers.js:461:21)</pre></details>

keyFileJson instead of keyFilename

// Explicitly use service account credentials by specifying
// the private key file.
const analyticsDataClient = new BetaAnalyticsDataClient({
keyFilename: credentialsJsonPath,
});

can I give JSON content of the keyfile here somehow, that will be great for me

No connection established while using the sample codes.

I want to retrieve the data from GA using this repo, I have finished the configurations in the Before you begin sections in Quick Start, when I used the sample codes, I encountered below errors, does anyone know why? thanks in advance.
image
below is my sample codes I'm using.
image

๐Ÿ“ฆ pack-n-play test: TypeScript code failed

This test failed!

To configure my behavior, see the Flaky Bot documentation.

If I'm commenting on this issue too often, add the flakybot: quiet label and
I will stop commenting.


commit: 6640956
buildURL: Build Status, Sponge
status: failed

Test output
Process 189 exited with code 2.
Error: Process 189 exited with code 2.
    at ChildProcess. (node_modules/pack-n-play/build/src/utils.js:48:22)
        -> /workspace/node_modules/pack-n-play/src/utils.ts:62:11
    at maybeClose (internal/child_process.js:1022:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)

Run Report With Multiple Metrics: should run runReportWithMultipleMetrics failed

This test failed!

To configure my behavior, see the Flaky Bot documentation.

If I'm commenting on this issue too often, add the flakybot: quiet label and
I will stop commenting.


commit: ae646a5
buildURL: Build Status, Sponge
status: failed

Test output
Command failed: node ./runReportWithMultipleMetrics.js 222596558
16 UNAUTHENTICATED: Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.

Error: Command failed: node ./runReportWithMultipleMetrics.js 222596558
16 UNAUTHENTICATED: Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.

at checkExecSyncError (child_process.js:635:11)
at Object.execSync (child_process.js:671:15)
at execSync (test/runReportWithMultipleMetrics.test.js:24:28)
at Context.<anonymous> (test/runReportWithMultipleMetrics.test.js:31:20)
at processImmediate (internal/timers.js:461:21)</pre></details>

Realtime report with multiple dimensions: should run realtime with multiple dimensions failed

This test failed!

To configure my behavior, see the Flaky Bot documentation.

If I'm commenting on this issue too often, add the flakybot: quiet label and
I will stop commenting.


commit: ae646a5
buildURL: Build Status, Sponge
status: failed

Test output
Command failed: node ./runRealtimeReportWithMultipleDimensions.js 222596558
16 UNAUTHENTICATED: Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.

Error: Command failed: node ./runRealtimeReportWithMultipleDimensions.js 222596558
16 UNAUTHENTICATED: Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.

at checkExecSyncError (child_process.js:635:11)
at Object.execSync (child_process.js:671:15)
at execSync (test/runRealtimeReportWithMultipleDimensions.test.js:24:28)
at Context.<anonymous> (test/runRealtimeReportWithMultipleDimensions.test.js:31:20)
at processImmediate (internal/timers.js:461:21)</pre></details>

Realtime report with multiple metrics: should run realtime with multiple metrics failed

This test failed!

To configure my behavior, see the Flaky Bot documentation.

If I'm commenting on this issue too often, add the flakybot: quiet label and
I will stop commenting.


commit: ae646a5
buildURL: Build Status, Sponge
status: failed

Test output
Command failed: node ./runRealtimeReportWithMultipleMetrics.js 222596558
16 UNAUTHENTICATED: Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.

Error: Command failed: node ./runRealtimeReportWithMultipleMetrics.js 222596558
16 UNAUTHENTICATED: Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.

at checkExecSyncError (child_process.js:635:11)
at Object.execSync (child_process.js:671:15)
at execSync (test/runRealtimeReportWithMultipleMetrics.test.js:24:28)
at Context.<anonymous> (test/runRealtimeReportWithMultipleMetrics.test.js:31:20)
at processImmediate (internal/timers.js:461:21)</pre></details>

Pivot report: should run a pivot query to build a report of session counts by country, pivoted by the browser dimension failed

This test failed!

To configure my behavior, see the Flaky Bot documentation.

If I'm commenting on this issue too often, add the flakybot: quiet label and
I will stop commenting.


commit: ae646a5
buildURL: Build Status, Sponge
status: failed

Test output
Command failed: node ./runPivotReport.js 222596558
16 UNAUTHENTICATED: Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.

Error: Command failed: node ./runPivotReport.js 222596558
16 UNAUTHENTICATED: Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.

at checkExecSyncError (child_process.js:635:11)
at Object.execSync (child_process.js:671:15)
at execSync (test/runPivotReport.test.js:24:28)
at Context.<anonymous> (test/runPivotReport.test.js:31:20)
at processImmediate (internal/timers.js:461:21)</pre></details>

What is the value of the "eventValue"?

Hi there,

I am currently using this package to try and get how many page views each route on my site gets. I am doing this in the following way:

  const analyticsDataClient = new BetaAnalyticsDataClient(OPTIONS)

  const runReport = async () => {
    const [response] = await analyticsDataClient.runReport({
      property: `properties/${propertyId}`,
      dateRanges: [
        {
          startDate: '7daysAgo',
          endDate: 'today'
        }
      ],
      dimensions: [{ name: 'pagePath' }],
      metrics: [{ name: 'eventCount' }],
      pageSize: 1
    })

    console.log('Report result:')
    response.rows.forEach((row) => {
      console.log(row.dimensionValues[0], row.metricValues[0])
    })
  }

The console log I see for the above is as follows:

Report result:
{ value: '/someRoute', oneValue: 'value' } { value: '187', oneValue: 'value' }
{ value: '/someOtherRoute', oneValue: 'value' } { value: '12', oneValue: 'value' }
{ value: '/', oneValue: 'value' } { value: '242', oneValue: 'value' }
...more values here

Im not even sure if my dimensions or metrics values above are correct, they are complete guesses in regards to my goal of trying to get page view counts.

I am wondering though, what is the value here? Is this the number of page views this route has seen? There doesn't seem to be much explanation as to what this actually is.

Thanks

Get common metadata: should retrieve all metrics and dimensions for Google Analytics 4 properties failed

This test failed!

To configure my behavior, see the Flaky Bot documentation.

If I'm commenting on this issue too often, add the flakybot: quiet label and
I will stop commenting.


commit: ae646a5
buildURL: Build Status, Sponge
status: failed

Test output
Command failed: node ./getCommonMetadata.js 222596558
16 UNAUTHENTICATED: Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.

Error: Command failed: node ./getCommonMetadata.js 222596558
16 UNAUTHENTICATED: Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.

at checkExecSyncError (child_process.js:635:11)
at Object.execSync (child_process.js:671:15)
at execSync (test/getCommonMetadata.test.js:24:28)
at Context.<anonymous> (test/getCommonMetadata.test.js:31:20)
at processImmediate (internal/timers.js:461:21)</pre></details>

Run Report With Multiple Dimensions: should run runReportWithMultipleDimensions failed

This test failed!

To configure my behavior, see the Flaky Bot documentation.

If I'm commenting on this issue too often, add the flakybot: quiet label and
I will stop commenting.


commit: ae646a5
buildURL: Build Status, Sponge
status: failed

Test output
Command failed: node ./runReportWithMultipleDimensions.js 222596558
16 UNAUTHENTICATED: Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.

Error: Command failed: node ./runReportWithMultipleDimensions.js 222596558
16 UNAUTHENTICATED: Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.

at checkExecSyncError (child_process.js:635:11)
at Object.execSync (child_process.js:671:15)
at execSync (test/runReportWithMultipleDimensions.test.js:24:28)
at Context.<anonymous> (test/runReportWithMultipleDimensions.test.js:31:20)
at processImmediate (internal/timers.js:461:21)</pre></details>

PERMISSION_DENIED: User does not have sufficient permissions for this property

The quick start quickstart_json_credentials.js

Recommends using a serviced account however you have neglected to tell users that they need grant the service account permission to access their data.

Solution:

  • Take the service account email address. either open the json key file or get it from Google cloud console. is the one with a @i n it
  • Go to the google analytics web application
  • in the admin section for the analytics account you would like the service account to be able to access add it as a user.
  • as the analysis data api only reads data it is fine to only grant it read access.

Links to User does not have sufficient permissions for this property
Video showing how to grant a user access User doesn't have any google analytics accounts easy solution

Batch report: should run a batch report on a Google Analytics 4 property failed

This test failed!

To configure my behavior, see the Flaky Bot documentation.

If I'm commenting on this issue too often, add the flakybot: quiet label and
I will stop commenting.


commit: ae646a5
buildURL: Build Status, Sponge
status: failed

Test output
Command failed: node ./runBatchReport.js 222596558
16 UNAUTHENTICATED: Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.

Error: Command failed: node ./runBatchReport.js 222596558
16 UNAUTHENTICATED: Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.

at checkExecSyncError (child_process.js:635:11)
at Object.execSync (child_process.js:671:15)
at execSync (test/runBatchReport.test.js:24:28)
at Context.<anonymous> (test/runBatchReport.test.js:31:20)
at processImmediate (internal/timers.js:461:21)</pre></details>

Run report with aggregations: should run report with aggregations failed

This test failed!

To configure my behavior, see the Flaky Bot documentation.

If I'm commenting on this issue too often, add the flakybot: quiet label and
I will stop commenting.


commit: ae646a5
buildURL: Build Status, Sponge
status: failed

Test output
Command failed: node ./runReportWithAggregations.js 222596558
16 UNAUTHENTICATED: Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.

Error: Command failed: node ./runReportWithAggregations.js 222596558
16 UNAUTHENTICATED: Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.

at checkExecSyncError (child_process.js:635:11)
at Object.execSync (child_process.js:671:15)
at execSync (test/runReportWithAggregations.test.js:24:28)
at Context.<anonymous> (test/runReportWithAggregations.test.js:31:20)
at processImmediate (internal/timers.js:461:21)</pre></details>

Report with ordering: should run a report of active users, ordered by descending revenue failed

This test failed!

To configure my behavior, see the Flaky Bot documentation.

If I'm commenting on this issue too often, add the flakybot: quiet label and
I will stop commenting.


commit: ae646a5
buildURL: Build Status, Sponge
status: failed

Test output
Command failed: node ./runReportWithOrdering.js 222596558
16 UNAUTHENTICATED: Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.

Error: Command failed: node ./runReportWithOrdering.js 222596558
16 UNAUTHENTICATED: Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.

at checkExecSyncError (child_process.js:635:11)
at Object.execSync (child_process.js:671:15)
at execSync (test/runReportWithOrdering.test.js:24:28)
at Context.<anonymous> (test/runReportWithOrdering.test.js:31:20)
at processImmediate (internal/timers.js:461:21)</pre></details>

Report with property quota: should run a report and print property quota information failed

This test failed!

To configure my behavior, see the Flaky Bot documentation.

If I'm commenting on this issue too often, add the flakybot: quiet label and
I will stop commenting.


commit: ae646a5
buildURL: Build Status, Sponge
status: failed

Test output
Command failed: node ./runReportWithPropertyQuota.js 222596558
16 UNAUTHENTICATED: Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.

Error: Command failed: node ./runReportWithPropertyQuota.js 222596558
16 UNAUTHENTICATED: Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.

at checkExecSyncError (child_process.js:635:11)
at Object.execSync (child_process.js:671:15)
at execSync (test/runReportWithPropertyQuota.test.js:24:28)
at Context.<anonymous> (test/runReportWithPropertyQuota.test.js:31:20)
at processImmediate (internal/timers.js:461:21)</pre></details>

RunReport: should run runReport failed

This test failed!

To configure my behavior, see the Flaky Bot documentation.

If I'm commenting on this issue too often, add the flakybot: quiet label and
I will stop commenting.


commit: ae646a5
buildURL: Build Status, Sponge
status: failed

Test output
Command failed: node ./runReport.js 222596558
16 UNAUTHENTICATED: Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.

Error: Command failed: node ./runReport.js 222596558
16 UNAUTHENTICATED: Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.

at checkExecSyncError (child_process.js:635:11)
at Object.execSync (child_process.js:671:15)
at execSync (test/runReport.test.js:24:28)
at Context.<anonymous> (test/runReport.test.js:31:20)
at processImmediate (internal/timers.js:461:21)</pre></details>

Missing metric : number of Exits / Exit Rate

Is your feature request related to a problem? Please describe.

There seems to be a missing metric about Exits / Exit Rate (see https://support.google.com/analytics/answer/2525491). This would be particularly useful in combination with the dimension unifiedPagePathScreen to detect the exit rate for each pages.

Describe the solution you'd like

Make the Exit available from Google Analytics Data API

Describe alternatives you've considered

Could not find a good alternative to this metric missing : we had to to check the value manually in GA 4 console.

Additional context

This metric exists in GA4 since it can be found from GA search bar :
https://mcusercontent.com/bfa1c8f3bfff111e8cefeeb14/images/7efc0815-fe6b-2416-df5a-13f452b4da87.jpg

Or from custom views :
https://mcusercontent.com/bfa1c8f3bfff111e8cefeeb14/images/35b73b21-8d39-685c-1008-2dbe88b0ec77.jpg

Report with dimension in list filter: should run a report using a dimension filter with `in_list_filter` expression.` failed

This test failed!

To configure my behavior, see the Flaky Bot documentation.

If I'm commenting on this issue too often, add the flakybot: quiet label and
I will stop commenting.


commit: ae646a5
buildURL: Build Status, Sponge
status: failed

Test output
Command failed: node ./runReportWithDimensionInListFilter.js 222596558
16 UNAUTHENTICATED: Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.

Error: Command failed: node ./runReportWithDimensionInListFilter.js 222596558
16 UNAUTHENTICATED: Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.

at checkExecSyncError (child_process.js:635:11)
at Object.execSync (child_process.js:671:15)
at execSync (test/runReportWithDimensionInListFilter.test.js:24:28)
at Context.<anonymous> (test/runReportWithDimensionInListFilter.test.js:31:20)
at processImmediate (internal/timers.js:461:21)</pre></details>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.