curl --request PUT \
--url https://api.example.com/v1/panel/analytics \
--header 'Content-Type: application/json' \
--header 'X-CSRF-Token: <x-csrf-token>' \
--data '
{
"version": 123,
"enabled": true,
"counters": {},
"verifications": [
{
"content": "<string>"
}
]
}
'import requests
url = "https://api.example.com/v1/panel/analytics"
payload = {
"version": 123,
"enabled": True,
"counters": {},
"verifications": [{ "content": "<string>" }]
}
headers = {
"X-CSRF-Token": "<x-csrf-token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-CSRF-Token': '<x-csrf-token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
version: 123,
enabled: true,
counters: {},
verifications: [{content: '<string>'}]
})
};
fetch('https://api.example.com/v1/panel/analytics', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/panel/analytics",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'version' => 123,
'enabled' => true,
'counters' => [
],
'verifications' => [
[
'content' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-CSRF-Token: <x-csrf-token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/panel/analytics"
payload := strings.NewReader("{\n \"version\": 123,\n \"enabled\": true,\n \"counters\": {},\n \"verifications\": [\n {\n \"content\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-CSRF-Token", "<x-csrf-token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.example.com/v1/panel/analytics")
.header("X-CSRF-Token", "<x-csrf-token>")
.header("Content-Type", "application/json")
.body("{\n \"version\": 123,\n \"enabled\": true,\n \"counters\": {},\n \"verifications\": [\n {\n \"content\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/panel/analytics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-CSRF-Token"] = '<x-csrf-token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"version\": 123,\n \"enabled\": true,\n \"counters\": {},\n \"verifications\": [\n {\n \"content\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"version": 123,
"providers": [
"<string>"
],
"verificationNames": [
"<string>"
],
"enabled": true,
"counters": {},
"verifications": [
{
"name": "google-site-verification",
"content": "<string>"
}
],
"updatedAt": "2023-11-07T05:31:56Z",
"updatedBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"request_id": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"request_id": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"request_id": "<string>"
}Put v1panelanalytics
Requires settings.write and the current version.
A counter is a provider this repository knows and an identifier validated against its shape — never a snippet. The flexibility given up is exactly the ability to run arbitrary code in a customer’s browser, and a customer’s browser holds subscription links. enabled is separate from having identifiers so turning measurement off does not mean finding the numbers again to turn it back on.
Verification tags are a name from an allowlist and an opaque token. They set no cookie, load no script, and observe nobody, which is why they render regardless of enabled and regardless of consent — a verification that only appeared for consenting visitors would verify nothing, because the fetcher is a webmaster tool rather than a person.
curl --request PUT \
--url https://api.example.com/v1/panel/analytics \
--header 'Content-Type: application/json' \
--header 'X-CSRF-Token: <x-csrf-token>' \
--data '
{
"version": 123,
"enabled": true,
"counters": {},
"verifications": [
{
"content": "<string>"
}
]
}
'import requests
url = "https://api.example.com/v1/panel/analytics"
payload = {
"version": 123,
"enabled": True,
"counters": {},
"verifications": [{ "content": "<string>" }]
}
headers = {
"X-CSRF-Token": "<x-csrf-token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-CSRF-Token': '<x-csrf-token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
version: 123,
enabled: true,
counters: {},
verifications: [{content: '<string>'}]
})
};
fetch('https://api.example.com/v1/panel/analytics', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/panel/analytics",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'version' => 123,
'enabled' => true,
'counters' => [
],
'verifications' => [
[
'content' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-CSRF-Token: <x-csrf-token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/panel/analytics"
payload := strings.NewReader("{\n \"version\": 123,\n \"enabled\": true,\n \"counters\": {},\n \"verifications\": [\n {\n \"content\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-CSRF-Token", "<x-csrf-token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.example.com/v1/panel/analytics")
.header("X-CSRF-Token", "<x-csrf-token>")
.header("Content-Type", "application/json")
.body("{\n \"version\": 123,\n \"enabled\": true,\n \"counters\": {},\n \"verifications\": [\n {\n \"content\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/panel/analytics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-CSRF-Token"] = '<x-csrf-token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"version\": 123,\n \"enabled\": true,\n \"counters\": {},\n \"verifications\": [\n {\n \"content\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"version": 123,
"providers": [
"<string>"
],
"verificationNames": [
"<string>"
],
"enabled": true,
"counters": {},
"verifications": [
{
"name": "google-site-verification",
"content": "<string>"
}
],
"updatedAt": "2023-11-07T05:31:56Z",
"updatedBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"request_id": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"request_id": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"request_id": "<string>"
}Headers
Echoes the token from the current session. Required on every unsafe method.
Body
False on a fresh installation. Nothing renders or is captured until this is on.
Identifier per provider. yandex_metrica is a counter number; google_analytics is a measurement ID such as G-XXXXXXX.
Show child attributes
Show child attributes
8Show child attributes
Show child attributes
Response
Saved
The counters this build can render, so the screen offers what exists.
False on a fresh installation. Nothing renders or is captured until this is on.
Identifier per provider. yandex_metrica is a counter number; google_analytics is a measurement ID such as G-XXXXXXX.
Show child attributes
Show child attributes
8Show child attributes
Show child attributes