Skip to content

Instantly share code, notes, and snippets.

@snehil002
Created January 25, 2023 12:09
Show Gist options
  • Save snehil002/8082be5ddc37ab840eea74da73d064a8 to your computer and use it in GitHub Desktop.
Save snehil002/8082be5ddc37ab840eea74da73d064a8 to your computer and use it in GitHub Desktop.
Web Analytics Tool - Data Requested and Fetched by the Dashboard
/* Fetch URL */
const url = "MY_SERVER_API_HERE" +
`/get-metric/` + `?` + `visitedurl=${visitedUrl}` + `&metricname=${metricName}` +
`&timestringi=${timeStringI}` + `&timestringf=${timeStringF}` +
`&timezone=${timeZone}`;
/* Data Requested by The DashBoard */
* const visitedUrl = PATH_NAME_OF_THE_TRACKED_WEBSITE
* const metricName = //Metric Name - hourly, daily, monthly, device width, traffic source;
* const timeStringI = Initial Date in Local Time of Client
* const timeStringF = Final Date in Local Time of Client
* Visitor Count on the Requested URL within the said Time Interval
* Average Time spent by visitors on the Requested URL within the said Time Interval
/* Data Fetched By The DashBoard */
{
"xaxis" : ['3 Jan', '4 Jan', '5 Jan', '6 Jan', '7 Jan', '8 Jan'],
"yaxis" : {
"visitorCount": {
"data": [12, 19, 3, 5, 2, 3],
"ylabel": "Number of Visitors on different Days in the requested Time Interval"
},
"avgTime": {
"data": [12, 19, 3, 5, 2, 3],
"ylabel": "Average Time Spent by Visitors on different Days in the requested Time Interval"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment