API reference / Analytics
Get the revenue insights
Where and when the revenue of the last 30 days comes from, whatever the period of the query: its filters stay. A site that the script saw for the first time less than 30 days ago starts on that day (days). It gives the devices, systems and browsers that bring the most, and the sources and countries that earn and convert best. It also gives the conversion rates of goals, how buyers got to a payment (their visits and days), revenue per visitor week by week, and revenue by weekday and hour. It compares the numbers with the window before, splits visitors and revenue by each dimension, and counts the visitors who did a goal and who paid. The insights need 200 visitors and 5 payments in those days. Until then, ready is false, and have shows the progress.
/api/v1/analytics/insightsOther ways to call it
troopy analytics insightstroopy_get_analytics_insightsQuery parameters
periodenum<string>now is the last 10 minutes. 7d and 30d end today. 3m, 6m and 12m are whole months that end with this month. week starts on Monday. custom needs from and to
nowtodayyesterday24h7d30d3m6m12mweekmonthyearallcustom
Default "30d"
fromstringYYYY-MM-DD, in the workspace's time zone
date
tostringYYYY-MM-DD. The period includes this day
date
compareenum<string>Also gives another window: previous is the window just before, with the same length. year is the same days a year before. custom is compare_from to compare_to
previousyearcustom
compare_fromstringWith compare custom: the first day of the other window
date
compare_tostringWith compare custom: the last day of the other window
date
filter_channelstringchannel: op:value[,value]. The op is is, is_not, contains, does_not_contain, matches (a regular expression) or does_not_match. No op means is. More values mean any of them. (none) matches an empty value, as for direct traffic
At most 500 characters
filter_referrerstringreferrer: op:value[,value]. The op is is, is_not, contains, does_not_contain, matches (a regular expression) or does_not_match. No op means is. More values mean any of them. (none) matches an empty value, as for direct traffic
At most 500 characters
filter_utm_sourcestringutm source: op:value[,value]. The op is is, is_not, contains, does_not_contain, matches (a regular expression) or does_not_match. No op means is. More values mean any of them. (none) matches an empty value, as for direct traffic
At most 500 characters
filter_utm_mediumstringutm medium: op:value[,value]. The op is is, is_not, contains, does_not_contain, matches (a regular expression) or does_not_match. No op means is. More values mean any of them. (none) matches an empty value, as for direct traffic
At most 500 characters
filter_utm_campaignstringutm campaign: op:value[,value]. The op is is, is_not, contains, does_not_contain, matches (a regular expression) or does_not_match. No op means is. More values mean any of them. (none) matches an empty value, as for direct traffic
At most 500 characters
filter_utm_termstringutm term: op:value[,value]. The op is is, is_not, contains, does_not_contain, matches (a regular expression) or does_not_match. No op means is. More values mean any of them. (none) matches an empty value, as for direct traffic
At most 500 characters
filter_utm_contentstringutm content: op:value[,value]. The op is is, is_not, contains, does_not_contain, matches (a regular expression) or does_not_match. No op means is. More values mean any of them. (none) matches an empty value, as for direct traffic
At most 500 characters
filter_refstringref: op:value[,value]. The op is is, is_not, contains, does_not_contain, matches (a regular expression) or does_not_match. No op means is. More values mean any of them. (none) matches an empty value, as for direct traffic
At most 500 characters
filter_sourcestringsource: op:value[,value]. The op is is, is_not, contains, does_not_contain, matches (a regular expression) or does_not_match. No op means is. More values mean any of them. (none) matches an empty value, as for direct traffic
At most 500 characters
filter_viastringvia: op:value[,value]. The op is is, is_not, contains, does_not_contain, matches (a regular expression) or does_not_match. No op means is. More values mean any of them. (none) matches an empty value, as for direct traffic
At most 500 characters
filter_pagestringpage: op:value[,value]. The op is is, is_not, contains, does_not_contain, matches (a regular expression) or does_not_match. No op means is. More values mean any of them. (none) matches an empty value, as for direct traffic
At most 500 characters
filter_entry_pagestringentry page: op:value[,value]. The op is is, is_not, contains, does_not_contain, matches (a regular expression) or does_not_match. No op means is. More values mean any of them. (none) matches an empty value, as for direct traffic
At most 500 characters
filter_exit_pagestringexit page: op:value[,value]. The op is is, is_not, contains, does_not_contain, matches (a regular expression) or does_not_match. No op means is. More values mean any of them. (none) matches an empty value, as for direct traffic
At most 500 characters
filter_hostnamestringhostname: op:value[,value]. The op is is, is_not, contains, does_not_contain, matches (a regular expression) or does_not_match. No op means is. More values mean any of them. (none) matches an empty value, as for direct traffic
At most 500 characters
filter_countrystringcountry: op:value[,value]. The op is is, is_not, contains, does_not_contain, matches (a regular expression) or does_not_match. No op means is. More values mean any of them. (none) matches an empty value, as for direct traffic
At most 500 characters
filter_regionstringregion: op:value[,value]. The op is is, is_not, contains, does_not_contain, matches (a regular expression) or does_not_match. No op means is. More values mean any of them. (none) matches an empty value, as for direct traffic
At most 500 characters
filter_citystringcity: op:value[,value]. The op is is, is_not, contains, does_not_contain, matches (a regular expression) or does_not_match. No op means is. More values mean any of them. (none) matches an empty value, as for direct traffic
At most 500 characters
filter_languagestringlanguage: op:value[,value]. The op is is, is_not, contains, does_not_contain, matches (a regular expression) or does_not_match. No op means is. More values mean any of them. (none) matches an empty value, as for direct traffic
At most 500 characters
filter_browserstringbrowser: op:value[,value]. The op is is, is_not, contains, does_not_contain, matches (a regular expression) or does_not_match. No op means is. More values mean any of them. (none) matches an empty value, as for direct traffic
At most 500 characters
filter_osstringos: op:value[,value]. The op is is, is_not, contains, does_not_contain, matches (a regular expression) or does_not_match. No op means is. More values mean any of them. (none) matches an empty value, as for direct traffic
At most 500 characters
filter_devicestringdevice: op:value[,value]. The op is is, is_not, contains, does_not_contain, matches (a regular expression) or does_not_match. No op means is. More values mean any of them. (none) matches an empty value, as for direct traffic
At most 500 characters
filter_screenstringscreen: op:value[,value]. The op is is, is_not, contains, does_not_contain, matches (a regular expression) or does_not_match. No op means is. More values mean any of them. (none) matches an empty value, as for direct traffic
At most 500 characters
filter_goalstringgoal: op:value[,value]. The op is is, is_not, contains, does_not_contain, matches (a regular expression) or does_not_match. No op means is. More values mean any of them. (none) matches an empty value, as for direct traffic
At most 500 characters
filter_propertystringVisitors who sent a goal with a property: op:name=value[,name=value], such as is:plan=pro. The op is one of is, is_not, contains, does_not_contain, matches and does_not_match
At most 500 characters
filter_visit_countstringSessions by the visitor's visit number: is:1 (new), gte:2 (returning), lte, is_not
At most 500 characters
Response
200 · application/jsondata*object16 properties
ready*booleanhave*object2 properties
visitors*integerpayments*integerneed*object2 properties
visitors*integerpayments*integerdays*integerThe days that the insights read: 30, or fewer for a newer site
totals*object | null7 properties
visitors*integerrevenue*numberpayments*integerconversionRate*numberrevenuePerVisitor*numberdailyVisitors*integerdailyRevenue*numbershares*array<object>2 properties
dimension*enum<string>devicesosbrowsers
rows*array<object>3 properties
value*string | nullrevenue*numbershare*numberThe share of the period's revenue, 0 to 1
referrers*object2 properties
byRevenue*array<object>7 properties
value*string | nullnull when there is no value, for example no referrer (direct traffic) or an unknown country
visitors*integercount*integerPageviews. For goals, completions. For exit links, clicks
revenue*numberAttributed revenue, in minor units
conversionRate*numberShare of the row's visitors who paid, 0 to 1
timeOnPageinteger | nullPages only: the average time in view of a visitor, in seconds
scrollDepthinteger | nullPages only: how far down a visitor read the page on average, 0 to 100
byConversion*array<object>7 properties
value*string | nullnull when there is no value, for example no referrer (direct traffic) or an unknown country
visitors*integercount*integerPageviews. For goals, completions. For exit links, clicks
revenue*numberAttributed revenue, in minor units
conversionRate*numberShare of the row's visitors who paid, 0 to 1
timeOnPageinteger | nullPages only: the average time in view of a visitor, in seconds
scrollDepthinteger | nullPages only: how far down a visitor read the page on average, 0 to 100
countries*object2 properties
byRevenue*array<object>7 properties
value*string | nullnull when there is no value, for example no referrer (direct traffic) or an unknown country
visitors*integercount*integerPageviews. For goals, completions. For exit links, clicks
revenue*numberAttributed revenue, in minor units
conversionRate*numberShare of the row's visitors who paid, 0 to 1
timeOnPageinteger | nullPages only: the average time in view of a visitor, in seconds
scrollDepthinteger | nullPages only: how far down a visitor read the page on average, 0 to 100
byConversion*array<object>7 properties
value*string | nullnull when there is no value, for example no referrer (direct traffic) or an unknown country
visitors*integercount*integerPageviews. For goals, completions. For exit links, clicks
revenue*numberAttributed revenue, in minor units
conversionRate*numberShare of the row's visitors who paid, 0 to 1
timeOnPageinteger | nullPages only: the average time in view of a visitor, in seconds
scrollDepthinteger | nullPages only: how far down a visitor read the page on average, 0 to 100
goals*array<object>3 properties
name*stringvisitors*integerconversionRate*numberpurchase*object | nullHow buyers got to the payments that tie to them
3 properties
visits*array<integer>Payments by the visits of their buyer up to them: 1 to 9, then 10 or more
days*array<integer>Payments by the days from the first visit of their buyer: each day from 0 to 10, then 11-15, 16-20, 21-30 and over 30
median*number | nullThe median time from the first visit to the payment, in milliseconds
growth*array<object>Revenue per visitor, week by week, over the last 6 months
2 properties
at*stringISO 8601 date and time
value*numberhours*array<object>In the workspace's time zone. Only the hours with revenue
4 properties
day*integer0 is Monday
hour*integerrevenue*numberpayments*integerprevious*object | nullThe same numbers of the window before, as long. A window that is not over compares with the same part of the one before
5 properties
visitors*integerrevenue*numberpayments*integerconversionRate*numberrevenuePerVisitor*numberseries*array<object>The window bucket by bucket: hours for one day, else days
5 properties
at*stringISO 8601 date and time
visitors*integerrevenue*numberrenewals*numberpayments*integersplit*objectThe rows of each dimension that bring the most visitors or revenue, for their share of each
6 properties
channels*object2 properties
rows*array<object>7 properties
value*string | nullnull when there is no value, for example no referrer (direct traffic) or an unknown country
visitors*integercount*integerPageviews. For goals, completions. For exit links, clicks
revenue*numberAttributed revenue, in minor units
conversionRate*numberShare of the row's visitors who paid, 0 to 1
timeOnPageinteger | nullPages only: the average time in view of a visitor, in seconds
scrollDepthinteger | nullPages only: how far down a visitor read the page on average, 0 to 100
revenue*numberThe revenue of every row of the dimension, shown or not
referrers*object2 properties
rows*array<object>7 properties
value*string | nullnull when there is no value, for example no referrer (direct traffic) or an unknown country
visitors*integercount*integerPageviews. For goals, completions. For exit links, clicks
revenue*numberAttributed revenue, in minor units
conversionRate*numberShare of the row's visitors who paid, 0 to 1
timeOnPageinteger | nullPages only: the average time in view of a visitor, in seconds
scrollDepthinteger | nullPages only: how far down a visitor read the page on average, 0 to 100
revenue*numberThe revenue of every row of the dimension, shown or not
countries*object2 properties
rows*array<object>7 properties
value*string | nullnull when there is no value, for example no referrer (direct traffic) or an unknown country
visitors*integercount*integerPageviews. For goals, completions. For exit links, clicks
revenue*numberAttributed revenue, in minor units
conversionRate*numberShare of the row's visitors who paid, 0 to 1
timeOnPageinteger | nullPages only: the average time in view of a visitor, in seconds
scrollDepthinteger | nullPages only: how far down a visitor read the page on average, 0 to 100
revenue*numberThe revenue of every row of the dimension, shown or not
devices*object2 properties
rows*array<object>7 properties
value*string | nullnull when there is no value, for example no referrer (direct traffic) or an unknown country
visitors*integercount*integerPageviews. For goals, completions. For exit links, clicks
revenue*numberAttributed revenue, in minor units
conversionRate*numberShare of the row's visitors who paid, 0 to 1
timeOnPageinteger | nullPages only: the average time in view of a visitor, in seconds
scrollDepthinteger | nullPages only: how far down a visitor read the page on average, 0 to 100
revenue*numberThe revenue of every row of the dimension, shown or not
browsers*object2 properties
rows*array<object>7 properties
value*string | nullnull when there is no value, for example no referrer (direct traffic) or an unknown country
visitors*integercount*integerPageviews. For goals, completions. For exit links, clicks
revenue*numberAttributed revenue, in minor units
conversionRate*numberShare of the row's visitors who paid, 0 to 1
timeOnPageinteger | nullPages only: the average time in view of a visitor, in seconds
scrollDepthinteger | nullPages only: how far down a visitor read the page on average, 0 to 100
revenue*numberThe revenue of every row of the dimension, shown or not
os*object2 properties
rows*array<object>7 properties
value*string | nullnull when there is no value, for example no referrer (direct traffic) or an unknown country
visitors*integercount*integerPageviews. For goals, completions. For exit links, clicks
revenue*numberAttributed revenue, in minor units
conversionRate*numberShare of the row's visitors who paid, 0 to 1
timeOnPageinteger | nullPages only: the average time in view of a visitor, in seconds
scrollDepthinteger | nullPages only: how far down a visitor read the page on average, 0 to 100
revenue*numberThe revenue of every row of the dimension, shown or not
funnel*object | null3 properties
visitors*integerengaged*integerVisitors who did a goal
buyers*integerVisitors who paid