Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

114
Vistas
Query Google Analytics Data API by Client Id

I am switching from Google Analytics universal to GA4. In doing so, I am now using the Google Analytics Data API. One feature I used to use was running reports based on client id. I don't see the ability to do this with the Google Analytics Data API. Can you please show me how I would accomplish the below code with the new API?

const reporting = google.analyticsreporting('v4');
const viewId = this.configService.get<string>('googleAnalytics.viewId');
const params = {
  viewId,
  user: {
    type: 'CLIENT_ID',
    userId: 123456.12312312,
  },
}
const clientEmail = this.configService.get<string>('googleAnalytics.clientEmail');
const privateKey = this.configService.get<string>('googleAnalytics.privateKey');
const scope = this.configService.get<string[]>('googleAnalytics.scope');
const jwt = new google.auth.JWT(clientEmail, null, privateKey, scope);
const request = {
  headers: { 'Content-Type': 'application/json' },
  auth: jwt,
  resource: params,
};
reporting.userActivity.search(request);
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda