Summary
The performance endpoint allows you to access raw and aggregate data for performance data and business data captured by Blue Triangle. Performance data can be broken down by minute, hour, or day. Business data can be broken down into revenue, orders, page hits, and visitors. Data from this API can be grouped in multiple ways, such as country, region, and/or page name.
Contents
- Endpoint URL
- Basic Example
- Required Parameters
- Optional Parameters
- "Group By" Options
- Data Column Options
- Using Custom Variables
- More Examples
- Synthetic Agent Location Codes Reference
Endpoint URL
https://api.bluetriangletech.com/performance
Basic Example
Request
curl -X POST "https://api.bluetriangletech.com/performance" \
-H "X-API-Email: email@company.com" \
-H "X-API-Key: 2831ac6dffec75a48fe712345e000481" \
-H "Content-Type: application/json" \
--data '{"site":"demo","start":"1477972800","end":"1479877200","limit":100,"page":1,"dataColumns":["onload","dns","tcp"],"group":["time"]}'
Response
{
"site": "demo",
"status": 1,
"totalItems": 13,
"data": [
{
"time": "1477994400000",
"onload": "9416",
"dns": "16",
"tcp": "10"
},
{...},
{
"time": "1477998000000",
"onload": "8040",
"dns": "18",
"tcp": "12"
}
]
}
/performance Required Parameters
Key | Type | Description | Value/Constraints |
---|---|---|---|
site | string | Site the data is being pulled from. Uses the unique ID associated with your tag. | None |
start | integer | Start time of the data in epoch time. | epoch (seconds) |
end | integer | End time of the data in epoch time. | epoch (seconds) |
group | array | Group the data. If grouping by time, bucketSize and bucketValue will be available. |
Limited to 3 columns. |
dataColumns | array | Performance data columns to be retrieved. All timings are returned in milliseconds. | Data Column available parameters |
dataType | string | If data returned should be for native app, RUM or synthetic. Defaults to “rum”. "basepage" dataType returns data for both base page measurements and the advanced synthetic scripts. |
|
/performance Optional Parameters
Arithmetic and Data Formatting
Key | Type | Description | Value |
avgType | string | The statistical method used for calculations. |
|
percentile | integer | The value used to determine the percentile distribution. Only available when using the avgType of percentile. |
|
bucketSize | string | Whether to group the data by minute, hour, or day. Only available if grouping by ‘time’. Minute bucket is available for time periods less than 6 hours. Hour bucket is available for less than 14 days. Day bucket is available for greater than 2 days. |
|
bucketValue | string or integer | Determines the size of the bucket size. For example, if “bucketSize” is set to minute and “bucketValue is set to 15, the data will return in 15 minute increments. |
|
Data Filtering
Key | Type | Description | Value | Constraints |
urlSearch | string | Filters data based on a URL substring. Wildcards (*) may be used. Exact match is assumed unless wildcard(s) specified. | Limited to 7 days | |
pageName | array | Filters data by page name. | ||
pageGroup | array | Filters data by page group. | ||
trafficSeg | array | Filters data by traffic segment. | ||
browser | array | Filters data by browser. | ||
device | array | Filters data by device. | ||
os | array | Filters data by operating system. | ||
country | array | Filters data by country. | ISO 3166 format | |
region | array | Filters data by region. http://www.maxmind.com/download/geoip/misc/region_codes.csv | ISO 3166 format with region ID numbers | |
netspeed | array | Filters data by netspeed. |
|
|
campaignSource | array | Filters data by traffic source. | ||
campaignName | array | Filters data by the campaign name. | ||
campaignMedium | array | Filters data by traffic medium. | ||
abSegment | array | Filters data by an A/B segment. | ||
datacenter | array | Filters data by data center. | ||
isp | array | Filters data by Internet Service Provider (ISP). | ||
botTraffic | array | Filters data by different types of bot traffic. Bots are excluded by default. |
|
|
visitorType | array | Filters data by return visitors or new visitors. Defaults to include both. |
|
|
resourceOnly | string | Only shows data for sessions that captured resource data. Defaults to "no". If set to "yes", the data returned may be sampled. |
|
|
salesType | string | Whether to use standard sales or brand value. Defaults to sales. |
|
only relevant for revenue and orders columns |
agentLocation | string or array | Returns the location code of the synthetic agent. Only available for dataType of "synthetic". | Current list of agent codes. | |
notAllPages | boolean | If 1 then remove "All Pages" when grouping by page name. | 0 or 1 | Only to be used when grouping by page name. |
removeGetParams | boolean | Removes the query parameters from the URL. | true/false | This option is only available when grouping by url. |
excluded | array | The data beacon type. Standard, email and custom. The array should contain either 0, 4, 20, or a combination of the 3. |
0 = Standard page data 4 = Email beacon 20 = Custom data beacon |
|
customCategory(1-5) | array | Configurable category for data collection use. See Using Custom Variables. |
|
Needs to be configured in Custom Variables page |
customVariable(1-5; 11-15) | array | Configurable variable for data collection use. See Using Custom Variables. |
|
Needs to be configured in Custom Variables page |
sessionID | array | RUM or Synthetic session ID. | Must be a valid session ID. |
Response Formatting
Key | Type | Description | Value/Constraints |
limit | integer | Limits the number of rows returned. | Max of 50,000 rows. |
page | integer | Which page currently being viewed if the rows of data pass the limit. | |
order | string or array | Orders the data by column. If used as an array, the "sort” parameter must be in the same order as the “order”. For example: “order”:[“device”,pageHits”], “sort”:[“asc”,”desc”] In the above example, device will be in ascending order and pageHits will be in descending order. |
|
sort | string or array | Indicates whether the data is sorted by ascending or descending. |
|
returnPageNames | boolean | Must be used in conjunction with the URL search to determine whether response returns page names or the URL substring | |
timezoneOffset | float |
Group By Options
Group Options | Description | Configuration Required? |
---|---|---|
time | Time Period | No |
pageName | Page Name | Yes |
pageGroup | Page Group | Yes |
trafficSeg | Traffic Segment | Yes |
country | Country | No |
region | Region | No |
agentLocation | Agent Location (only available for synthetic dataType) | No |
browser | Browser | No |
os | Operating System | No |
device | Device | No |
browserVersion | Browser and version | No |
netspeed | Speed of the network connection | No |
visitorType | Return vs New Visitor | No |
httpCode | HTTP Code (only available for synthetic dataType) | No |
campaignSource | Traffic/Campaign Source | No |
campaignMedium | Traffic/Campaign Medium | No |
campaignName | Campaign Name | Yes |
isp | Internet Service Provider | No |
abSegment | A/B Segment | Yes |
datacenter | Data Center | Yes |
url | URL (limited to 7 days of data, or top 1000 results by page views) | No |
customCategory(1-5) | Must use display name found in Site Configuration. See Using Custom Variables. | Yes |
customVariable | Must use display name found in Site Configuration. See Using Custom Variables. | Yes |
Data Column Options
Below are the available dataColumn options for each of the dataType options (native, rum, synthetic, basepage).
Data Column Name | native | rum | synthetic | basepage | Description | Values/Constraints |
jsErrorCount | yes | yes | JS Errors (Sampled) - The number of JavaScript errors that occurred on sampled pages (not all pages). | |||
visitors | yes | yes | Total visitors (sessions) | |||
revenue | yes | yes | Revenue amount | |||
orders | yes | yes | Total orders | |||
onload | yes | yes | yes | Onload time (milliseconds) | ||
dns | yes | yes | yes | yes |
DNS time (milliseconds) |
|
tcp | yes | yes | yes | TCP connect time (milliseconds) | ||
basePage | yes | yes | yes | Base Page time (milliseconds) | ||
dom | yes | yes | yes | DOM Duration, formerly DOM Complete (milliseconds) | ||
ttDomInt | yes | yes | yes | Time to DOM Interactive (milliseconds) | ||
ttDomCont | yes | yes | yes | Time to DOM Content Loaded (milliseconds) | ||
firstByte | yes | yes | yes | Time to First Byte (milliseconds) | ||
ssl | yes | yes | yes | SSL time (milliseconds) | ||
redirect | yes | yes | yes | redirect time (milliseconds) | ||
timeToInteractive | yes | yes | yes |
Time to Interactive (milliseconds) This must be enabled for your site. If it is not enabled, it will return zero. |
|
|
fullyLoadedTimeHits | yes | yes |
Fully Loaded Time Hits |
|
||
fullyLoadedTime |
yes | yes |
Fully Loaded Time |
|
||
firstContentfulPaint | yes | yes | yes | First Contentful Paint time (milliseconds) | ||
largestContentfulPaint | yes | yes | yes | Largest Contentful Paint (LCP) (milliseconds) | ||
totalBlockingTime | yes | yes | yes | Total Blocking Time (milliseconds) | ||
cumulativeLayoutShift | yes | yes | yes | Cumulative Layout Shift (CLS) (score) | ||
firstInputDelayDuration | yes | yes | First Input Delay (FID) (milliseconds) | Reach out to your BT representative to find out if your site has been flipped to INP | ||
intToNextPaint | yes | yes | Interaction to Next Paint (milliseconds) | Reach out to your BT representative to find out if your site has been flipped to INP | ||
speedIndex | yes | Speed Index (score) | ||||
pageHits | yes | yes | yes | yes | Total number of page views | |
firstPaint | yes | First paint time (milliseconds) | ||||
pageWireSize | yes | Average total encoded size for all resources captured on a page view (bytes) | ||||
pageSize | yes | Average total unencoded size for all resources captured on a page view (bytes) | ||||
elementCount | yes | Total number of resources captured on a page view | ||||
imageBytes | yes | Average total encoded image size for all images captured on a page view (bytes) | ||||
imageBytesWire | yes | Average total unencoded image size for all images captured on a page view (bytes) | ||||
domainCount | yes | Total number of unique domains captured on a page view | ||||
200_code | yes | yes | Number of measurements with a 200-level HTTP code | |||
300_code | yes | yes | Number of measurements with a 300-level HTTP code | |||
400_code | yes | yes | Number of measurements with a 400-level HTTP code | |||
500_code | yes | yes | Number of measurements with a 500-level HTTP code | |||
600_code | yes | yes | Number of measurements with a 600-level HTTP code | |||
scriptError | yes | Number of measurements with a custom error code. Current list of custom codes. | ||||
errorText | yes | yes | Number of measurements with a 602 HTTP code (Error Text Found) | |||
missingText | yes | yes | Number of measurements with a 601 HTTP code (Verify Text Error) | |||
connectTime | yes | Connect time (milliseconds) | ||||
appConnect | yes | App Connect time (milliseconds) | ||||
preTransfer | yes | Pre Transfer time (milliseconds) | ||||
startTransfer | yes | Start Transfer time (milliseconds) | ||||
redirectTime | yes | Redirect time (milliseconds) | ||||
totalBasePage | yes | Total Base Page time (milliseconds) | ||||
sslExpireDate | yes | Date of SSL Expiration | ||||
sslSuccesses | yes | SSL Successes count | ||||
ttiHits | yes | yes | Time to Interactive hits | |||
fcpHits | yes | yes |
First Contentful Paint time hits |
|||
speedindexHits | yes | Speed Index hits | ||||
lcpHits | yes | yes | Largest Contentful Paint hits | |||
tbtHits | yes | yes | Total Blocking Time hits | |||
clsHits | yes | yes | Cumulative Layout Shift hits | |||
fidHits | yes | First Input Delay hits |
VitalScope Data Column Options
Please see our VitalScope Documentation for definitions, disclaimers, and additional information regarding VitalScope Metrics and Attribution Data.
LCP Metrics
Data Column Name | native | rum | synthetic | basepage | Description |
LCPElementRenderDelayMS | yes | LCPElementRenderDelay (ms) | |||
LCPElementRenderDelayPercentage | yes | LCPElementRenderDelay (%) | |||
LCPTimeToFirstByteMS | yes | LCPTimeToFirstByte (ms) | |||
LCPTimeToFirstBytePercentage | yes | LCPTimeToFirstByte (%) | |||
LCPResourceDelayMS | yes | LCPResourceLoadDelay (ms) | |||
LCPResourceLoadDelayPercentage | yes | LCPResourceLoadDelay (%) | |||
LCPResourceLoadTimeMS | yes | LCPResourceLoadTime (ms) | |||
LCPResourceLoadTimePercentage | yes | LCPResourceLoadTime (%) |
LCP Attribution Data
Data Column Name | native | rum | synthetic | basepage | Description |
LCPSelector | yes | LCP Selector | |||
LCPURL | yes | LCP URL |
CLS Metrics
Data Column Name | native | rum | synthetic | basepage | Description |
CLSLargestShiftStart | yes | CLSLargestShiftStart (ms) | |||
CLSLayoutShiftCount | yes | CLSLayoutShiftCount |
CLS Attribution Data
Data Column Name | native | rum | synthetic | basepage | Description |
CLSLargestShiftSelector | yes | CLSLargestShiftSelector |
INP Metrics
Data Column Name | native | rum | synthetic | basepage | Description |
INPStart | yes | INPStart (ms) | |||
INPInputDelay | yes | INP Input Delay (ms) | |||
INPNextPaintTime | yes | INP Next Paint Time (ms) | |||
INPProcessingDuration | yes | INP Processing Duration (ms) | |||
INPPresentationDelay | yes | INP Presentation Delay (ms) |
INP Attribution Data
Data Column Name | native | rum | synthetic | basepage | Description |
INPTargetSelector | yes | INPTargetSelector | |||
INPEventType | yes | INP Event Type | |||
INPTarget | yes | INPTarget |
LoAF Metrics
Data Column Name | native | rum | synthetic | basepage | Description |
LOAFLongestScriptDuration | yes | LoAF Longest Script Duration (ms) | |||
LOAFLongestScriptStart | yes | LoAF Longest Script Start (ms) |
LoAF Attribution Data
Data Column Name | native | rum | synthetic | basepage | Description |
LOAFLongestScriptInvoker | yes | LOAFLongestScriptInvoker | |||
LOAFLongestScriptSourceURL | yes | LOAFLongestScriptSourceURL |
Using Custom Numbers, Variables, and Categories
Portal | API |
Custom Category 1-10 | customCategory1-5 |
To query for a custom variable or a custom number, include the Display Name as it was configured in the Custom Variable page as a data column.
/performance Example Requests
Bucket Size Example
Request:curl -X POST "https://api.bluetriangletech.com/performance" \
-H "X-API-Email: email@company.com" \
-H "X-API-Key: 2831ac6dffec75a48fe712345e000481" \
-H "Content-Type: application/json" \
--data '{"site":"demo","start":"1494392400","end":"1494824400","limit":100,"page":1,"dataColumns":["onload","dns","tcp"],"group":["time"],"bucketSize":"day"}
Response:
{
"requestsAllowed": 10000,
"requestsMade": 598,
"site": "demo",
"status": 1,
"totalItems": 5,
"data": [
{
"time": "1494561600",
"onload": "8979",
"dns": "14",
"tcp": "39"
},
{
"time": "1494820800",
"onload": "9020",
"dns": "16",
"tcp": "41"
},
{
"time": "1494734400",
"onload": "9954",
"dns": "15",
"tcp": "39"
},
{
"time": "1494475200",
"onload": "8957",
"dns": "13",
"tcp": "33"
},
{
"time": "1494648000",
"onload": "9878",
"dns": "16",
"tcp": "40"
}
]
}
Example with Multiple Groupings
Request:
curl -X POST "https://api.bluetriangletech.com/performance" \
-H "X-API-Email: email@company.com" \
-H "X-API-Key: 2831ac6dffec75a48fe712345e000481" \
-H "Content-Type: application/json" \
--data '{"site":"demo","start":"1494392400","end":"1494824400","limit":10,"page":1,"dataColumns":["onload","dns","tcp"],"group":["time","country","region"]}'
Response:
{
"requestsAllowed": 10000,
"requestsMade": 600,
"site": "demo",
"status": 1,
"totalItems": 10,
"data": [
{
"time": "1494680400",
"country": "CA",
"region": "MB",
"onload": "5955",
"dns": "2",
"tcp": "30",
"pageHits": "24"
},
{
"time": "1494680400",
"country": "CA",
"region": "QC",
"onload": "8913",
"dns": "20",
"tcp": "79",
"pageHits": "126"
},
{
"time": "1494680400",
"country": "IN",
"region": "DL",
"onload": "10153",
"dns": "0",
"tcp": "0",
"pageHits": "4"
},
{
"time": "1494680400",
"country": "US",
"region": "MO",
"onload": "8447",
"dns": "13",
"tcp": "33",
"pageHits": "3853"
},
{
"time": "1494666000",
"country": "CA",
"region": "BC",
"onload": "15277",
"dns": "12",
"tcp": "23",
"pageHits": "6"
},
{
"time": "1494666000",
"country": "AU",
"region": "WA",
"onload": "20486",
"dns": "0",
"tcp": "354",
"pageHits": "1"
},
{
"time": "1494666000",
"country": "IN",
"region": "TN",
"onload": "12488",
"dns": "0",
"tcp": "0",
"pageHits": "1"
},
{
"time": "1494666000",
"country": "US",
"region": "AR",
"onload": "10252",
"dns": "52",
"tcp": "65",
"pageHits": "177"
},
{
"time": "1494666000",
"country": "US",
"region": "NV",
"onload": "12096",
"dns": "1",
"tcp": "38",
"pageHits": "291"
},
{
"time": "1494669600",
"country": "CA",
"region": "BC",
"onload": "10067",
"dns": "0",
"tcp": "0",
"pageHits": "6"
}
]
}
Business Data Example
Request:
curl -X POST "https://api.bluetriangletech.com/performance" \
-H "X-API-Email: email@company.com" \
-H "X-API-Key: 2831ac6dffec75a48fe712345e000481" \
-H "Content-Type: application/json" \
--data '{"site":"demo","start":"1494392400","end":"1494824400","limit":10,"page":1,"dataColumns":["revenue","orders","pageHits","visitors"],"group":["time"]}'
Response:
{
"requestsAllowed": 10000,
"requestsMade": 2,
"site": "demo",
"status": 1,
"totalItems": 10,
"data": [
{
"time": "1494788400",
"revenue": "3065",
"orders": "34",
"pageHits": "11185",
"visitors": "2107"
},
{
"time": "1494802800",
"revenue": "4728",
"orders": "38",
"pageHits": "10601",
"visitors": "1935"
},
{
"time": "1494716400",
"revenue": "2941",
"orders": "27",
"pageHits": "8052",
"visitors": "1513"
},
{
"time": "1494741600",
"revenue": "924",
"orders": "9",
"pageHits": "4555",
"visitors": "927"
},
{
"time": "1494396000",
"revenue": "2008",
"orders": "13",
"pageHits": "4167",
"visitors": "858"
},
{
"time": "1494406800",
"revenue": "175",
"orders": "2",
"pageHits": "3424",
"visitors": "831"
},
{
"time": "1494493200",
"revenue": "410",
"orders": "4",
"pageHits": "3194",
"visitors": "793"
},
{
"time": "1494489600",
"revenue": "564",
"orders": "7",
"pageHits": "3269",
"visitors": "786"
},
{
"time": "1494576000",
"revenue": "56",
"orders": "2",
"pageHits": "3125",
"visitors": "723"
},
{
"time": "1494583200",
"revenue": "882",
"orders": "4",
"pageHits": "3497",
"visitors": "833"
}
]
}
Synthetic Agent Location Codes
Agent Location | City, Region | Country |
SYDAWS | Syndney, NSW | Australia |
GRUGCP | Sao Paulo, SP | Brazil |
YULINP | Montreal, QC (Internap) | Canada |
YULGCP | Montreal, QC (GCP) | Canada |
FRAAWS | Frankfurt, HE | Germany |
LHRRCK | London, ENG (Rackspace) | Great Britain |
LHRAWS | London, ENG (AWS) | Great Britain |
BOMGCP | Mumbai, MH | India |
HNDGCP | Tokyo, TYO | Japan |
MEXISL | Mexico City | Mexico |
EEMGRQ | Eemshaven, GR | Netherlands |
SINGCP | Singapore, SG | Singapore |
SEAISL | Seattle, WA | United States of America |
IADAWS | Washington, DC | United States of America |
ORDRCK | Chicago, IL | United States of America |
DFWINP | Dallas, TX | United States of America |
LGAINP | New York, NY | United States of America |
SFOAWS | San Francisco, CA | United States of America |
LAXGCP | Los Angeles, CA (GCP) | United States of America |
Comments
0 comments
Please sign in to leave a comment.