ish_manager 0.1.8.486 → 0.1.8.488
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/ish_manager/analytics_controller.rb +51 -0
- data/app/controllers/ish_manager/unsubscribes_controller.rb +3 -0
- data/app/views/ish_manager/analytics/test.haml +10 -0
- data/app/views/ish_manager/unsubscribes/index.haml +4 -2
- data/config/routes.rb +5 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5d6230cc24c1746299a40db13ee998b8ad59fb10cf90c5d4b6efd060f7b43a71
|
4
|
+
data.tar.gz: b9708207b607a11368db470bcfc76d2e84fb549c9ddef553e062fe4cfc5470a2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c9b239cfd2593b44bcbe50bfdcb92ea7fb3479d01a5e496b37afd78e8e010048c73d2b10469a0fa30d647ee2098d22a64e170b4318190f3fb80cdd5d11f44c6
|
7
|
+
data.tar.gz: 6a82bf2054f9efaa665365d1bf2cba8e8384ed55ae431cfe84fe5780e6dc2d3d987a590fa62811842e45cf36686e67094edc451714e25e56fc02c3cd4de057a0
|
@@ -0,0 +1,51 @@
|
|
1
|
+
|
2
|
+
class IshManager::AnalyticsController < IshManager::ApplicationController
|
3
|
+
|
4
|
+
def test
|
5
|
+
authorize! :analytics, IshManager::Ability
|
6
|
+
|
7
|
+
base_url = "https://analytics.wasya.co/index.php?force_api_session=1&module=API&format=JSON&"
|
8
|
+
opts = {
|
9
|
+
"method" => "Actions.getPageUrls",
|
10
|
+
"token_auth" => ANALYTICS_TOKEN,
|
11
|
+
"idDimension" => 1,
|
12
|
+
"idSite" => 2,
|
13
|
+
"period" => "day",
|
14
|
+
"date" => "#{(Time.now - 3.months ).to_date.to_s},#{Time.now.to_date.to_s}",
|
15
|
+
}
|
16
|
+
api_url = "&idDimension=1&idSite=2&period=day&date=2023-07-01,2023-09-01"
|
17
|
+
cids = []
|
18
|
+
reports = {}
|
19
|
+
|
20
|
+
inns = HTTParty.get( "#{base_url}#{opts.to_query}" )
|
21
|
+
inns = JSON.parse( inns.body )
|
22
|
+
|
23
|
+
inns.each do |date, items|
|
24
|
+
items.each do |item|
|
25
|
+
|
26
|
+
path = item['label']
|
27
|
+
if path[0] != '/'
|
28
|
+
path = "/#{path}"
|
29
|
+
end
|
30
|
+
|
31
|
+
cid = path[/.*cid=([\d]*)/,1]&.to_i
|
32
|
+
if cid
|
33
|
+
cids.push cid
|
34
|
+
reports[cid] ||= []
|
35
|
+
reports[cid].push "#{date} :: #{path}"
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
cids = cids.uniq.compact
|
41
|
+
leads_h = Lead.find_to_h cids
|
42
|
+
@reports = {}
|
43
|
+
|
44
|
+
reports.each do |k, v|
|
45
|
+
email = leads_h[k].email
|
46
|
+
@reports[email] = v
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
50
|
+
|
51
|
+
end
|
@@ -4,6 +4,9 @@ class ::IshManager::UnsubscribesController < IshManager::ApplicationController
|
|
4
4
|
def index
|
5
5
|
authorize! :index, Ish::EmailUnsubscribe
|
6
6
|
@unsubscribes = Ish::EmailUnsubscribe.all
|
7
|
+
lead_ids = @unsubscribes.map(&:lead_id).compact
|
8
|
+
@leads_h = Lead.find_to_h( lead_ids )
|
9
|
+
puts! @leads_h, 'ddz'
|
7
10
|
end
|
8
11
|
|
9
12
|
end
|
@@ -1,17 +1,19 @@
|
|
1
1
|
|
2
2
|
.unsubscribes-index.maxwidth
|
3
|
+
%h5 Unsubscribes
|
3
4
|
|
4
5
|
%table.bordered.data-table
|
5
6
|
%thead
|
6
7
|
%tr
|
7
|
-
%td
|
8
|
+
%td Lead
|
8
9
|
%td Date
|
9
10
|
%td campaign_id
|
10
11
|
%td template_id
|
11
12
|
|
13
|
+
|
12
14
|
- @unsubscribes.each do |i|
|
13
15
|
%tr
|
14
|
-
%td= i.
|
16
|
+
%td= @leads_h[i.lead_id]
|
15
17
|
%td= i.unsubscribed_at
|
16
18
|
%td= i.campaign
|
17
19
|
%td= i.template
|
data/config/routes.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ish_manager
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.8.
|
4
|
+
version: 0.1.8.488
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- piousbox
|
@@ -481,6 +481,7 @@ files:
|
|
481
481
|
- app/assets/stylesheets/ish_manager/vendor/jquery-ui.css
|
482
482
|
- app/assets/stylesheets/ish_manager/vendor/summernote-bs4.min.css
|
483
483
|
- app/assets/stylesheets/ish_manager/videos.scss
|
484
|
+
- app/controllers/ish_manager/analytics_controller.rb
|
484
485
|
- app/controllers/ish_manager/appliance_tmpls_controller.rb
|
485
486
|
- app/controllers/ish_manager/appliances_controller.rb
|
486
487
|
- app/controllers/ish_manager/application_controller.rb
|
@@ -567,6 +568,7 @@ files:
|
|
567
568
|
- app/views/202212 Mailchimp Templates/202212 theme subtle.html
|
568
569
|
- app/views/202212 Mailchimp Templates/202212 theme ticket.html
|
569
570
|
- app/views/202212 Mailchimp Templates/202212 theme whale.html
|
571
|
+
- app/views/ish_manager/analytics/test.haml
|
570
572
|
- app/views/ish_manager/appliance_tmpls/_form.haml
|
571
573
|
- app/views/ish_manager/appliance_tmpls/index.haml
|
572
574
|
- app/views/ish_manager/appliances/_form.haml
|