You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi team,
instead of using export GOOGLE_APPLICATION_CREDENTIALS="/home/ec2-user/Projects/credentials.json"
I want something like const GOOGLE_APPLICATION_CREDENTIALS="/home/ec2-user/Projects/credentials.json" in this code , can anyone help
`// 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();
Hi team,
instead of using export GOOGLE_APPLICATION_CREDENTIALS="/home/ec2-user/Projects/credentials.json"
I want something like const GOOGLE_APPLICATION_CREDENTIALS="/home/ec2-user/Projects/credentials.json" in this code , can anyone help
`// 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]);
});
}
`
The text was updated successfully, but these errors were encountered: