Send Hit Event
curl --request POST \
--url http://localhost:8080/event/hit \
--header 'Content-Type: application/json' \
--data '
{
"b": "<string>",
"u": "<string>",
"p": true,
"q": true,
"r": "<string>",
"t": "<string>",
"d": {}
}
'import requests
url = "http://localhost:8080/event/hit"
payload = {
"b": "<string>",
"u": "<string>",
"p": True,
"q": True,
"r": "<string>",
"t": "<string>",
"d": {}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
b: '<string>',
u: '<string>',
p: true,
q: true,
r: '<string>',
t: '<string>',
d: {}
})
};
fetch('http://localhost:8080/event/hit', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://localhost:8080/event/hit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'b' => '<string>',
'u' => '<string>',
'p' => true,
'q' => true,
'r' => '<string>',
't' => '<string>',
'd' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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 := "http://localhost:8080/event/hit"
payload := strings.NewReader("{\n \"b\": \"<string>\",\n \"u\": \"<string>\",\n \"p\": true,\n \"q\": true,\n \"r\": \"<string>\",\n \"t\": \"<string>\",\n \"d\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
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.post("http://localhost:8080/event/hit")
.header("Content-Type", "application/json")
.body("{\n \"b\": \"<string>\",\n \"u\": \"<string>\",\n \"p\": true,\n \"q\": true,\n \"r\": \"<string>\",\n \"t\": \"<string>\",\n \"d\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/event/hit")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"b\": \"<string>\",\n \"u\": \"<string>\",\n \"p\": true,\n \"q\": true,\n \"r\": \"<string>\",\n \"t\": \"<string>\",\n \"d\": {}\n}"
response = http.request(request)
puts response.read_body{
"error": {
"code": 400,
"message": "<string>"
}
}{
"error": {
"code": 404,
"message": "<string>"
}
}{
"error": {
"code": 500,
"message": "<string>"
}
}Event
Send Hit Event
Send a hit event to register a user view or interaction.
POST
/
event
/
hit
Send Hit Event
curl --request POST \
--url http://localhost:8080/event/hit \
--header 'Content-Type: application/json' \
--data '
{
"b": "<string>",
"u": "<string>",
"p": true,
"q": true,
"r": "<string>",
"t": "<string>",
"d": {}
}
'import requests
url = "http://localhost:8080/event/hit"
payload = {
"b": "<string>",
"u": "<string>",
"p": True,
"q": True,
"r": "<string>",
"t": "<string>",
"d": {}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
b: '<string>',
u: '<string>',
p: true,
q: true,
r: '<string>',
t: '<string>',
d: {}
})
};
fetch('http://localhost:8080/event/hit', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://localhost:8080/event/hit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'b' => '<string>',
'u' => '<string>',
'p' => true,
'q' => true,
'r' => '<string>',
't' => '<string>',
'd' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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 := "http://localhost:8080/event/hit"
payload := strings.NewReader("{\n \"b\": \"<string>\",\n \"u\": \"<string>\",\n \"p\": true,\n \"q\": true,\n \"r\": \"<string>\",\n \"t\": \"<string>\",\n \"d\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
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.post("http://localhost:8080/event/hit")
.header("Content-Type", "application/json")
.body("{\n \"b\": \"<string>\",\n \"u\": \"<string>\",\n \"p\": true,\n \"q\": true,\n \"r\": \"<string>\",\n \"t\": \"<string>\",\n \"d\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/event/hit")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"b\": \"<string>\",\n \"u\": \"<string>\",\n \"p\": true,\n \"q\": true,\n \"r\": \"<string>\",\n \"t\": \"<string>\",\n \"d\": {}\n}"
response = http.request(request)
puts response.read_body{
"error": {
"code": 400,
"message": "<string>"
}
}{
"error": {
"code": 404,
"message": "<string>"
}
}{
"error": {
"code": 500,
"message": "<string>"
}
}Headers
Used to infer user browser, OS and device.
Used to infer user language.
Body
application/json
Hit event metadata.
- EventLoad
- EventUnload
- EventCustom
Page view load event.
Beacon ID generated for each user to link multiple events on the same page together.
Page URL including query parameters.
If the user is a unique user or not.
If the user has visited this page before or not.
Referrer URL.
Timezone of the user.
Custom event properties.
Show child attributes
Show child attributes
Response
OK.
⌘I