curl --request POST \
--url https://api.unifyintent.com/analytics/v1/page \
--header 'Content-Type: application/json' \
--header 'Origin: <origin>' \
--header 'X-Write-Key: <api-key>' \
--data '
{
"type": "page",
"visitorId": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"context": {
"library": {
"name": "<string>",
"version": "<string>"
},
"ip": "127.0.0.1",
"locale": "<string>",
"userAgent": "<string>",
"userAgentData": {
"brands": [
{
"brand": "<string>",
"version": "<string>"
}
],
"mobile": true,
"platform": "<string>"
},
"utm": {
"source": "<string>",
"medium": "<string>",
"campaign": "<string>",
"term": "<string>",
"content": "<string>"
}
},
"sessionId": "<string>",
"sentAt": "2023-11-07T05:31:56Z",
"name": "<string>",
"properties": {
"path": "<string>",
"query": {},
"referrer": "<string>",
"title": "<string>",
"url": "<string>"
}
}
'import requests
url = "https://api.unifyintent.com/analytics/v1/page"
payload = {
"type": "page",
"visitorId": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"context": {
"library": {
"name": "<string>",
"version": "<string>"
},
"ip": "127.0.0.1",
"locale": "<string>",
"userAgent": "<string>",
"userAgentData": {
"brands": [
{
"brand": "<string>",
"version": "<string>"
}
],
"mobile": True,
"platform": "<string>"
},
"utm": {
"source": "<string>",
"medium": "<string>",
"campaign": "<string>",
"term": "<string>",
"content": "<string>"
}
},
"sessionId": "<string>",
"sentAt": "2023-11-07T05:31:56Z",
"name": "<string>",
"properties": {
"path": "<string>",
"query": {},
"referrer": "<string>",
"title": "<string>",
"url": "<string>"
}
}
headers = {
"Origin": "<origin>",
"X-Write-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Origin: '<origin>',
'X-Write-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
type: 'page',
visitorId: '<string>',
timestamp: '2023-11-07T05:31:56Z',
context: {
library: {name: '<string>', version: '<string>'},
ip: '127.0.0.1',
locale: '<string>',
userAgent: '<string>',
userAgentData: {
brands: [{brand: '<string>', version: '<string>'}],
mobile: true,
platform: '<string>'
},
utm: {
source: '<string>',
medium: '<string>',
campaign: '<string>',
term: '<string>',
content: '<string>'
}
},
sessionId: '<string>',
sentAt: '2023-11-07T05:31:56Z',
name: '<string>',
properties: {
path: '<string>',
query: {},
referrer: '<string>',
title: '<string>',
url: '<string>'
}
})
};
fetch('https://api.unifyintent.com/analytics/v1/page', 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.unifyintent.com/analytics/v1/page",
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([
'type' => 'page',
'visitorId' => '<string>',
'timestamp' => '2023-11-07T05:31:56Z',
'context' => [
'library' => [
'name' => '<string>',
'version' => '<string>'
],
'ip' => '127.0.0.1',
'locale' => '<string>',
'userAgent' => '<string>',
'userAgentData' => [
'brands' => [
[
'brand' => '<string>',
'version' => '<string>'
]
],
'mobile' => true,
'platform' => '<string>'
],
'utm' => [
'source' => '<string>',
'medium' => '<string>',
'campaign' => '<string>',
'term' => '<string>',
'content' => '<string>'
]
],
'sessionId' => '<string>',
'sentAt' => '2023-11-07T05:31:56Z',
'name' => '<string>',
'properties' => [
'path' => '<string>',
'query' => [
],
'referrer' => '<string>',
'title' => '<string>',
'url' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Origin: <origin>",
"X-Write-Key: <api-key>"
],
]);
$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.unifyintent.com/analytics/v1/page"
payload := strings.NewReader("{\n \"type\": \"page\",\n \"visitorId\": \"<string>\",\n \"timestamp\": \"2023-11-07T05:31:56Z\",\n \"context\": {\n \"library\": {\n \"name\": \"<string>\",\n \"version\": \"<string>\"\n },\n \"ip\": \"127.0.0.1\",\n \"locale\": \"<string>\",\n \"userAgent\": \"<string>\",\n \"userAgentData\": {\n \"brands\": [\n {\n \"brand\": \"<string>\",\n \"version\": \"<string>\"\n }\n ],\n \"mobile\": true,\n \"platform\": \"<string>\"\n },\n \"utm\": {\n \"source\": \"<string>\",\n \"medium\": \"<string>\",\n \"campaign\": \"<string>\",\n \"term\": \"<string>\",\n \"content\": \"<string>\"\n }\n },\n \"sessionId\": \"<string>\",\n \"sentAt\": \"2023-11-07T05:31:56Z\",\n \"name\": \"<string>\",\n \"properties\": {\n \"path\": \"<string>\",\n \"query\": {},\n \"referrer\": \"<string>\",\n \"title\": \"<string>\",\n \"url\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Origin", "<origin>")
req.Header.Add("X-Write-Key", "<api-key>")
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("https://api.unifyintent.com/analytics/v1/page")
.header("Origin", "<origin>")
.header("X-Write-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"page\",\n \"visitorId\": \"<string>\",\n \"timestamp\": \"2023-11-07T05:31:56Z\",\n \"context\": {\n \"library\": {\n \"name\": \"<string>\",\n \"version\": \"<string>\"\n },\n \"ip\": \"127.0.0.1\",\n \"locale\": \"<string>\",\n \"userAgent\": \"<string>\",\n \"userAgentData\": {\n \"brands\": [\n {\n \"brand\": \"<string>\",\n \"version\": \"<string>\"\n }\n ],\n \"mobile\": true,\n \"platform\": \"<string>\"\n },\n \"utm\": {\n \"source\": \"<string>\",\n \"medium\": \"<string>\",\n \"campaign\": \"<string>\",\n \"term\": \"<string>\",\n \"content\": \"<string>\"\n }\n },\n \"sessionId\": \"<string>\",\n \"sentAt\": \"2023-11-07T05:31:56Z\",\n \"name\": \"<string>\",\n \"properties\": {\n \"path\": \"<string>\",\n \"query\": {},\n \"referrer\": \"<string>\",\n \"title\": \"<string>\",\n \"url\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.unifyintent.com/analytics/v1/page")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Origin"] = '<origin>'
request["X-Write-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"page\",\n \"visitorId\": \"<string>\",\n \"timestamp\": \"2023-11-07T05:31:56Z\",\n \"context\": {\n \"library\": {\n \"name\": \"<string>\",\n \"version\": \"<string>\"\n },\n \"ip\": \"127.0.0.1\",\n \"locale\": \"<string>\",\n \"userAgent\": \"<string>\",\n \"userAgentData\": {\n \"brands\": [\n {\n \"brand\": \"<string>\",\n \"version\": \"<string>\"\n }\n ],\n \"mobile\": true,\n \"platform\": \"<string>\"\n },\n \"utm\": {\n \"source\": \"<string>\",\n \"medium\": \"<string>\",\n \"campaign\": \"<string>\",\n \"term\": \"<string>\",\n \"content\": \"<string>\"\n }\n },\n \"sessionId\": \"<string>\",\n \"sentAt\": \"2023-11-07T05:31:56Z\",\n \"name\": \"<string>\",\n \"properties\": {\n \"path\": \"<string>\",\n \"query\": {},\n \"referrer\": \"<string>\",\n \"title\": \"<string>\",\n \"url\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_bodyPage events
Record visits to your website or application.
curl --request POST \
--url https://api.unifyintent.com/analytics/v1/page \
--header 'Content-Type: application/json' \
--header 'Origin: <origin>' \
--header 'X-Write-Key: <api-key>' \
--data '
{
"type": "page",
"visitorId": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"context": {
"library": {
"name": "<string>",
"version": "<string>"
},
"ip": "127.0.0.1",
"locale": "<string>",
"userAgent": "<string>",
"userAgentData": {
"brands": [
{
"brand": "<string>",
"version": "<string>"
}
],
"mobile": true,
"platform": "<string>"
},
"utm": {
"source": "<string>",
"medium": "<string>",
"campaign": "<string>",
"term": "<string>",
"content": "<string>"
}
},
"sessionId": "<string>",
"sentAt": "2023-11-07T05:31:56Z",
"name": "<string>",
"properties": {
"path": "<string>",
"query": {},
"referrer": "<string>",
"title": "<string>",
"url": "<string>"
}
}
'import requests
url = "https://api.unifyintent.com/analytics/v1/page"
payload = {
"type": "page",
"visitorId": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"context": {
"library": {
"name": "<string>",
"version": "<string>"
},
"ip": "127.0.0.1",
"locale": "<string>",
"userAgent": "<string>",
"userAgentData": {
"brands": [
{
"brand": "<string>",
"version": "<string>"
}
],
"mobile": True,
"platform": "<string>"
},
"utm": {
"source": "<string>",
"medium": "<string>",
"campaign": "<string>",
"term": "<string>",
"content": "<string>"
}
},
"sessionId": "<string>",
"sentAt": "2023-11-07T05:31:56Z",
"name": "<string>",
"properties": {
"path": "<string>",
"query": {},
"referrer": "<string>",
"title": "<string>",
"url": "<string>"
}
}
headers = {
"Origin": "<origin>",
"X-Write-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Origin: '<origin>',
'X-Write-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
type: 'page',
visitorId: '<string>',
timestamp: '2023-11-07T05:31:56Z',
context: {
library: {name: '<string>', version: '<string>'},
ip: '127.0.0.1',
locale: '<string>',
userAgent: '<string>',
userAgentData: {
brands: [{brand: '<string>', version: '<string>'}],
mobile: true,
platform: '<string>'
},
utm: {
source: '<string>',
medium: '<string>',
campaign: '<string>',
term: '<string>',
content: '<string>'
}
},
sessionId: '<string>',
sentAt: '2023-11-07T05:31:56Z',
name: '<string>',
properties: {
path: '<string>',
query: {},
referrer: '<string>',
title: '<string>',
url: '<string>'
}
})
};
fetch('https://api.unifyintent.com/analytics/v1/page', 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.unifyintent.com/analytics/v1/page",
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([
'type' => 'page',
'visitorId' => '<string>',
'timestamp' => '2023-11-07T05:31:56Z',
'context' => [
'library' => [
'name' => '<string>',
'version' => '<string>'
],
'ip' => '127.0.0.1',
'locale' => '<string>',
'userAgent' => '<string>',
'userAgentData' => [
'brands' => [
[
'brand' => '<string>',
'version' => '<string>'
]
],
'mobile' => true,
'platform' => '<string>'
],
'utm' => [
'source' => '<string>',
'medium' => '<string>',
'campaign' => '<string>',
'term' => '<string>',
'content' => '<string>'
]
],
'sessionId' => '<string>',
'sentAt' => '2023-11-07T05:31:56Z',
'name' => '<string>',
'properties' => [
'path' => '<string>',
'query' => [
],
'referrer' => '<string>',
'title' => '<string>',
'url' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Origin: <origin>",
"X-Write-Key: <api-key>"
],
]);
$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.unifyintent.com/analytics/v1/page"
payload := strings.NewReader("{\n \"type\": \"page\",\n \"visitorId\": \"<string>\",\n \"timestamp\": \"2023-11-07T05:31:56Z\",\n \"context\": {\n \"library\": {\n \"name\": \"<string>\",\n \"version\": \"<string>\"\n },\n \"ip\": \"127.0.0.1\",\n \"locale\": \"<string>\",\n \"userAgent\": \"<string>\",\n \"userAgentData\": {\n \"brands\": [\n {\n \"brand\": \"<string>\",\n \"version\": \"<string>\"\n }\n ],\n \"mobile\": true,\n \"platform\": \"<string>\"\n },\n \"utm\": {\n \"source\": \"<string>\",\n \"medium\": \"<string>\",\n \"campaign\": \"<string>\",\n \"term\": \"<string>\",\n \"content\": \"<string>\"\n }\n },\n \"sessionId\": \"<string>\",\n \"sentAt\": \"2023-11-07T05:31:56Z\",\n \"name\": \"<string>\",\n \"properties\": {\n \"path\": \"<string>\",\n \"query\": {},\n \"referrer\": \"<string>\",\n \"title\": \"<string>\",\n \"url\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Origin", "<origin>")
req.Header.Add("X-Write-Key", "<api-key>")
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("https://api.unifyintent.com/analytics/v1/page")
.header("Origin", "<origin>")
.header("X-Write-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"page\",\n \"visitorId\": \"<string>\",\n \"timestamp\": \"2023-11-07T05:31:56Z\",\n \"context\": {\n \"library\": {\n \"name\": \"<string>\",\n \"version\": \"<string>\"\n },\n \"ip\": \"127.0.0.1\",\n \"locale\": \"<string>\",\n \"userAgent\": \"<string>\",\n \"userAgentData\": {\n \"brands\": [\n {\n \"brand\": \"<string>\",\n \"version\": \"<string>\"\n }\n ],\n \"mobile\": true,\n \"platform\": \"<string>\"\n },\n \"utm\": {\n \"source\": \"<string>\",\n \"medium\": \"<string>\",\n \"campaign\": \"<string>\",\n \"term\": \"<string>\",\n \"content\": \"<string>\"\n }\n },\n \"sessionId\": \"<string>\",\n \"sentAt\": \"2023-11-07T05:31:56Z\",\n \"name\": \"<string>\",\n \"properties\": {\n \"path\": \"<string>\",\n \"query\": {},\n \"referrer\": \"<string>\",\n \"title\": \"<string>\",\n \"url\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.unifyintent.com/analytics/v1/page")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Origin"] = '<origin>'
request["X-Write-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"page\",\n \"visitorId\": \"<string>\",\n \"timestamp\": \"2023-11-07T05:31:56Z\",\n \"context\": {\n \"library\": {\n \"name\": \"<string>\",\n \"version\": \"<string>\"\n },\n \"ip\": \"127.0.0.1\",\n \"locale\": \"<string>\",\n \"userAgent\": \"<string>\",\n \"userAgentData\": {\n \"brands\": [\n {\n \"brand\": \"<string>\",\n \"version\": \"<string>\"\n }\n ],\n \"mobile\": true,\n \"platform\": \"<string>\"\n },\n \"utm\": {\n \"source\": \"<string>\",\n \"medium\": \"<string>\",\n \"campaign\": \"<string>\",\n \"term\": \"<string>\",\n \"content\": \"<string>\"\n }\n },\n \"sessionId\": \"<string>\",\n \"sentAt\": \"2023-11-07T05:31:56Z\",\n \"name\": \"<string>\",\n \"properties\": {\n \"path\": \"<string>\",\n \"query\": {},\n \"referrer\": \"<string>\",\n \"title\": \"<string>\",\n \"url\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_bodyOverview
Send a page event when a visitor views a page on your website or application. Include the page URL and title so the visit has useful context in Unify.Examples
Track a pricing-page visit
Track a pricing-page visit
UNIFY_WRITE_KEY to the event source’s write key and use an allowed origin
in the Origin header. Replace the example visitor ID and timestamp with those
from the actual event. See Analytics authentication
for setup.curl --request POST \
--url "https://api.unifyintent.com/analytics/v1/page" \
--header "X-Write-Key: $UNIFY_WRITE_KEY" \
--header "Origin: https://app.your-company.example" \
--header "Content-Type: application/json" \
--data '{
"type": "page",
"visitorId": "visitor-trial-1042",
"sessionId": "session-trial-1042-1",
"timestamp": "2026-10-06T15:00:00Z",
"context": {},
"name": "Pricing",
"properties": {
"url": "https://app.your-company.example/pricing",
"path": "/pricing",
"title": "Pricing"
}
}'
visitorId consistent across events from the same visitor. When their
identity becomes known, send an identify event
with that visitor ID and their email address.Authorizations
Use the event source’s write key. Requests also require an allowed Origin header.
Headers
Website or application origin allowed for the event source. Required for browser and server-side requests.
Body
A page view event represents a client visiting a page on a website.
The type of analytics event being sent.
page Unique identifier for the visitor that triggered this event.
Timestamp of the event (in UTC).
Contextual information about the client behind the event.
Show child attributes
Show child attributes
Unique identifier for the session in which this event occurred.
Timestamp at which the request was sent (in UTC). May differ from the event timestamp if sending was delayed.
Name of the page that was viewed.
Details about the page that was viewed.
Show child attributes
Show child attributes
Response
The request has succeeded.