Created
May 6, 2020 13:25
-
-
Save Abhikumar98/c6487b77def560188e32827ff9f84e88 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const response = await gapi.client.request<QueryResponse>({ | |
path: "/v4/reports:batchGet", | |
root: "https://analyticsreporting.googleapis.com/", | |
method: "POST", | |
body: { | |
reportRequests: [ | |
{ | |
viewId: profileId, | |
dateRanges: [ | |
{ | |
startDate: "30daysAgo", | |
endDate: "today" | |
}, | |
{ | |
startDate: "60daysAgo", | |
endDate: "30daysAgo" | |
} | |
], | |
metrics: [ | |
{ | |
expression: "ga:sessions" | |
} | |
], | |
dimensions: [ | |
{ | |
name: "ga:date" | |
} | |
] | |
} | |
] | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment