https request
The implementation of measurement on the server side can be achieved with HTTPS requests. The parameters of the request are detailed below.
Make sure you have validated the domain in the mHub Cloud Portal before proceeding.
Endpoint
The endpoint being called by the request is located the domain you have set up for your instance (see Initialising the collect function). For example, if you have set up collection for the domain "example.com", the endpoint your request needs to call will be mhubc.example.com/api/se.
The standard mHub Cloud subdomain name is 'mhubc'. However, this may vary depending on your settings. You can check this in the mHub Cloud Portal.
Request options
The request sent to the collect API endpoint is a POST request. No authorization is required. All headers other than Content-Type, Content-Length, and Host are optional.
The parameters of the event being sent should be sent in the request body in JSON form. An example body is shown here:
{
$schema: 'mhub/customEvent',
event: {
code: 'registration',
region: 'CZ'
},
timestamp: 1724316723000,
user: {
id: '7cdea7e6-45e2-4c8a-94e1-6545be853bf0'
}
}