You can use the following operations to fetch statistics about funnels and segments.

This article contains:

Funnels

GET /audiences/:audienceId/funnels/:funnelId/statistics

Get the population statistics of a funnel and its funnel stages

Fetch the population history of a funnel. The history is returned per day and those days are calculated in the timezone of the audience.

HTTP Verb

Resource

Description

GET

/audiences/:audienceId/funnels/:funnelId/statistics

Get the population statistics of a funnel and its funnel stages

Parameters

Path Parameters 

Parameter Name

Required

Type

Description

audienceId

Yes

string

Long (int64)Audience ID of the funnel

funnelId

Yes

string

Long (int64)ID of funnel to return

Query Parameters

Name

Required

Type

Description

from

No

string

from date

to

No

string

to date (inclusive)

limit

No

integer

Long (int64)number of days to fetch funnel statistics

Sample Request

curl -X GET \ -H "Authorization: [[apiKey]]" \
	-H "Accept: application/json" \ 
	"https://api-cdp.treasuredata.com/audiences/{audienceId}/funnels/{funnelId}/statistics?from=&to=&limit="

Responses

Status: 200 - OK

An array of tuple of statistics.

Sample Response
{population: integer (int64)the latest population of the funnelstages:[ {id: integer (int64)funnel stage idhistory:[[a tuple whose values are Unix epoch, the population, whether a workflow has run at that time or notundefinedone of:integer (int64)boolean]example: 1556382847,1234,true]}]} example: [object Object]

  

Status: 400 - Bad Request

Given parameters are not valid

Sample Response
{Required: code,messagecode:stringmessage:string}


Status: 401 - Unauthorized

You don't provide valid credentials. Maybe you didn't specify valid TD's Master API Key as 'TD1 {Your TD Master API Key}'.

Sample Response
{Required: code,messagecode:stringmessage:string}


Status: 403 - Forbidden

Requested resource or action is not allowed because you don't have sufficient permissions.

Sample Response
{Required: code,messagecode:stringmessage:string}


Status: 404 - Not Found

The specified resource was not found.

Sample Response
{Required: code,messagecode:stringmessage:string}


Status: 400 <Authentication, Login Error>

There is a high possibility of error in the authentication system. Please check the contents and authority of the key. Please contact the TD support team if you do not resolve it.

Sample Response
{Required: code,messagecode:stringmessage:string}


Status: 5XX - Internal Server Error

Because there is a possibility of a temporary error due to network trouble and so on, we recommend several times retry on the request side. Please contact the TD support team if you do not resolve it.

Sample Response
{Required: code,messagecode:stringmessage:string}


Segments

GET /audiences/:audienceId/segments/:segmentId/statistics

Get the population statistics of the segment

Fetch the population history of the segment. The history is returned per day and those days are calculated in the timezone of the audience.


HTTP Verb

Resource

Description

GET

/audiences/:audienceId/segments/:segmentId/statistics

Get the population statistics of the segment

Parameters

Path parameters

Name

Required

Type

Description

audienceId

Yes

string

Long (int64)Audience ID of the segment

segmentId

Yes

string

Long (int64)ID of Segment to return

Query parameters

Name

Required

Type

Description

from

No

string

from date

to

No

string

to date (inclusive)

Sample Request



curl -X GET \ -H "Authorization: [[apiKey]]" \
	-H "Accept: application/json" \ 
 	"https://api-cdp.treasuredata.com/audiences/{audienceId}/segments/{segmentId}/statistics?from=&to="


Responses

Status: 200 - OK

An array of tuple of statistics.

Sample Response
[[a tuple whose values are Unix epoch, the population, whether a workflow has run at that time or notundefinedone of:integer (int64)boolean]example: 1556382847,1234,true]


Status: 400 - Bad Request

Given parameters are not valid.

Sample Response
{Required: code,messagecode:stringmessage:string}


Status: 401 - Unauthorized

You don't provide valid credentials. Maybe you didn't specify valid TD's Master API Key as 'TD1 {Your TD Master API Key}'.

Sample Response
{Required: code,messagecode:stringmessage:string}


Status: 403 - Forbidden

Requested resource or action is not allowed because you don't have sufficient permissions.

Sample Response
{Required: code,messagecode:stringmessage:string}


Status: 404 - Not Found

The specified resource was not found.

Sample Response
{Required: code,messagecode:stringmessage:string}


Status: 4XX -

There is a high possibility of error in the authentication system. Please check the contents and authority of the key. Please contact the TD support team if you do not resolve it.

Sample Response
 {Required: code,messagecode:stringmessage:string}


Status: 5XX - Internal Server Error

System error. Because there is a possibility of a temporary error due to network trouble and so on, we recommend several times retry on the request side. Please contact the TD support team if you do not resolve it.

Sample Response
{Required: code,messagecode:stringmessage:string}



  • No labels