trueandco_analytics 0.4.2 → 0.4.3
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a6801e1de44e4ac1c62405b5b29f2e60e0635538
|
4
|
+
data.tar.gz: 174c6c8d5b5213d9f29dbde0dfc95481b7210576
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4826f0093b1ac9dedc111a0f91f4b6f2761f7af90aeeb9449d60ebd1ef12ef511a31c10376bbcc86570ba028cb68b3b0bc404d88ba12b7247ce2a2b400980dd2
|
7
|
+
data.tar.gz: 06c2ac6227efd464603d36ff7b1ca78ef839148e2c6ec37d550f1eedf3139868d85ecc2e99c9c621862cb4214dfa7848d38362e42d1e0719c5451c7694becb26
|
@@ -1,18 +1,8 @@
|
|
1
1
|
module TrueandcoAnalytics::Site::TrueandcoAnalyticsHelper
|
2
2
|
def track_user_behavior
|
3
|
-
pull_user_statistic_path = ::TrueandcoAnalytics::Engine.routes.url_helpers.receiver_pull_user_statistic_path
|
4
3
|
return unless @user_behavior.nil?
|
5
4
|
@user_behavior = 1
|
6
|
-
js_string =
|
7
|
-
var root_url = location.protocol+'//'+location.hostname+(location.port ? ':'+location.port: '')
|
8
|
-
var statistics_url = root_url + #{pull_user_statistic_path}",
|
9
|
-
app_token = "#{try(:form_authenticity_token)}",
|
10
|
-
selector = "#{::TrueandcoAnalytics::Config::Params.buy_selector}",
|
11
|
-
time_survey = "#{::TrueandcoAnalytics::Config::Params.time_survey}";
|
12
|
-
|
13
|
-
analitics_in_point(statistics_url, app_token, selector, time_survey);
|
14
|
-
|
15
|
-
USER_BEHAVIOR_TRACK
|
5
|
+
js_string = TrueandcoAnalytics.js_track("#{try(:form_authenticity_token)}")
|
16
6
|
javascript_tag js_string, defer: 'defer'
|
17
7
|
end
|
18
8
|
end
|
data/lib/trueandco_analytics.rb
CHANGED
@@ -52,4 +52,17 @@ module TrueandcoAnalytics
|
|
52
52
|
def self.setup(&block)
|
53
53
|
TrueandcoAnalytics::Config::Params.set_params(&block)
|
54
54
|
end
|
55
|
+
|
56
|
+
def self.js_track(form_authenticity_token)
|
57
|
+
pull_user_statistic_path = ::TrueandcoAnalytics::Engine.routes.url_helpers.receiver_pull_user_statistic_path
|
58
|
+
<<-USER_BEHAVIOR_TRACK
|
59
|
+
var root_url = location.protocol+'//'+location.hostname+(location.port ? ':'+location.port: '')
|
60
|
+
var statistics_url = root_url + "#{pull_user_statistic_path}",
|
61
|
+
app_token = "#{form_authenticity_token}",
|
62
|
+
selector = "#{::TrueandcoAnalytics::Config::Params.buy_selector}",
|
63
|
+
time_survey = "#{::TrueandcoAnalytics::Config::Params.time_survey}";
|
64
|
+
|
65
|
+
analitics_in_point(statistics_url, app_token, selector, time_survey);
|
66
|
+
USER_BEHAVIOR_TRACK
|
67
|
+
end
|
55
68
|
end
|