{"id":1183,"date":"2018-03-23T23:06:13","date_gmt":"2018-03-23T23:06:13","guid":{"rendered":"https:\/\/www.s-sols.com\/?post_type=doc&#038;p=1183"},"modified":"2022-09-15T10:58:27","modified_gmt":"2022-09-15T10:58:27","slug":"getting-started-dlstat","status":"publish","type":"doc","link":"https:\/\/www.s-sols.com\/docs\/wordpress\/downloads-stats\/getting-started-dlstat","title":{"rendered":"How to use Downloads Statistics for WordPress"},"content":{"rendered":"<p>\n  The plugin allows track files downloads in specific site\u2019s relative path by sending statistics to Google Analytics and the Local Database.\n<\/p>\n<h2><a id=\"settings\"><\/a>Settings<br \/>\n<\/h2>\n<p style=\"text-align:center\">\n  <img decoding=\"async\" src=\"\/data\/content\/doc\/wordpress\/downloads-stats\/getting-started-dlstat\/settings-en.png\" alt=\"settings\" title=\"settings - How to use\" \/>\n<\/p>\n<h3>\n  General<br \/>\n<\/h3>\n<ul>\n<li><strong>Relative site path<\/strong>\n<ul>\n<li><a id=\"settings_item_enable\"><\/a><strong>Enable<\/strong>\n<p style=\"text-align:left\">\n          It is useful to disable item without deleting the configuration.\n        <\/p>\n<\/li>\n<li><a id=\"settings_item_evtlblenable\"><\/a><strong>Use event label<\/strong>\n<p style=\"text-align:left\">\n          Use statistics event label for that path. Doesn\u2019t work if common <a href=\"#settings_evlbl\" target=\"_blank\" rel=\"noopener\">statistics event label<\/a> is disabled<strong>.<\/strong>\n        <\/p>\n<\/li>\n<li><a id=\"settings_item_path\"><\/a><strong>Path<\/strong>\n<p style=\"text-align:left\">\n          Type relative site\u2019s path to monitor it\u2019s files downloads.\n        <\/p>\n<p style=\"text-align:left\"><strong>Note:<\/strong> Choose path more precisely. Otherwise, it might degrade performance of downloading site&#8217;s elements.\n        <\/p>\n<\/li>\n<li><a id=\"settings_item_filesextsincl\"><\/a><strong>Files types<\/strong>\n<p style=\"text-align:left\">\n          List of comma separated files extensions that only be included in monitor.\n        <\/p>\n<p style=\"text-align:left\"><strong>Note:<\/strong> There are system file types that always excluded from monitoring to prevent unstable site work: *.htaccess, *.php, *.js and *.css.\n        <\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li><a id=\"settings_evlbl\"><\/a><strong>Statistics event label<\/strong>\n<p style=\"text-align:left\">\n      It is possible to use URL\u2019s arguments as a statistics label. Label will be formed from a list of request&#8217;s arguments using the argument separator and the value delimiter.\n    <\/p>\n<ul start=\"5\">\n<li><strong>Enable<\/strong>\n<p style=\"text-align:left\">\n          Check to use it in all paths. Each path can <a href=\"#settings_item_evtlblenable\" target=\"_blank\" rel=\"noopener\">enable it separately<\/a>.\n        <\/p>\n<\/li>\n<li><strong>Argument separator<\/strong>\n<p style=\"text-align:left\">\n          Separator between arguments.\n        <\/p>\n<\/li>\n<li><strong>Argument value delimiter<\/strong>\n<p style=\"text-align:left\">\n          Separator between argument\u2019s name and value.\n        <\/p>\n<\/li>\n<\/ul>\n<p style=\"text-align:left\">\n      So e.g. for URL \u2018http:\/\/yoursite.com\/page?arg1=v1&amp;arg2=v1\u2019 in case of \u2018Argument separator\u2019 = \u2018,\u2019 and \u2018Argument value delimiter\u2019 = \u2018:\u2019 label will be &#8216;arg1:v1,arg2:v2&#8217;.\n    <\/p>\n<\/li>\n<li><a id=\"settings_sendmode\"><\/a><strong>Send mode<\/strong>\n<p style=\"text-align:left\">\n      By default statistic sending each minute to provide data on the time.\n    <\/p>\n<p style=\"text-align:left\"><strong>Note:<\/strong> There is <a href=\"https:\/\/developer.wordpress.org\/plugins\/cron\/hooking-wp-cron-into-the-system-task-scheduler\/\" target=\"_blank\" rel=\"nofollow noopener\">the alternative way<\/a> how to setup WP Cron on your site.\n    <\/p>\n<\/li>\n<\/ul>\n<h3><a id=\"settings_ga\"><\/a>Google Analytics<br \/>\n<\/h3>\n<p>\n  If enabled, statistics will be sent to Google Analytics account by specified tracking ID as events with specified event category, URI as event action and URL arguments as event label if <a href=\"#settings_evlbl\" target=\"_blank\" rel=\"noopener\">it is enabled in general settings<\/a>.\n<\/p>\n<ul start=\"4\">\n<li><a id=\"settings_ga_enable\"><\/a><strong>Enable<\/strong>\n<p style=\"text-align:left\">\n      Set this checkbox to enable statistics sending.\n    <\/p>\n<\/li>\n<li><a id=\"settings_ga_trackid\"><\/a><strong>Tracking ID<\/strong>\n<p style=\"text-align:left\">\n      Tracking ID of the account. Type your Google Analytics\u2019s tracking ID.\n    <\/p>\n<\/li>\n<li><a id=\"settings_ga_evcat\"><\/a><strong>Event category<\/strong>\n<p style=\"text-align:left\">\n      Event category that will be seen in the events&#8217; dashboard. Change event category if needed.\n    <\/p>\n<\/li>\n<li><a id=\"settings_ga_cusdimcliid\"><\/a><strong>Custom dimension for client ID<\/strong>\n<p style=\"text-align:left\">\n      Custom dimension index to store client ID for debug purposes e.g. user&#8217;s IP. Optional.\n    <\/p>\n<\/li>\n<\/ul>\n<h3><a id=\"settings_ldb\"><\/a>Local Database<br \/>\n<\/h3>\n<p>\n  If enabled, statistics will be written to the local database table with name \u2018wp_seraph_dlstat\u2019. Use any databese viewer or editor to see events. It is used generally for debug purposes only or if there is no any other way.\n<\/p>\n<ul start=\"8\">\n<li><a id=\"settings_ldb_enable\"><\/a><strong>Enable<\/strong>\n<p style=\"text-align:left\">\n      Set this checkbox to enable statistics writing.\n    <\/p>\n<\/li>\n<li><a id=\"settings_ldb_data\"><\/a><strong>Data<\/strong>\n<p style=\"text-align:left\">\n      Set this checkbox and all data will be erased. If \u2018Enabled\u2019 is unchecked \u2018wp_seraph_dlstat\u2019 table will be deleted as well.\n    <\/p>\n<\/li>\n<\/ul>\n<h2>\n  Configuration under NGINX<br \/>\n<\/h2>\n<p>\n  To enable working <strong>under NGINX<\/strong> the following directives should be added manually into the begin of <code>server<\/code> directive:\n<\/p>\n<p><code class=\"p\"># seraphinite-downloads-stats - File hook redirection<br \/>include \/www\/wwwroot\/my-site.com\/seraph-dlstat.conf;<\/code>\n<\/p>\n<p>\n  And the <code>\/www\/wwwroot\/my-site.com<\/code> should be replaced by your site\u2019s root filesystem path.\n<\/p>\n<p><strong>Note<\/strong><span style=\"font-size:12pt\">. <\/span>After changing the settings, you need to manually update the<span style=\"font-size:12pt\"> <\/span>NGINX configuration.\n<\/p>\n<h2><a id=\"api\"><\/a>API<br \/>\n<\/h2>\n<p>\n  There are a set of filters and actions to hook.\n<\/p>\n<p><strong>seraph_dlstat_prepare_events<\/strong> filter\n<\/p>\n<p><strong>seraph_dlstat_event_label_format<\/strong> filter\n<\/p>\n<p><strong>seraph_dlstat_items_download_requested<\/strong> action\n<\/p>\n<p><strong>seraph_dlstat_ga_prepare_event<\/strong> filter\n<\/p>\n<h2><a id=\"reqs\"><\/a>Requirements<br \/>\n<\/h2>\n<p>\n  <ul><li><a href=\"https:\/\/wordpress.org\/download\" target=\"_blank\" rel=\"nofollow noopener\">WordPress<\/a> 4.5 or higher.<\/li><li>PHP 5.4 or higher.<\/li><li><a href=\"https:\/\/httpd.apache.org\" rel=\"nofollow noopener\" target=\"_blank\">Apache Web Server<\/a> 2.0 or higher (for site\u2019s .htaccess file).<\/li><li>Browser (Google Chrome, Firefox, IE).<\/li><\/ul><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The plugin allows track files downloads in specific site\u2019s relative path by sending statistics to Google Analytics and the Local Database. Settings General Relative site path Enable It is useful to disable item without deleting the configuration. Use event label Use statistics event label for that path. Doesn\u2019t work if common statistics event label is&#8230;<\/p>\n","protected":false},"author":18,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"rank_math_lock_modified_date":false},"categories":[150],"tags":[],"class_list":["post-1183","doc","type-doc","status-publish","hentry","category-downloads-stats"],"_links":{"self":[{"href":"https:\/\/www.s-sols.com\/api\/wp\/v2\/doc\/1183","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.s-sols.com\/api\/wp\/v2\/doc"}],"about":[{"href":"https:\/\/www.s-sols.com\/api\/wp\/v2\/types\/doc"}],"author":[{"embeddable":true,"href":"https:\/\/www.s-sols.com\/api\/wp\/v2\/users\/18"}],"replies":[{"embeddable":true,"href":"https:\/\/www.s-sols.com\/api\/wp\/v2\/comments?post=1183"}],"wp:attachment":[{"href":"https:\/\/www.s-sols.com\/api\/wp\/v2\/media?parent=1183"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.s-sols.com\/api\/wp\/v2\/categories?post=1183"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.s-sols.com\/api\/wp\/v2\/tags?post=1183"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}