Description Usage Arguments Value Sets of metrics See Also Examples
View source: R/myTarGetStats.R
Get stat by clients, campaigns or banners from 'API MyTarget'
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | myTarGetStats(
date_from = Sys.Date() - 7,
date_to = Sys.Date(),
object_type = "campaigns",
object_id = NULL,
stat_type = "day",
metrics = "base",
package_id = NULL,
attribution = c("conversion", "impression", "default"),
banner_status = NULL,
campaign_status = NULL,
sort_by = NULL,
sort_direction = c("asc", "desc"),
auth = NULL,
login = getOption("rmytarget.login"),
token_path = myTarTokenPath(),
api_version = getOption("rmytarget.stat_api_version")
)
|
date_from |
Start date |
date_to |
End date |
object_type |
API object type, character value, one of campaigns, banners, users. |
object_id |
ID of API object (id campaign or any object). |
stat_type |
Breakdown by day, possible values: day, summary. |
metrics |
Set of metrics or fields, see metrics section for more ditali, default "base", but you can load any of all, base, events, video, viral, uniques, tps, or go this MyTarget Stat API v2 or MyTarget Stat API v3. |
package_id |
List of package identifiers. Available for banner statistics. |
attribution |
Attributing by event time or impression time. Available options: conversion, impression, default. |
banner_status |
Banner statuses list, available for campaign and banner statistics. Possible values: all, active, blocked, deleted. |
campaign_status |
List of campaign statuses, available for campaign and banner statistics. Possible values: all, active, blocked, deleted. |
sort_by |
The field by which identifiers of campaigns, banners or users will be sorted. Available metrics: base, events, video, viral, carousel, tps, moat, playable, romi. |
sort_direction |
Sorting direction. Available options: asc, desc |
auth |
MyTarget Autherization R object. See |
login |
Path to directory where you save credential data |
token_path |
Your login, or client name in MyTarget account |
api_version |
MyTarget Statistic API version: v2, v3 |
Data frame with statistic.
You can load different sets of metrics, for this use metrics arguments, and set a vector containing the names of the desired metric sets. For more details of v2 API go this link. For more details of v3 API go this link. For example: metrics = c("base", "video", "viral")
base - based metrcis.
Number of impressions
Number of clicks
Number of goals achieved
Cost sum
Average cost per 1000 views
Average cost per click
Average cost per goals
Percentage of clicks to views
Percentage ratio of the number of goals achieved to the number of clicks.
events - metrics for advertised posts on social media feeds.
Number of discoveries of the advertised social networks application
Number of discoveries of the advertised message in the social media feed
Number of transitions to the group page from the advertised message
Number of clicks on the external link in the advertised message
Number of video launches in advertised message
Number of comments left in the advertised message
Number of joining the group through the advertised message
Number of likes of the advertised message
Number of action "Share" for the advertised message.
Number of voting actions in the advertised message
uniques - metrics by the number of unique users.
Number of unique users who saw the ad for the specified period
Number of unique users who saw an ad for all time
Number of new unique users who saw the ad for the specified period
Average frequency of displaying ads to one unique user
video - metrics for video ads.
Number of video playback starts
Number of pauses of video playback
Number of video playback after pause
Number of full-screen video playbacks
Number of shutdowns of full-screen video playback
Number of video mute
Number of video sound starts
Number of views of the first 10 seconds of the video
Number of views of the first 25 percent of the video duration
Number of views of the first 50 percent of the video duration
Number of views of the first 75 of the video duration
Number of views 100 percent of the video duration
Percentage of views with the achievement of the first 10 seconds of the video
Percentage of views with the achievement of the first 25 percent of the video duration
Percentage of views with the achievement of the first 50 percent of the video duration
Percentage of views with the achievement of the first 75 percent of the video duration
Percentage of views with the achievement of the first 100 percent of the video duration
Average video viewing depth (percent)
Average cost of watching the first 10 seconds of a video
Average viewing cost of the first 25 percent of video length
Average viewing cost of the first 50 percent of video length
Average viewing cost of the first 75 percent of video length
Average viewing cost of the first 100 percent of video length
viral - metrics of viral events.
Number of impressions of the shared advertising message in social networks
Number of unique users who saw the shared advertising message for the specified period
Total number of unique users who have seen the shared advertising message for all time
Number of new unique users who saw the shared advertising message for the specified period
Average frequency of displaying a shared advertising message to one unique user
Number of openings of the advertised application from the shared advertising message
Number of discoveries of the shared advertised message in the social media feed
number of transitions to the group page from the shared advertised message
Number of clicks on the external link in the shared advertised message
Number of video launches in the shared advertised message
Number of comments left in the shared advertised message
Number of joining the group through the shared advertised message
Number of likes of the shared advertised message
Number of actions "Share" for the shared advertised message
Number of voting actions in the shared advertised message
carousel - statistics on individual slides of the advertising carousel (N - from 1 to the number of slides).
Number of N slide shows
Number of clicks on slide N
Percentage ratio of clicks to the number of views on slide N
tps - additional write-off statistics.
Additional charges for using the moat service
Additional charges for using third-party data (from dmp).
moat - statistics according to the moat service.
Number of impressions
Number of visible shows
Number of impressions in the inactive tab
Number of impressions out of sight
Additional charges for using third-party data (from dmp).
Number of impressions with visibility duration less than 1 second
Number of verified impressions
number of impressions analyzed
Number of impressions analyzed
Percentage of visible hits
Verified impression percentage
Impression percentage in inactive tab
The percentage of orders with a zone of visibility of the ad is less than 50 percent
Percentage of impressions with visibility duration less than 1 second
Visible impression difference
Average time the ad is in view
Engagement level
playable - Playable Ads metrics.
Opening the game
Closing the game
Clicks
romi - Playable Ads metrics.
The given value of the event
Return on investment
Ad spend share
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | ## Not run:
# base metrics by campaigns
base_data <- myTarGetStats(date_from = Sys.Date() - 7,
date_to = Sys.Date(),
object_type = "campaigns",
metrics = "base",
stat_type = "day",
login = "client_login",
token_path = "D:\\mytarget_token")
# all metrics by campaigns
all_data <- myTarGetStats(date_from = Sys.Date() - 7,
date_to = Sys.Date(),
object_type = "campaigns",
metrics = "all",
stat_type = "day",
login = "client_login",
token_path = "D:\\mytarget_token")
# custom set of metric by campaigns
custom_data <- myTarGetStats(date_from = Sys.Date() - 7,
date_to = Sys.Date(),
object_type = "campaigns",
metrics = c("base", "tps", "viral"),
stat_type = "day",
login = "client_login",
token_path = "D:\\mytarget_token")
# if have note objects id, base metrics by ads
base_data2 <- myTarGetStats(date_from = as.Date("2013-01-01"),
date_to = Sys.Date(),
object_type = "banners",
metrics = "base",
stat_type = "day",
login = "client_login",
token_path = "D:\\mytarget_token")
# get all stats group by clients, only for agency account
client_stat <- myTarGetStats(date_from = Sys.Date() - 7,
date_to = Sys.Date(),
object_type = "users",
metrics = "all",
login = "agency_login")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.