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.

Analytics Realtime batch

See original GitHub issue

Hello,

Not an issue just some help needed.

How can batch requests for the realtime api?

I tried to use analyticsreporting.reports.batchGet but I get this error message:

message: 'Unknown dimensions(s): rt:campaign, unknown metric(s): rt:activeUsers\nFor details see https://developers.google.com/analytics/devguides/reporting/core/dimsmets.',

Thanks for the help!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
karlwilburcommented, Nov 20, 2018

@phaistonian,

Here’s what I have:

import config from './config.js'
import { google } from 'googleapis'

const scopes = ['https://www.googleapis.com/auth/analytics.readonly']
const jwtClient = new google.auth.JWT(config.clientEmail, null, config.privateKey, scopes)

async function doTheThings() {
  await jwtClient.authorize()
  let response = await google.analytics('v3').data.realtime.get({
    'auth': jwtClient,
    'ids': 'ga:' + config.viewId,
    'metrics': 'rt:activeUsers'
  })
  console.log(response)
}

doTheThings().catch(console.error)

1reaction
dandanXOcommented, Oct 1, 2019

@phaistonian,

Here’s what I have:

import config from './config.js'
import { google } from 'googleapis'

const scopes = ['https://www.googleapis.com/auth/analytics.readonly']
const jwtClient = new google.auth.JWT(config.clientEmail, null, config.privateKey, scopes)

async function doTheThings() {
  await jwtClient.authorize()
  let response = await google.analytics('v3').data.realtime.get({
    'auth': jwtClient,
    'ids': 'ga:' + config.viewId,
    'metrics': 'rt:activeUsers'
  })
  console.log(response)
}

doTheThings().catch(console.error)

thanks god ! I find v3 api for realtime batch for 2 day finally!!

Read more comments on GitHub >

github_iconTop Results From Across the Web

The Difference Between Real-Time, Near Real-Time & Batch ...
Batch processing is even less time-sensitive than near real-time. In fact, batch processing jobs can take hours, or perhaps even days. Batch ......
Read more >
Batching Google Analytics API Requests
A batch request is a single standard HTTP request containing multiple Google Analytics API calls, using the multipart/mixed content type. Within that main...
Read more >
Real-Time Analytics Explained - Rockset
Batch analytics is high latency analytics where queries return results on data that is at least minutes old. In contrast, real-time analytics is...
Read more >
Batch Processing vs Real Time Data Streams - Confluent
Batch processing collects data points at specific time periods, whereas stream processing can stream data continuously, allow for real-time data processing, ...
Read more >
Top 5 Reasons for Moving from Batch to Real-Time Analytics
Fast analytics on fresh data is better than slow analytics on stale data. Fresh beats stale every time. Fast beats slow in every...
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