ish_manager 0.1.8.489 → 0.1.8.491
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ebc46ebdabf689ee96ebb56801de9ad50d09af08605a27241aae2527b7003d2c
|
4
|
+
data.tar.gz: 8d28355c7080981f13c9fbd6e5fbbb452221c3888fb37f06ba3c39dedb443143
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf026c1b3ad53b4238dad931b4c23013ae844fde40a93c22e3e1656e0c1f093eb9b2e1c0529edd0c555dcb55fe8bfd37380c5a5968a3bbbeda2338196150a603
|
7
|
+
data.tar.gz: 2bbfe3c85d61ebdbfa0f4bde978299816a7df983beb8b89fb1fb071a208e1c80d32a5cd39bab6a912d0196280dbac65b499bfe73873c433322e248499f1863aa
|
@@ -10,18 +10,24 @@ class IshManager::AnalyticsController < IshManager::ApplicationController
|
|
10
10
|
def test
|
11
11
|
authorize! :analytics, IshManager::Ability
|
12
12
|
|
13
|
-
if
|
14
|
-
|
15
|
-
|
16
|
-
|
13
|
+
if params[:prev_interval].present?
|
14
|
+
if !@prev_intervals.include?( params[:prev_interval] )
|
15
|
+
flash_alert "prev_interval not allowed"
|
16
|
+
redirect_to action: :index
|
17
|
+
return
|
18
|
+
end
|
19
|
+
prev_interval = eval( params[:prev_interval] )
|
20
|
+
selected_date = "#{(Time.now - prev_interval ).to_date.to_s},#{Time.now.to_date.to_s}"
|
21
|
+
else
|
22
|
+
selected_date = "#{params[:date_from]},#{params[:date_to]}"
|
17
23
|
end
|
18
|
-
prev_interval = eval( params[:prev_interval] )
|
19
|
-
puts! prev_interval, 'prev_interval'
|
20
24
|
|
21
25
|
base_url = "https://analytics.wasya.co/index.php?force_api_session=1&module=API&format=JSON&"
|
22
|
-
api_url_trash = "&idDimension=1&idSite=2&period=day&date=2023-07-01,2023-09-01"
|
26
|
+
# api_url_trash = "&idDimension=1&idSite=2&period=day&date=2023-07-01,2023-09-01"
|
23
27
|
opts = {
|
24
28
|
"token_auth" => ANALYTICS_TOKEN,
|
29
|
+
"filter_limit" => "-1",
|
30
|
+
"expanded" => 1,
|
25
31
|
|
26
32
|
# "method" => "Actions.getPageUrls",
|
27
33
|
method: params[:method],
|
@@ -31,33 +37,55 @@ class IshManager::AnalyticsController < IshManager::ApplicationController
|
|
31
37
|
# "idSite" => 2,
|
32
38
|
idSite: params[:idSite],
|
33
39
|
|
34
|
-
"period" => "day",
|
40
|
+
# "period" => "day",
|
41
|
+
"period" => "range",
|
35
42
|
# period: params[:period],
|
36
43
|
|
37
|
-
"date" =>
|
44
|
+
"date" => selected_date,
|
38
45
|
}
|
39
46
|
|
40
47
|
cids = []
|
41
48
|
reports = {}
|
49
|
+
reports[9999] = []
|
42
50
|
|
43
51
|
puts! "#{base_url}#{opts.to_query}", 'ze query'
|
44
52
|
|
45
53
|
inns = HTTParty.get( "#{base_url}#{opts.to_query}" )
|
46
54
|
inns = JSON.parse( inns.body )
|
47
55
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
path
|
56
|
+
if "Actions.getPageUrls" == params[:method]
|
57
|
+
inns.each do |date, items|
|
58
|
+
items.each do |item|
|
59
|
+
|
60
|
+
path = item['label']
|
61
|
+
if path[0] != '/'
|
62
|
+
path = "/#{path}"
|
63
|
+
end
|
64
|
+
|
65
|
+
cid = path[/.*cid=([\d]*)/,1]&.to_i
|
66
|
+
if cid
|
67
|
+
cids.push cid
|
68
|
+
reports[cid] ||= []
|
69
|
+
reports[cid].push "#{date} :: #{path}"
|
70
|
+
end
|
54
71
|
end
|
72
|
+
end
|
73
|
+
end
|
55
74
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
75
|
+
if "Live.getLastVisitsDetails" == params[:method]
|
76
|
+
inns.each do |items|
|
77
|
+
date = items['serverDate']
|
78
|
+
items['actionDetails'].each do |item|
|
79
|
+
path = item['url']
|
80
|
+
|
81
|
+
cid = path[/.*cid=([\d]*)/,1]&.to_i
|
82
|
+
if cid
|
83
|
+
cids.push cid
|
84
|
+
reports[cid] ||= []
|
85
|
+
reports[cid].push "#{date} :: #{path}"
|
86
|
+
else
|
87
|
+
reports[9999].push "#{date} :: #{path}"
|
88
|
+
end
|
61
89
|
end
|
62
90
|
end
|
63
91
|
end
|
@@ -67,10 +95,12 @@ class IshManager::AnalyticsController < IshManager::ApplicationController
|
|
67
95
|
@reports = {}
|
68
96
|
|
69
97
|
reports.each do |k, v|
|
70
|
-
lead_label = "[#{k}] <#{leads_h[k]
|
98
|
+
lead_label = "[#{k}] <#{leads_h[k]&.name} #{leads_h[k]&.email}>"
|
71
99
|
@reports[lead_label] = v
|
72
100
|
end
|
73
101
|
|
102
|
+
@reports = @reports.sort
|
103
|
+
|
74
104
|
end
|
75
105
|
|
76
106
|
##
|
@@ -81,10 +111,12 @@ class IshManager::AnalyticsController < IshManager::ApplicationController
|
|
81
111
|
def set_vars
|
82
112
|
@methods_list = [
|
83
113
|
"Actions.getPageUrls",
|
114
|
+
"Live.getLastVisitsDetails",
|
84
115
|
]
|
85
116
|
|
86
117
|
|
87
118
|
@prev_intervals = [
|
119
|
+
nil,
|
88
120
|
"1.month",
|
89
121
|
"2.months",
|
90
122
|
"3.months",
|
@@ -5,14 +5,22 @@
|
|
5
5
|
%li= link_to 'Test', analytics_test_path
|
6
6
|
|
7
7
|
= form_tag( analytics_test_path, method: :get ) do
|
8
|
+
|
8
9
|
.field
|
9
10
|
%label Domain
|
10
11
|
= select_tag :idSite, options_for_select(@sites_list, selected: params[:idSite]), class: :select2
|
12
|
+
|
11
13
|
.field
|
12
14
|
%label prev_interval
|
13
15
|
= select_tag :prev_interval, options_for_select( @prev_intervals, selected: params[:prev_interval] )
|
16
|
+
%label date_from
|
17
|
+
= text_field_tag :date_from, params[:date_from]
|
18
|
+
%label date_to
|
19
|
+
= text_field_tag :date_to, params[:date_to]
|
20
|
+
|
14
21
|
.field
|
15
22
|
%label method
|
16
23
|
= select_tag :method, options_for_select( @methods_list, selected: params[:method] )
|
24
|
+
|
17
25
|
.actions
|
18
26
|
= submit_tag 'Submit'
|
@@ -914,8 +914,10 @@
|
|
914
914
|
<tr>
|
915
915
|
<td align="center" valign="middle" class="mcnButtonContent"
|
916
916
|
style="font-family: Arial; font-size: 16px; padding: 10px;">
|
917
|
-
|
918
|
-
|
917
|
+
<% link_1 = obfuscate "#{@tmpl_config['link_1']}#{@utm_tracking_str}" %>
|
918
|
+
<a class="mcnButton " title="1-One" href="<%= link_1 %>" target="_self"
|
919
|
+
style="font-weight: bold;letter-spacing: normal;line-height: 100%;text-align: center;text-decoration: none;color: #CDD0D5;"
|
920
|
+
>1</a>
|
919
921
|
</td>
|
920
922
|
</tr>
|
921
923
|
</tbody>
|
@@ -949,8 +951,10 @@
|
|
949
951
|
<tr>
|
950
952
|
<td align="center" valign="middle" class="mcnButtonContent"
|
951
953
|
style="font-family: Arial; font-size: 16px; padding: 10px;">
|
952
|
-
|
953
|
-
|
954
|
+
<% link_2 = obfuscate "#{@tmpl_config['link_2']}#{@utm_tracking_str}" %>
|
955
|
+
<a class="mcnButton " title="2-Two" href="<%= link_2 %>" target="_self"
|
956
|
+
style="font-weight: bold;letter-spacing: normal;line-height: 100%;text-align: center;text-decoration: none;color: #CDD0D5;"
|
957
|
+
>2</a>
|
954
958
|
</td>
|
955
959
|
</tr>
|
956
960
|
</tbody>
|
@@ -984,8 +988,10 @@
|
|
984
988
|
<tr>
|
985
989
|
<td align="center" valign="middle" class="mcnButtonContent"
|
986
990
|
style="font-family: Arial; font-size: 16px; padding: 10px;">
|
987
|
-
|
988
|
-
|
991
|
+
<% link_3 = obfuscate "#{@tmpl_config['link_3']}#{@utm_tracking_str}" %>
|
992
|
+
<a class="mcnButton " title="3-Three" href="<%= link_3 %>" target="_self"
|
993
|
+
style="font-weight: bold;letter-spacing: normal;line-height: 100%;text-align: center;text-decoration: none;color: #CDD0D5;"
|
994
|
+
>3</a>
|
989
995
|
</td>
|
990
996
|
</tr>
|
991
997
|
</tbody>
|
@@ -1019,8 +1025,10 @@
|
|
1019
1025
|
<tr>
|
1020
1026
|
<td align="center" valign="middle" class="mcnButtonContent"
|
1021
1027
|
style="font-family: Arial; font-size: 16px; padding: 10px;">
|
1022
|
-
|
1023
|
-
|
1028
|
+
<% link_4 = obfuscate "#{@tmpl_config['link_4']}#{@utm_tracking_str}" %>
|
1029
|
+
<a class="mcnButton " title="4-Four" href="<%= link_4 %>" target="_self"
|
1030
|
+
style="font-weight: bold;letter-spacing: normal;line-height: 100%;text-align: center;text-decoration: none;color: #CDD0D5;"
|
1031
|
+
>4</a>
|
1024
1032
|
</td>
|
1025
1033
|
</tr>
|
1026
1034
|
</tbody>
|
@@ -1054,8 +1062,10 @@
|
|
1054
1062
|
<tr>
|
1055
1063
|
<td align="center" valign="middle" class="mcnButtonContent"
|
1056
1064
|
style="font-family: Arial; font-size: 16px; padding: 10px;">
|
1057
|
-
|
1058
|
-
|
1065
|
+
<% link_5 = obfuscate "#{@tmpl_config['link_5']}#{@utm_tracking_str}" %>
|
1066
|
+
<a class="mcnButton " title="5-Five" href="<%= link_5 %>" target="_self"
|
1067
|
+
style="font-weight: bold;letter-spacing: normal;line-height: 100%;text-align: center;text-decoration: none;color: #CDD0D5;"
|
1068
|
+
>5</a>
|
1059
1069
|
</td>
|
1060
1070
|
</tr>
|
1061
1071
|
</tbody>
|