crowdskout 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/crowdskout.gemspec +1 -1
- data/lib/crowdskout/components/quartermaster/tracking_code.rb +44 -29
- data/lib/crowdskout/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9c11e380a90d3eed4822ce3fd700ca4b7731bd34
|
|
4
|
+
data.tar.gz: bd92f540abcdaddf24694a9858a83f70997af221
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e73e26b0550180cc3f53aed283b602b3b4f671c071bbfacbecd96f3d1eca6335cf5c7ba76300ad501dc172626805afe6cedf4f83393e6696c9e9e5cfed0cd50e
|
|
7
|
+
data.tar.gz: 732de1f2827176b0328c65539c7f54f2d84ee0fc5d65703e62409da3a9879b041c093c92da343b1f5782afd03bf8e00fbd494ded9d56458d289ede9e25aa5434
|
data/crowdskout.gemspec
CHANGED
|
@@ -5,7 +5,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
|
5
5
|
|
|
6
6
|
Gem::Specification.new do |s|
|
|
7
7
|
s.name = "crowdskout"
|
|
8
|
-
s.version = '0.1.
|
|
8
|
+
s.version = '0.1.2'
|
|
9
9
|
s.platform = Gem::Platform::RUBY
|
|
10
10
|
s.authors = ["Crowdskout", "Revv","Kyle Schutt"]
|
|
11
11
|
s.homepage = "https://github.com/revvco/crowdskout"
|
|
@@ -29,37 +29,52 @@ module Crowdskout
|
|
|
29
29
|
%{
|
|
30
30
|
<!-- Crowdskout -->
|
|
31
31
|
<script>
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
32
|
+
(function(s,k,o,u,t){
|
|
33
|
+
s.cs=s.cs||function(){cs.q.push(arguments);};
|
|
34
|
+
cs.q=cs.q||[];cs.apiUrl=t;
|
|
35
|
+
s.sourceId = #{source};s.clientId = #{client};s.organizationId = #{organization};
|
|
36
|
+
var a=k.getElementsByTagName(o)[0];var b=k.createElement(o);b.src=u+'/analytics.js';
|
|
37
|
+
b.onreadystatechange = b.onload = function() {
|
|
38
|
+
if ((!b.readyState || /loaded|complete/.test(b.readyState))) {
|
|
39
|
+
s._csCalledBackup = s._csCalled;
|
|
40
|
+
s._csCalled = function(type, body) {
|
|
41
|
+
if (type === 'page-view') {
|
|
42
|
+
s.cspageviewuuid = body.uuid;
|
|
43
|
+
}
|
|
44
|
+
if (s._csCalledBackup) {
|
|
45
|
+
s._csCalledBackup(type, body);
|
|
46
|
+
}
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
49
|
+
};
|
|
50
|
+
a.parentNode.insertBefore(b,a);
|
|
51
|
+
})(window,document,'script','//s.crowdskout.com','https://a.crowdskout.com');
|
|
52
|
+
</script>
|
|
53
|
+
}
|
|
54
|
+
else
|
|
55
|
+
%{
|
|
56
|
+
Tracking Codes Error
|
|
57
|
+
Source: #{source}
|
|
58
|
+
Organization: #{organization}
|
|
59
|
+
Client: #{client}
|
|
60
|
+
}
|
|
61
|
+
end
|
|
61
62
|
end
|
|
62
|
-
|
|
63
|
+
|
|
64
|
+
# Generate the crowdskout tracking source without script tags and minimized based on the codes
|
|
65
|
+
# @return [String] javascript function with the tracking information
|
|
66
|
+
def tracking_code_source_no_script
|
|
67
|
+
if !source.nil? && !organization.nil? && !client.nil?
|
|
68
|
+
script = "(function(s,k,o,u,t){s.cs=s.cs||function(){cs.q.push(arguments);};cs.q=cs.q||[];cs.apiUrl=t;s.sourceId = #{source};s.clientId = #{client};s.organizationId = #{organization};var a=k.getElementsByTagName(o)[0];var b=k.createElement(o);b.src=u+'/analytics.js';b.onreadystatechange = b.onload = function() {if ((!b.readyState || /loaded|complete/.test(b.readyState))) {s._csCalledBackup = s._csCalled;s._csCalled = function(type, body) {if (type === 'page-view') {s.cspageviewuuid = body.uuid;} if (s._csCalledBackup) {s._csCalledBackup(type, body);}};}};a.parentNode.insertBefore(b,a);})(window,document,'script','//s.crowdskout.com','https://a.crowdskout.com');"
|
|
69
|
+
else
|
|
70
|
+
%{
|
|
71
|
+
Tracking Codes Error
|
|
72
|
+
Source: #{source}
|
|
73
|
+
Organization: #{organization}
|
|
74
|
+
Client: #{client}
|
|
75
|
+
}
|
|
63
76
|
end
|
|
64
77
|
end
|
|
65
|
-
end
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
end
|
data/lib/crowdskout/version.rb
CHANGED