NAV
HTTP

Introduction

Welcome to the Leadpages Analytics API documentation.

This API adheres to the Leadpages HTTP API Standards document.

We suggest starting with the Walkthrough to begin accessing the API.

Walkthrough

A quick way to jump into the Analytics API is to use a tool like cURL to work with the API. This has the additional advantage of forcing you to consider each header and aspect of the request as you're learning it.

These examples use the syntax of the HTTPie tool.

The entire API surface is essentially public as it is intended for use with browser tracking code, so no authentication is used.

Endpoints

/analytics/v1

The analytics API.

Ping

/analytics/v1/ping

A no-op endpoint that can be used to check what the currently-deployed version of the API is.

Request

GET /analytics/v1/ping

Body
Empty

Response

Body
_meta._version String
The current internal version number of the API.
_meta Dictionary
Responses
200 OK
Errors
Empty


Events

/analytics/v1/events

Events are sent from a user agent (usually a browser) and contain information about the event and the environment it occurred in.

Event

/analytics/v1/events/capture

Request

GET /analytics/v1/events/capture

Submit an event using a non-standard GET request.

Body
Empty
Query string
bpid String?
Blog post UUID.
lc String?
Locale of the user agent.
ip Or?[IPv4, IPv6]
varid String?
Split Test Variation ID for the event.
ry String?
Height of user agent viewport (in pixels).
tz String?
Timezone (as UTC offset) of the user agent.
st List?[String]
Serving tags, comma-delimited.
bptid Enum('post', 'feed')
Blog Page Type. Required for blog events. Used to distinguish a blog post from a blog feed.
l String?
Generic event label.
sid String
Session UUID of viewer.
stid String?
Split Test ID for the event.
e Email?
Email address to associate with the viewer.
sku String?
Transaction SKU
bid String?
Blog UUID. Required for blog events.
t DateTime?
Timestamp of when the event occurred. Defaults to the time the server receives the event.
cid String?
Custom ID specified by the center.js user
pid String
Property UUID to correlate event to.
bfid String?
Blog Feed UUID. This value is "home" for the blog feed home, or the ID of the category.
wid String?
Widget GUID.
funid String?
Leadpages Funnel Id.
k String
Kind ("category") of event being tracked.
product_id String?
Transaction Product ID
rf String?
Referrer to the current user agent's location, if available.
uri URI
URI the event occurred on.
v String?
Numeric value associated with the event.
rx String?
Width of user agent viewport (in pixels).
rid String?
Site Route GUID.
funnid String?
Leadpages Funnel Node Id.
ua String?
User agent string.
a String?
Action user took to generate the event (ex. "watch" or "click").
uid String
User (viewer) anonymous UUID.

Response

Body
Empty
Responses
200 OK
Errors
400 Bad Request property '{}' is not enabled
400 Bad Request If specified, conversion value must be a positive number
404 Not Found property '{}' not found.


Observations

/analytics/v1/observations

An Observation encapsulates both metrics (primarily numeric quantities) and general textual log data (as needed) to provide basic tracking code telemetry.

Observationcapture

/analytics/v1/observations/capture

Request

GET /analytics/v1/observations/capture

Submit an observation using a non-standard GET request.

Body
Empty

Response

Body
Empty
Responses
200 OK
Errors
Empty


Properties

/analytics/v1/properties

A property is a grouping of domains, subdomains, and other related web assets that will be tracked together.

Request

GET /analytics/v1/properties

Body
Empty
Query string
cursor String?
A string representing where a previous request "left off".
limit Regexp?(\d+)
The maximum number of items to return in the response.

Response

Body
_items List[Property]
_meta ListingMeta
Meta information about the response.
Responses
200 OK
Errors
400 Bad Request failed to parse JSON request
400 Bad Request bad content type
400 Bad Request missing Content-Type header


Request

POST /analytics/v1/properties

Create a property.

Body
status Enum('enabled', 'disabled')
default Boolean?
Whether or not this property is the user's default property
verified Boolean?
Whether or not the user's property has been verified
name String
A user-defined name for the property
uri URI?
URI of the user's property

Response

Body
status Enum('enabled', 'disabled')
verified Boolean?
Whether or not the user's property has been verified
_meta Meta
Meta information about the resource.
default Boolean
Whether or not this property is the user's default property
uri URI?
URI of the user's property
name String
A user-defined name for the property
Responses
200 OK
Errors
400 Bad Request a default Property already exists
400 Bad Request failed to parse JSON request
400 Bad Request bad content type
400 Bad Request missing Content-Type header


Property

/analytics/v1/properties/{uuid}

Request

GET /analytics/v1/properties/{uuid}

View a Property.

Body
Empty

Response

Body
status Enum('enabled', 'disabled')
verified Boolean?
Whether or not the user's property has been verified
_meta Meta
Meta information about the resource.
default Boolean
Whether or not this property is the user's default property
uri URI?
URI of the user's property
name String
A user-defined name for the property
Responses
200 OK
Errors
404 Not Found unknown message


Request

PATCH /analytics/v1/properties/{uuid}

Update a Property.

Body
Empty

Response

Body
status Enum('enabled', 'disabled')
verified Boolean?
Whether or not the user's property has been verified
_meta Meta
Meta information about the resource.
default Boolean
Whether or not this property is the user's default property
uri URI?
URI of the user's property
name String
A user-defined name for the property
Responses
200 OK
Errors
400 Bad Request unknown message
400 Bad Request JSON decode error
404 Not Found unknown message


Request

DELETE /analytics/v1/properties/{uuid}

Delete (soft) a Property.

Body
Empty

Response

Body
Empty
Responses
200 OK
Errors
400 Bad Request cannot delete default Property
404 Not Found unknown message


Queries

/analytics/v1/queries

Request

POST /analytics/v1/queries

Body
queries List[Query]

Response

Body
results List[QueryResult]
Responses
200 OK
Errors
Empty


Delayedquery

/analytics/v1/queries/{query_id}

Request

GET /analytics/v1/queries/{query_id}

Body
Empty

Response

Body
kind Enum('DelayedTimeSeries', 'TimeSeries')
result Or[DelayedTimeSeries, TimeSeries]
Responses
501 Not Implemented
Errors
Empty


Resets

/analytics/v1/resets

Reset the totals for an asset or a split test.

Request

POST /analytics/v1/resets

Body
resets List[Reset]

Response

Body
results List[ResetResult]
A list of reset results. Results map to reset requests by their index in the list.
Responses
200 OK
Errors
Empty


Conversiongoals

/analytics/v1/conversion-goals

A conversion goal represents the traversal of a directed graph of assets.

Request

GET /analytics/v1/conversion-goals

Enumerate conversion goals.

Body
Empty
Query string
cursor String?
A string representing where a previous request "left off".
limit Regexp?(\d+)
The maximum number of items to return in the response.

Response

Body
_items List[ConversionGoal]
_meta ListingMeta
Meta information about the response.
Responses
200 OK
Errors
Empty


Conversiongoal

/analytics/v1/conversion-goals/{funnel_id}

Request

GET /analytics/v1/conversion-goals/{funnel_id}

View the contents of a conversion goal.

Body
Empty

Response

Body
customIdEdges List[CustomIdEdge]
_meta Meta
Meta information about the resource.
funnelId String
The funnel id as found in fun- analytics events.
Responses
200 OK
Errors
404 Not Found conversion goal '{}' not found


Request

PUT /analytics/v1/conversion-goals/{funnel_id}

Create or update a conversion goal.

Body
customIdEdges List[CustomIdEdge]

Response

Body
customIdEdges List[CustomIdEdge]
_meta Meta
Meta information about the resource.
funnelId String
The funnel id as found in fun- analytics events.
Responses
200 OK
Errors
404 Not Found conversion goal '{}' not found


Request

DELETE /analytics/v1/conversion-goals/{funnel_id}

Delete a conversion goal.

Body
Empty

Response

Body
Empty
Responses
204 No Content
Errors
404 Not Found conversion goal '{}' not found


Reflows

/analytics/v1/reflows

Request

POST /analytics/v1/reflows

Body
leadpageId String
accountUuid String
accountId String

Response

Body
Empty
Responses
200 OK
Errors
Empty


Definitions

Meta

Meta
updated DateTime
When the resource was last updated.
created DateTime
When the resource was created.
id String
The resource's unique identifier.
uri String
The resource's absolute URI.

Property

Property
status Enum('enabled', 'disabled')
verified Boolean?
Whether or not the user's property has been verified
_meta Meta
Meta information about the resource.
default Boolean
Whether or not this property is the user's default property
uri URI?
URI of the user's property
name String
A user-defined name for the property

ListingMeta

ListingMeta
count Integer
The total number of items in the response.
cursor String?
This is used in conjunction with limit to paginate through lists of items.
total Integer?
The number of items in the database.
limit Integer
The requested limit on the number of items.

DelayedTimeSeries

DelayedTimeSeries
status String
timeseries TimeSeries?

TimeSeries?

TimeSeries?
rangeTotal Integer
The total count or value for the requested range.
series ValueDictionary[Integer]
The time series data for the requested range.
since DateTime
The input query's lower time bound.
granularity Enum('hour', 'day', 'month')
The input query's granularity.
total Integer
The lifetime total for this metric, regardless of range.
until DateTime
The input query's upper time bound.

TimeSeries

TimeSeries
since DateTime
The input query's lower time bound.
series ValueDictionary[Integer]
The time series data for the requested range.
rangeTotal Integer
The total count or value for the requested range.
granularity Enum('hour', 'day', 'month')
The input query's granularity.
total Integer
The lifetime total for this metric, regardless of range.
until DateTime
The input query's upper time bound.

Query

Query
query Or[FunnelAssetQuery, SiteQuery, RevenueQuery, GoalConversionQuery, SplitTestQuery, FunnelQuery, AssetQuery, AccountQuery, StepCompletionAssetQuery, BlogQuery, StepCompletionNodeQuery, FunnelSplitTestQuery, GoalAssetConversionQuery, FunnelNodeQuery]
kind Enum('FunnelAssetQuery', 'SiteQuery', 'RevenueQuery', 'GoalConversionQuery', 'SplitTestQuery', 'FunnelQuery', 'AssetQuery', 'AccountQuery', 'StepCompletionAssetQuery', 'BlogQuery', 'StepCompletionNodeQuery', 'FunnelSplitTestQuery', 'GoalAssetConversionQuery', 'FunnelNodeQuery')

FunnelAssetQuery

FunnelAssetQuery
assetId Regexp([a-zA-Z0-9_]+)
The id of the asset you are querying for.
metric Enum('goal_conversions', 'goal_unique_conversions', 'views', 'conversions', 'completions', 'revenue', 'asset_value', 'unique_views', 'unique_conversions', 'unique_completions')
The metric for which to retrieve data.
since DateTime
The lower bound for this query. This gets rounded down according to the granularity and is inclusive.
until DateTime
The upper bound for this query. This gets rounded down according to the granularity and is exclusive.
funnelNodeId Regexp([a-zA-Z0-9_]+)
The id of the funnel node you are querying for.
granularity Enum('hour', 'day', 'month')
funnelId Regexp([a-zA-Z0-9_]+)
The id of the funnel whose data you are querying for.

SiteQuery

SiteQuery
metric Enum('goal_conversions', 'goal_unique_conversions', 'views', 'conversions', 'completions', 'revenue', 'asset_value', 'unique_views', 'unique_conversions', 'unique_completions')
The metric for which to retrieve data.
since DateTime
The lower bound for this query. This gets rounded down according to the granularity and is inclusive.
siteId Regexp([a-zA-Z0-9_]+)
The UUID for the Site whose data to query.
until DateTime
The upper bound for this query. This gets rounded down according to the granularity and is exclusive.
routeId Regexp?([a-zA-Z0-9_]+)
The GUID for the Site Route whose data to query.
granularity Enum('hour', 'day', 'month')
widgetId Regexp?([a-zA-Z0-9_]+)
The GUID for the widget whose data to query.

RevenueQuery

RevenueQuery
assetId Regexp([a-zA-Z0-9_]+)
The ID of the asset you want revenue data for.
skuId Regexp?([a-zA-Z0-9_]+)
SKU ID for SKU specific metrics.
productId Regexp?([a-zA-Z0-9_]+)
ProductId for product specific metrics.
metric Enum('revenue')
The metric for which to retrieve data.
since DateTime
The lower bound for this query. This gets rounded down according to the granularity and is inclusive.
granularity Enum('hour', 'day', 'month')
until DateTime
The upper bound for this query. This gets rounded down according to the granularity and is exclusive.

GoalConversionQuery

GoalConversionQuery
metric Enum('goal_conversions', 'goal_unique_conversions', 'views', 'conversions', 'completions', 'revenue', 'asset_value', 'unique_views', 'unique_conversions', 'unique_completions')
The metric for which to retrieve data.
since DateTime
The lower bound for this query. This gets rounded down according to the granularity and is inclusive.
goalId Regexp([a-zA-Z0-9_]+)
The id of the goal to query for.
until DateTime
The upper bound for this query. This gets rounded down according to the granularity and is exclusive.
granularity Enum('hour', 'day', 'month')

SplitTestQuery

SplitTestQuery
splitTestId Regexp([a-zA-Z0-9_]+)
The id for the splittest whose data to query.
metric Enum('goal_conversions', 'goal_unique_conversions', 'views', 'conversions', 'completions', 'revenue', 'asset_value', 'unique_views', 'unique_conversions', 'unique_completions')
The metric for which to retrieve data.
since DateTime
The lower bound for this query. This gets rounded down according to the granularity and is inclusive.
variationId Regexp?([a-zA-Z0-9_]+)
The variation id for the splittest whose data to query.
granularity Enum('hour', 'day', 'month')
until DateTime
The upper bound for this query. This gets rounded down according to the granularity and is exclusive.

FunnelQuery

FunnelQuery
metric Enum('goal_conversions', 'goal_unique_conversions', 'views', 'conversions', 'completions', 'revenue', 'asset_value', 'unique_views', 'unique_conversions', 'unique_completions')
The metric for which to retrieve data.
since DateTime
The lower bound for this query. This gets rounded down according to the granularity and is inclusive.
until DateTime
The upper bound for this query. This gets rounded down according to the granularity and is exclusive.
granularity Enum('hour', 'day', 'month')
funnelId Regexp([a-zA-Z0-9_]+)
The id of the funnel whose data you are querying for.

AssetQuery

AssetQuery
assetId Regexp([a-zA-Z0-9_]+)
The id of the asset whose data to query. This should be the same as the id that is passed in to `customId` when using the tracking code, minus the `lp-` prefix.
metric Enum('goal_conversions', 'goal_unique_conversions', 'views', 'conversions', 'completions', 'revenue', 'asset_value', 'unique_views', 'unique_conversions', 'unique_completions')
The metric for which to retrieve data.
since DateTime
The lower bound for this query. This gets rounded down according to the granularity and is inclusive.
until DateTime
The upper bound for this query. This gets rounded down according to the granularity and is exclusive.
granularity Enum('hour', 'day', 'month')

AccountQuery

AccountQuery
metric Enum('goal_conversions', 'goal_unique_conversions', 'views', 'conversions', 'completions', 'revenue', 'asset_value', 'unique_views', 'unique_conversions', 'unique_completions')
The metric for which to retrieve data.
since DateTime
The lower bound for this query. This gets rounded down according to the granularity and is inclusive.
until DateTime
The upper bound for this query. This gets rounded down according to the granularity and is exclusive.
granularity Enum('hour', 'day', 'month')

StepCompletionAssetQuery

StepCompletionAssetQuery
metric Enum('goal_conversions', 'goal_unique_conversions', 'views', 'conversions', 'completions', 'revenue', 'asset_value', 'unique_views', 'unique_conversions', 'unique_completions')
The metric for which to retrieve data.
since DateTime
The lower bound for this query. This gets rounded down according to the granularity and is inclusive.
parentAssetId Regexp([a-zA-Z0-9_]+)
The asset id of the parent (upstream) step in the goal.
goalId Regexp([a-zA-Z0-9_]+)
The id of the goal to query for.
childNodeId Regexp?([a-zA-Z0-9_]+)
The node id of the child step in the goal.
granularity Enum('hour', 'day', 'month')
until DateTime
The upper bound for this query. This gets rounded down according to the granularity and is exclusive.

BlogQuery

BlogQuery
blogId Regexp([a-zA-Z0-9_]+)
The UUID for the Blog whose data to query.
blogPostId Regexp?([a-zA-Z0-9_]+)
The GUID for the Blog post whose data to query.
metric Enum('goal_conversions', 'goal_unique_conversions', 'views', 'conversions', 'completions', 'revenue', 'asset_value', 'unique_views', 'unique_conversions', 'unique_completions')
The metric for which to retrieve data.
since DateTime
The lower bound for this query. This gets rounded down according to the granularity and is inclusive.
blogPageType Regexp?([a-zA-Z0-9_]+)
The type of blog page we are querying on.
granularity Enum('hour', 'day', 'month')
blogFeedId Regexp?([a-zA-Z0-9_]+)
The GUID for the Blog feed whose data to query. This is value is "home" for the main blog page.
until DateTime
The upper bound for this query. This gets rounded down according to the granularity and is exclusive.

StepCompletionNodeQuery

StepCompletionNodeQuery
metric Enum('goal_conversions', 'goal_unique_conversions', 'views', 'conversions', 'completions', 'revenue', 'asset_value', 'unique_views', 'unique_conversions', 'unique_completions')
The metric for which to retrieve data.
since DateTime
The lower bound for this query. This gets rounded down according to the granularity and is inclusive.
goalId Regexp([a-zA-Z0-9_]+)
The id of the goal to query for.
childNodeId Regexp?([a-zA-Z0-9_]+)
The node id of the child step in the goal.
granularity Enum('hour', 'day', 'month')
until DateTime
The upper bound for this query. This gets rounded down according to the granularity and is exclusive.
parentNodeId Regexp([a-zA-Z0-9_]+)
The node id of the parent (upstream) step in the goal.

FunnelSplitTestQuery

FunnelSplitTestQuery
splitTestId Regexp([a-zA-Z0-9_]+)
The id for the splittest whose data to query.
metric Enum('goal_conversions', 'goal_unique_conversions', 'views', 'conversions', 'completions', 'revenue', 'asset_value', 'unique_views', 'unique_conversions', 'unique_completions')
The metric for which to retrieve data.
since DateTime
The lower bound for this query. This gets rounded down according to the granularity and is inclusive.
variationId Regexp?([a-zA-Z0-9_]+)
The variation id for the splittest whose data to query.
until DateTime
The upper bound for this query. This gets rounded down according to the granularity and is exclusive.
funnelNodeId Regexp([a-zA-Z0-9_]+)
The id of the funnel node you are querying for.
granularity Enum('hour', 'day', 'month')
funnelId Regexp([a-zA-Z0-9_]+)
The id of the funnel whose data you are querying for.

GoalAssetConversionQuery

GoalAssetConversionQuery
assetId Regexp([a-zA-Z0-9_]+)
The asset id of the entry point for the goal.
metric Enum('goal_conversions', 'goal_unique_conversions', 'views', 'conversions', 'completions', 'revenue', 'asset_value', 'unique_views', 'unique_conversions', 'unique_completions')
The metric for which to retrieve data.
since DateTime
The lower bound for this query. This gets rounded down according to the granularity and is inclusive.
goalId Regexp([a-zA-Z0-9_]+)
The id of the goal to query for.
granularity Enum('hour', 'day', 'month')
until DateTime
The upper bound for this query. This gets rounded down according to the granularity and is exclusive.

FunnelNodeQuery

FunnelNodeQuery
metric Enum('goal_conversions', 'goal_unique_conversions', 'views', 'conversions', 'completions', 'revenue', 'asset_value', 'unique_views', 'unique_conversions', 'unique_completions')
The metric for which to retrieve data.
since DateTime
The lower bound for this query. This gets rounded down according to the granularity and is inclusive.
funnelId Regexp([a-zA-Z0-9_]+)
The id of the funnel whose data you are querying for.
funnelNodeId Regexp([a-zA-Z0-9_]+)
The id of the funnel node you are querying for.
granularity Enum('hour', 'day', 'month')
until DateTime
The upper bound for this query. This gets rounded down according to the granularity and is exclusive.

QueryResult

QueryResult
kind Enum('DelayedTimeSeries', 'TimeSeries')
result Or[DelayedTimeSeries, TimeSeries]

Reset

Reset
reset Or[SplitTestReset, AssetReset]
kind Enum('SplitTestReset', 'AssetReset')

SplitTestReset

SplitTestReset
splitTestId Regexp([a-zA-Z0-9_]+)
The id for the splittest whose totals to reset.
variationId Regexp?([a-zA-Z0-9_]+)
The variation id for the splittest whose totals to reset.

AssetReset

AssetReset
assetId Regexp([a-zA-Z0-9_]+)
The id of the asset whose totals to reset. This should be the same as the id that is passed in to `customId` when using the tracking code, minus the `lp-` prefix.

ResetResult

ResetResult
succeeded Boolean
Whether or not this reset succeeded.

CustomIdEdge

CustomIdEdge
sourceCustomId String
Source (beginning) custom_id for this edge.
targetCustomId String
Target (end) custom_id for this edge.

ConversionGoal

ConversionGoal
_meta Meta
Meta information about the resource.
funnelId String
The funnel id as found in fun- analytics events.
customIdEdges List[CustomIdEdge]