cURL
curl --request POST \
--url https://api.unifyintent.com/analytics/v1/page \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--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 = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', '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 => [
"Authorization: Bearer <token>",
"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 := "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("Authorization", "Bearer <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.post("https://api.unifyintent.com/analytics/v1/page")
.header("Authorization", "Bearer <token>")
.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["Authorization"] = 'Bearer <token>'
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_bodyAnalytics API
Page events
Send a “page” event.
POST
/
page
cURL
curl --request POST \
--url https://api.unifyintent.com/analytics/v1/page \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--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 = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', '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 => [
"Authorization: Bearer <token>",
"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 := "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("Authorization", "Bearer <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.post("https://api.unifyintent.com/analytics/v1/page")
.header("Authorization", "Bearer <token>")
.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["Authorization"] = 'Bearer <token>'
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_bodyBody
application/json
A page view event represents a client visiting a page on a website.
The type of analytics event being sent.
Available options:
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 is sent (in UTC).
Typically, this value is nearly identical to timestamp. However in some
situations there is latency between when the event occurs and when it is
sent to Unify.
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.
⌘I