Closed SgtPooki closed 1 year ago
I'm obtaining the data from the URLs below via:
const url = new URL(requestURL)
console.log(JSON.stringify(decodeURIComponent(url.search.slice(1)).split('&').reduce((acc, qParam) => {
const [key, value] = qParam.split('=')
console.log(`${key}=${value}`)
try {
acc[key] = JSON.parse(value)
} catch (err) {
acc[key] = value
}
return acc
}, {}), null, 2));
metrics implementation was already merged (https://github.com/ipfs/public-gateway-checker/pull/309), but it's not opt-out yet. I.e. until you accept/decline, no metrics are sent. see https://github.com/ipfs-shipyard/ignite-metrics/issues/2
Zero requests sent (right now)
Two requests to countly.ipfs.io are sent:
{
"events": [
{
"key": "[CLY]_view",
"count": 1,
"dur": 422,
"segmentation": {
"name": "/settings*"
},
"timestamp": 1667480662969,
"hour": 13,
"dow": 4
}
],
"app_key": "8fa213e6049bff23b08e5f5fbac89e7c27397612",
"device_id": "632c2abd-c939-41cd-8080-4b33586da440",
"sdk_name": "javascript_native_web",
"sdk_version": 19.08,
"timestamp": 1667480663018,
"hour": 13,
"dow": 4,
"consent": {
"sessions": true,
"events": true,
"views": true,
"location": true
}
}
{
"consent": {
"sessions": true,
"events": true,
"views": true,
"scrolls": true,
"clicks": true,
"forms": true,
"crashes": true,
"attribution": true,
"users": true,
"star-rating": true,
"location": true,
"apm": true,
"feedback": true,
"remote-config": false
},
"app_key": "3c2c0819434074fc4d339ddd8e112a1e741ecb72",
"device_id": "155f5945-6eb8-4446-902d-35cff3d5d540",
"sdk_name": "javascript_native_web",
"sdk_version": "22.06.4",
"t": 1,
"timestamp": 1671052221571,
"hour": 13,
"dow": 3
}
Two requests to countly.ipfs.io are sent: This will be the default going forward. i.e. necessary metrics will be toggled on, and not opt-out. See #125
{
"events": [
{
"key": "[CLY]_view",
"count": 1,
"segmentation": {
"name": "/",
"visit": 1,
"view": "/",
"domain": "ipfs-public-gateway-checker.on.fleek.co"
},
"timestamp": 1671053598097,
"hour": 13,
"dow": 3
}
],
"app_key": "3c2c0819434074fc4d339ddd8e112a1e741ecb72",
"device_id": "155f5945-6eb8-4446-902d-35cff3d5d540",
"sdk_name": "javascript_native_web",
"sdk_version": "22.06.4",
"t": 1,
"location": "",
"timestamp": 1671053598126,
"hour": 13,
"dow": 3
}
{
"consent": {
"sessions": true,
"events": false,
"views": true,
"scrolls": false,
"clicks": false,
"forms": false,
"crashes": false,
"attribution": false,
"users": false,
"star-rating": false,
"location": false,
"apm": false,
"feedback": false,
"remote-config": false
},
"app_key": "3c2c0819434074fc4d339ddd8e112a1e741ecb72",
"device_id": "155f5945-6eb8-4446-902d-35cff3d5d540",
"sdk_name": "javascript_native_web",
"sdk_version": "22.06.4",
"t": 1,
"location": "",
"timestamp": 1671053599096,
"hour": 13,
"dow": 3
}
Note that more than two requests are sent after initial acceptance/decline based on interactions, but the data objects sent in subsequent requests should mostly conform to the examples given above. One example with necessary metrics, the following action (clicking on a link in the public gateway checker) is not sent:
{
"events": [
{
"key": "[CLY]_action",
"count": 1,
"segmentation": {
"type": "click",
"x": 290,
"y": 428,
"width": 1363,
"height": 3028,
"view": "/",
"domain": "ipfs-public-gateway-checker.on.fleek.co"
},
"timestamp": 1671055107000,
"hour": 13,
"dow": 3
},
{
"key": "linkClick",
"count": 1,
"segmentation": {
"href": "https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#The_HTTP_response_headers",
"text": "CORS",
"id": "",
"view": "/"
},
"timestamp": 1671055107001,
"hour": 13,
"dow": 3
}
],
"app_key": "3c2c0819434074fc4d339ddd8e112a1e741ecb72",
"device_id": "155f5945-6eb8-4446-902d-35cff3d5d540",
"sdk_name": "javascript_native_web",
"sdk_version": "22.06.4",
"t": 1,
"timestamp": 1671055108131,
"hour": 13,
"dow": 3
}
Also see basic request data sent: https://support.count.ly/hc/en-us/articles/360037753291-SDK-development-guide#making-requests
There are some parameters that should be added to all requests even though they are not mandatory. Together with the required parameters they form the base request. Every request sent to the server should be formed from this base request. The parameters in this base request are:
"app_key" - the application key for this countly app (retrievable on the dashboard) "device_id" - the current users device ID "timestamp" - the timestamp in ms of when this request is created "hour" - the hour of the timestamp "dow" - the day of the week for this timestamp. 0 - sunday, ... , 6 - saturday. "tz" - this devices timezone offset "sdk_version" - the SDK's version "sdk_name" - the SDK's name
@SgtPooki is there also sample of request (if-any) sent for the metrics collected when the client was off-line (if-any)?
@whizzzkid apparently, countly does not handle collecting and sending offline metrics by default. I tested this via network throttling set to "offline" in brave.
If we want to accomplish that, we should open an issue in ipfs-shipyard/ipfs-ignite that handles it via methods discussed at https://support.count.ly/hc/en-us/articles/360037753291-SDK-development-guide#request-queue but for now we will leave it as is
I will provide examples in this issue of the type of metrics that countly sends for our necessary metrics:
From #125:
necessary
metrics by default. These will be enabled when using our projects moving forward. i.e. you cannot opt-out of these metrics. However, we are doing our best to ensure that these necessary metrics are the minimum required for us to prioritize work on our projects.const necessaryFeatures = ['sessions', 'views']
). See This Issue for more information