Skip to main content

Session Endpoint

This Endpoint is for checking session visits

Base URL: https://web-counter.azurewebsites.net

Increment a WebEvent Count

Increments the counter for the specified Web Event and Web Page combination

URL: /api/counter/analytics-session

Method: PUT

Content Type: application/json

Request Body

info

SessionID is optional and if not found, a new Session ID will be generated

{
"sessionId": "string",
"eventName": "Page Visit",
"pathname": "/"
}

Example Requests

const response = await fetch(
"https://web-counter.azurewebsites.net/api/counter/analytics-session",
{
method: "PUT",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
sessionId: "3fa85f64-5717-4562-b3fc-2c963f66afa6",
eventName: "Page Visit",
pathname: "/",
}),
}
);

Example Responses

A Status 201 is returned when an update was made which include the Session ID being used to track visits for the visitor.

{
"sessionId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"eventName": "string",
"pathname": "string"
}