Docs

Browser Telemetry

Use this when your backend already calls /api/v1/score and you want to add device/behavior signals collected on the page the visitor lands on afterward (e.g. a "thank you" or dashboard page). This sharpens results without changing your backend request.

1. Store the request ID

After /api/v1/score returns, make its request_id available to the browser before the script below runs — for example by rendering it into the page.

<script>
  localStorage.setItem("revylta_request_id", "REQUEST_ID_FROM_SCORE_RESPONSE");
</script>

2. Install the script on the next page

<script src="https://edgefiles.ams3.cdn.digitaloceanspaces.com/revylta/revenueshield.js"
        data-api-key="YOUR_BROWSER_KEY"
        data-mode="postscore"></script>

The script automatically reads the stored revylta_request_id and reports telemetry against it using your browser key.

Doing it manually (no script)

If you'd rather collect and send telemetry yourself:

POST /api/v1/browser_telemetry
FieldDescription
request_idrequiredThe ID from the original score response. Sent as the X-Request-ID header or as a body field.
browser_telemetryrequiredAn object of device/behavior signals.
curl -X POST "https://revylta.com/api/v1/browser_telemetry" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: YOUR_BROWSER_KEY" \
  -d '{
  "request_id": "550e8400-e29b-41d4-a716-446655440000",
  "browser_telemetry": {
    "behavioral_session": {
      "page_context": "postsignup"
    }
  }
}'
const response = await fetch("https://revylta.com/api/v1/browser_telemetry", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "X-API-KEY": "YOUR_BROWSER_KEY"
  },
  body: JSON.stringify({
  "request_id": "550e8400-e29b-41d4-a716-446655440000",
  "browser_telemetry": {
    "behavioral_session": {
      "page_context": "postsignup"
    }
  }
})
});

const result = await response.json();
console.log(result);
import requests

response = requests.post(
    "https://revylta.com/api/v1/browser_telemetry",
    headers={
        "Content-Type": "application/json",
        "X-API-KEY": "YOUR_BROWSER_KEY"
    },
    json={
  "request_id": "550e8400-e29b-41d4-a716-446655440000",
  "browser_telemetry": {
    "behavioral_session": {
      "page_context": "postsignup"
    }
  }
}
)

print(response.status_code)
print(response.json())
require "net/http"
require "json"
require "uri"

uri = URI("https://revylta.com/api/v1/browser_telemetry")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"

request = Net::HTTP::Post.new(uri)
request["Content-Type"] = "application/json"
request["X-API-KEY"] = "YOUR_BROWSER_KEY"
request.body = JSON.generate({
  "request_id": "550e8400-e29b-41d4-a716-446655440000",
  "browser_telemetry": {
    "behavioral_session": {
      "page_context": "postsignup"
    }
  }
})

response = http.request(request)
puts response.code
puts response.body
<?php
$payload = [
    "request_id" => "550e8400-e29b-41d4-a716-446655440000",
    "browser_telemetry" => [
        "behavioral_session" => [
            "page_context" => "postsignup"
        ]
    ]
];

$ch = curl_init("https://revylta.com/api/v1/browser_telemetry");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "Content-Type: application/json",
    "X-API-KEY: YOUR_BROWSER_KEY"
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));

$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

echo $status . PHP_EOL;
echo $response . PHP_EOL;

Response

{
  "status": "accepted",
  "queued": true,
  "request_id": "550e8400-e29b-41d4-a716-446655440000"
}

Telemetry is processed asynchronously — it enriches later reads of this request but doesn't hold up the response.