Upsight logo Back to top

User Sessions

Count


session/count

URL

http://query.kontagent.net/processed/v1/social/session/count/<DATA TYPE>.<DATA FORMAT>/?api_key=<API KEY>&<PARAMETER>=<VALUE>

Data Output Types

ParameterValuesDescription
data_typeseriesThe output data type.
data_format
  • json
The format of the output data.

Required Parameters

ParameterValuesDescription
api_keyYour Upsight Analytics API key.
end_timeYYYYmmdd_HHMMThe end time element (day, week, month) in the time range being queried in the YYYYmmdd_HHMM format.
start_timeYYYYmmdd_HHMMThe start time element (day, week, month) in the time range being queried in the YYYYmmdd_HHMM format.
time_segment
  • week
  • hour
  • month
  • day
The frequency of data reporting. For example, a time segment by day will return the data on a daily basis between the start and end times specified. A time segment by hour will return the data on an hourly basis between the start and end times specified.

Optional Parameters

ParameterValuesDescription
age
  • unknown
  • 0-12
  • 13-17
  • 18-24
  • 25-29
  • 30-34
  • 35-39
  • 40-49
  • 50-64
  • 65+

The age group the user falls into.

countryPlease see the ISO-3166-1 alpha-2 list.

The country code of the country in which the user is located. The country code must be in upper case format and conform to the ISO-3166-1 alpha-2 standard. If not sent, it will be based on the user's IP.

Note! The Facebook locales ar_AR and es_LA do not follow the ISO standard. Facebook uses them to denote umbrella locales for Arabic and Spanish speaking regions. If you send the last two characters of these locales to Upsight Analytics, they will map to Argentina and Laos. As a best practice, if you see these locales, do not pass the country code. For additional information on Facebook locales, click here.

friends
  • unknown
  • 0-10
  • 11-20
  • 21-40
  • 41-60
  • 61-80
  • 81-125
  • 126-250
  • 250+
The number of friends a user has. Defined by a friend range.
gender
  • female
  • male
  • unknown
The user gender.
group_by
  • location:country
  • location:country_abbreviation
  • location:continent
  • location:continent_abbreviation
  • demographic:gender
  • demographic:gender_abbreviation
  • demographic:age_range
The location or demographic group.
durationThis parameter can only be used if data_type = list is selected.

Code Example

Query URL:

http://query.kontagent.net/processed/v1/social/session/count/series.json/?start_time=20110605_0000&api_key=<API KEY>&time_segment=week&end_time=20110705_0000

Return:

[['2011-06-05', 283695],
['2011-06-12', 310616],
['2011-06-19', 309293],
['2011-06-26', 277249],
['2011-07-03', 287560]]

Average Session Length


session/avg_length

URL

http://query.kontagent.net/processed/v1/social/session/avg_length/<data_type>.<data_format>/?api_key=<API KEY>&<other parameters>

Data Output Types

ParameterValuesDescription
data_typeseriesThe output data type.
data_format
  • json
The format of the output data.

Required Parameters

ParameterValuesDescription
api_keyYour Upsight Analytics API key.
end_timeYYYYmmdd_HHMMThe end time element (day, week, month) in the time range being queried in the YYYYmmdd_HHMM format.
start_timeYYYYmmdd_HHMMThe start time element (day, week, month) in the time range being queried in the YYYYmmdd_HHMM format.
time_segment
  • week
  • hour
  • month
  • day
The frequency of data reporting. For example, a time segment by day will return the data on a daily basis between the start and end times specified. A time segment by hour will return the data on an hourly basis between the start and end times specified.

Optional Parameters

ParameterValuesDescription
countryPlease see the ISO-3166-1 alpha-2 list.

The country code of the country in which the user is located. The country code must be in upper case format and conform to the ISO-3166-1 alpha-2 standard. If not sent, it will be based on the user's IP.

Note! The Facebook locales ar_AR and es_LA do not follow the ISO standard. Facebook uses them to denote umbrella locales for Arabic and Spanish speaking regions. If you send the last two characters of these locales to Upsight Analytics, they will map to Argentina and Laos. As a best practice, if you see these locales, do not pass the country code. For additional information on Facebook locales, click here.

friends
  • unknown
  • 0-10
  • 11-20
  • 21-40
  • 41-60
  • 61-80
  • 81-125
  • 126-250
  • 250+
The number of friends a user has. Defined by a friend range.
gender
  • female
  • male
  • unknown
The user gender.
group_by
  • location:country
  • location:country_abbreviation
  • location:continent
  • location:continent_abbreviation
  • demographic:gender
  • demographic:gender_abbreviation
  • demographic:age_range
The location or demographic group.
source_type
  • ad_buy
  • ad_buy.tlm
  • ad_buy.spruce
  • ad_buy.tbg
  • stream
  • bookmarks
  • canvas_bkmk_top
  • canvas_bkmk_more
  • dashboard
  • dashboard_activity
  • discovery
  • email
  • fdp
  • feedpub
  • feedstory
  • games_friends_apps
  • games_my_recent
  • inr
  • invite
  • nei
  • nf
  • notification
  • ntr
  • partner
  • ts
The source type name as defined by you in the UCC API call.

Code Example

Query URL:

http://query.kontagent.net/processed/v1/social/session/avg_length/series.json/?start_time=20110605_0000&api_key=<API KEY>&time_segment=week&end_time=20110705_0000

Return:

[['2011-06-05', 947.52098556548401],
['2011-06-12', 977.23060949854482],
['2011-06-19', 965.47103232210236],
['2011-06-26', 945.55859894895923],
['2011-07-03', 944.47725344275977]]