@plasma-platform/service-statistics
v2.1.6
Published
TM statistics service api
Downloads
68
Readme
Full documentation
install:npm i @plasma-platform/service-statistics -S
Short documentation
Table of Contents
- StatisticsService
- trackTemplateView
- getReviewStatistics
- getOneStatistics
- getSaleStatistics
- getViewStatistics
- getTrafficStatisticsByChannel
- getStatisticsChannelTraffic
- getTrafficStatisticsBySource
- getStatisticsTrafficChannelsList
- getTotalSaleStatistics
- getTotalProductStatistics
- getStatisticsTransactionsInfo
- getMinYearStatistics
- getStatisticsProductDiscounts
- getStatisticsProductBoosts
StatisticsService
Parameters
trackTemplateView
Request Services
Parameters
params
object { templateId: Template id. (to track statistic on template), userId: Author User Id. (to track statistic on author), } (optional, default{}
)
Examples
(async () => {
const service = new Service('http://api.templatemonsterdev.com/statistics/v1/');
const request = await service.trackTemplateView(params);
})();
Returns Promise<any>
getReviewStatistics
Request Services
Parameters
params
object { entity_id: entity id - id author or template, access_token: users token, type: type review statistics - author or template, date_from: date start for statistics, date_to: date end for statistics, group: group review for statistics, default day, type_id: type id for filter statistics data, } (optional, default{}
)
Examples
(async () => {
const service = new Service('http://api.templatemonsterdev.com/statistics/v2/');
const request = await service.getReviewStatistics(params);
})();
Returns Promise<any>
getOneStatistics
Request Services
Parameters
params
object { access_token: user's access token, entity_id: entity id - id author or template, type: type one statistics - author or template, date_from: date start for statistics, date_to: date end for statistics, type_id: type id for filter statistics data, } (optional, default{}
)
Examples
(async () => {
const service = new Service('http://api.templatemonsterdev.com/statistics/v2/');
const request = await service.getOneStatistics(params);
})();
Returns Promise<any>
getSaleStatistics
Request Services
Parameters
params
object { entity_id: entity id - id author or template, access_token: users token, type: type sale statistics - author or template, date_from: date start for statistics, date_to: date end for statistics, group: group sale for statistics, default day, country: country for filter sale statistics, type_id: type id for filter statistics data, } (optional, default{}
)
Examples
(async () => {
const service = new Service('http://api.templatemonsterdev.com/statistics/v2/');
const request = await service.getSaleStatistics(params);
})();
Returns Promise<any>
getViewStatistics
Request Services
Parameters
params
object { entity_id: entity id - id author or template, access_token: users token, type: type view statistics - author or template, date_from: date start for statistics, date_to: date end for statistics, group: group view for statistics, default day, country: country for filter view statistics, type_id: id of type products for filter view statistics, } (optional, default{}
)
Examples
(async () => {
const service = new Service('http://api.templatemonsterdev.com/statistics/v2/');
const request = await service.getViewStatistics(params);
})();
Returns Promise<any>
getTrafficStatisticsByChannel
Request Services
Parameters
params
object { entity_id: entity id - id author or template, access_token: users token, type: type traffic statistics - author or template, date_from: date start for statistics, date_to: date end for statistics, group: Statistic grouping, default day, country: Get statistic filtered by country iso2code } (optional, default{}
)
Examples
(async () => {
const service = new Service('http://api.templatemonsterdev.com/statistics/v2/');
const request = await service.getSaleStatistics(params);
})();
Returns Promise<any>
getStatisticsChannelTraffic
Request Services
Parameters
params
object { access_token: users token, date_from: date start for statistics, date_to: date end for statistics, group: Statistic grouping, default day, channel: Get statistic filtered by channel type_id: Get statistic filtered by type_id product_id: Get statistic filtered by product_id } (optional, default{}
)
Examples
(async () => {
const service = new Service('http://api.templatemonsterdev.com/statistics/v2/');
const request = await service.getStatisticsChannelTraffic(params);
})();
Returns Promise<any>
getTrafficStatisticsBySource
Request Services
Parameters
params
object { entity_id: entity id - id author or template, access_token: users token, type: type traffic statistics - author or template, date_from: date start for statistics, date_to: date end for statistics, group: Statistic grouping, default day, country: Get statistic filtered by country iso2code source: Get statistic filtered by source, perPage: Max statistic per one page (20 by default, 50 is max size), page: Page number to view, } (optional, default{}
)
Examples
(async () => {
const service = new Service('http://api.templatemonsterdev.com/statistics/v2/');
const request = await service.getSaleStatistics(params);
})();
Returns Promise<any>
getStatisticsTrafficChannelsList
Request Services
Examples
(async () => {
const service = new Service('http://api.templatemonsterdev.com/statistics/v2/');
const request = await service.getStatisticsTrafficChannelsList(params);
})();
Returns Promise<any>
getTotalSaleStatistics
Request Services
Parameters
params
object { author_user_id: authors id, access_token: users token, date_from: date start for total statistics, date_to: date end for total statistics, } (optional, default{}
)
Examples
(async () => {
const service = new Service('http://api.templatemonsterdev.com/statistics/v2/');
const request = await service.getTotalSaleStatistics(params);
})();
Returns Promise<any>
getTotalProductStatistics
Request Services
Parameters
params
object { author_user_id: authors id, product_ids: List of Product Id, access_token: users token, } (optional, default{}
)
Examples
(async () => {
const service = new Service('http://api.templatemonsterdev.com/statistics/v2/');
const request = await service.getTotalProductStatistics(params);
})();
Returns Promise<any>
getStatisticsTransactionsInfo
Request Services
Parameters
params
object { date_from: date start for total statistics: format 20200723, date_to: date end for total statistics: format 20200726, types: types of transactions (sale,refund,withdraw), country: country of transactions, perPage: count items of page, page: number of page, format: response format, access_token: authors token, } (optional, default{}
)
Examples
(async () => {
const service = new Service('http://api.templatemonsterdev.com/statistics/v2/');
const request = await service.getStatisticsTransactionsInfo(params);
})();
Returns Promise<any>
getMinYearStatistics
Request Services
Parameters
params
object { author_user_id: author user id, type_view: in what stats search, entity_type: what type id for filter set, entity_id: entity id - id author or template, access_token: users token, } (optional, default{}
)
Examples
(async () => {
const service = new Service('http://api.templatemonsterdev.com/statistics/v2/');
const request = await service.getMinYearStatistics(params);
})();
Returns Promise<any>
getStatisticsProductDiscounts
Request Services
Parameters
params
object { template_id: Show data for this product, date_from: Start day in period for get statistic, date_to: End day in period for get statistic, access_token: users token, locale: locale, } (optional, default{}
)
Examples
(async () => {
const service = new Service('http://api.templatemonsterdev.com/statistics/v2/');
const request = await service.getStatisticsProductDiscounts(params);
})();
Returns Promise<any>
getStatisticsProductBoosts
Request Services
Parameters
params
object { template_id: Show data for this product, date_from: Start day in period for get statistic, date_to: End day in period for get statistic, access_token: users token, } (optional, default{}
)
Examples
(async () => {
const service = new Service('http://api.templatemonsterdev.com/statistics/v2/');
const request = await service.getStatisticsProductBoosts(params);
})();
Returns Promise<any>