This repository has been archived by the owner on Aug 10, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/backupify/analytical into…
… backupify-master
- Loading branch information
Showing
5 changed files
with
174 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
module Analytical | ||
module Modules | ||
class ClickTale | ||
include Analytical::Modules::Base | ||
|
||
def initialize(options={}) | ||
super | ||
@tracking_command_location = [:body_prepend, :body_append] | ||
end | ||
|
||
def init_javascript(location) | ||
init_location(location) do | ||
case location.to_sym | ||
when :body_prepend | ||
js = <<-HTML | ||
<!-- Analytical Init: ClickTale Top part --> | ||
<script type="text/javascript"> | ||
var WRInitTime=(new Date()).getTime(); | ||
</script> | ||
<!-- ClickTale end of Top part --> | ||
HTML | ||
js | ||
when :body_append | ||
js = <<-HTML | ||
<!-- Analytical Init: ClickTale Bottom part --> | ||
<div id="ClickTaleDiv" style="display: none;"></div> | ||
<script type='text/javascript'> | ||
document.write(unescape("%3Cscript%20src='"+ | ||
(document.location.protocol=='https:'? | ||
'https://clicktale.pantherssl.com/': | ||
'http://s.clicktale.net/')+ | ||
"WRb6.js'%20type='text/javascript'%3E%3C/script%3E")); | ||
</script> | ||
<script type="text/javascript"> | ||
var ClickTaleSSL=1; | ||
if(typeof ClickTale=='function') ClickTale(#{@options[:project_id]},#{@options[:site_traffic]},"www"); | ||
</script> | ||
<!-- ClickTale end of Bottom part --> | ||
HTML | ||
js | ||
end | ||
end | ||
end | ||
|
||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
module Analytical | ||
module Modules | ||
class GoogleOptimizer | ||
include Analytical::Modules::Base | ||
|
||
def initialize(options={}) | ||
super | ||
@tracking_command_location = :head_prepend | ||
end | ||
|
||
def init_javascript(location) | ||
init_location(location) do | ||
js = <<-HTML | ||
<!-- Analytical Init: Google Website Optimizer Control Script --> | ||
<script> | ||
function utmx_section(){}function utmx(){} | ||
(function(){var k='#{options[:key]}',d=document,l=d.location,c=d.cookie;function f(n){ | ||
if(c){var i=c.indexOf(n+'=');if(i>-1){var j=c.indexOf(';',i);return c.substring(i+n. | ||
length+1,j<0?c.length:j)}}}var x=f('__utmx'),xx=f('__utmxx'),h=l.hash; | ||
d.write('<sc'+'ript src="'+ | ||
'http'+(l.protocol=='https:'?'s://ssl':'://www')+'.google-analytics.com' | ||
+'/siteopt.js?v=1&utmxkey='+k+'&utmx='+(x?x:'')+'&utmxx='+(xx?xx:'')+'&utmxtime=' | ||
+new Date().valueOf()+(h?'&utmxhash='+escape(h.substr(1)):'')+ | ||
'" type="text/javascript" charset="utf-8"></sc'+'ript>')})(); | ||
</script> | ||
<!-- End of Google Website Optimizer Control Script --> | ||
<!-- Analytical Init: Google Website Optimizer Tracking Script --> | ||
<script type="text/javascript"> | ||
if(typeof(_gat)!='object')document.write('<sc'+'ript src="http'+ | ||
(document.location.protocol=='https:'?'s://ssl':'://www')+ | ||
'.google-analytics.com/ga.js"></sc'+'ript>')</script> | ||
<script type="text/javascript"> | ||
try { | ||
var gwoTracker=_gat._getTracker("#{options[:account]}"); | ||
gwoTracker._trackPageview("/#{options[:key]}/test"); | ||
}catch(err){}</script> | ||
<!-- End of Google Website Optimizer Tracking Script --> | ||
HTML | ||
js | ||
end | ||
end | ||
|
||
def conversion(*args) | ||
js = <<-HTML | ||
<!-- Analytical Init: Google Website Optimizer Conversion Script --> | ||
<script type="text/javascript"> | ||
if(typeof(_gat)!='object')document.write('<sc'+'ript src="http'+ | ||
(document.location.protocol=='https:'?'s://ssl':'://www')+ | ||
'.google-analytics.com/ga.js"></sc'+'ript>')</script> | ||
<script type="text/javascript"> | ||
try { | ||
var gwoTracker=_gat._getTracker("#{options[:account]}"); | ||
gwoTracker._trackPageview("/#{options[:key]}/goal"); | ||
}catch(err){}</script> | ||
<!-- End of Google Website Optimizer Conversion Script --> | ||
HTML | ||
js | ||
end | ||
|
||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
module Analytical | ||
module Modules | ||
class Loopfuse | ||
include Analytical::Modules::Base | ||
|
||
def initialize(options={}) | ||
super | ||
@tracking_command_location = :body_append | ||
end | ||
|
||
def init_javascript(location) | ||
init_location(location) do | ||
js = <<-HTML | ||
<!-- Analytical Init: LOOPFUSE TRACKING --> | ||
<script type="text/javascript"> | ||
var LFHost = (("https:" == document.location.protocol) ? "https://" : "http://"); | ||
document.write(unescape("%3Cscript src='" + LFHost + "lfov.net/webrecorder/js/listen.js' type='text/javascript'%3E%3C/script%3E")); | ||
</script> | ||
<script type="text/javascript"> | ||
_lf_cid = "#{options[:cid]}"; | ||
_lf_remora(); | ||
</script> | ||
<!-- END: LOOPFUSE TRACKING --> | ||
HTML | ||
js | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
module Analytical | ||
module Modules | ||
class Performancing | ||
include Analytical::Modules::Base | ||
|
||
def initialize(options={}) | ||
super | ||
@tracking_command_location = :body_append | ||
end | ||
|
||
def init_javascript(location) | ||
init_location(location) do | ||
js = <<-HTML | ||
<!-- Analytical Init: Performancing Metrics --> | ||
<script type="text/javascript"> | ||
var clicky = { log: function(){ return; }, goal: function(){ return; }}; | ||
var clicky_site_id = #{options[:site_id]}; | ||
(function() { | ||
var s = document.createElement('script'); | ||
s.type = 'text/javascript'; | ||
s.async = true; | ||
s.src = ( document.location.protocol == 'https:' ? 'https://pmetrics.performancing.com' : 'http://pmetrics.performancing.com' ) + '/js'; | ||
( document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0] ).appendChild( s ); | ||
})(); | ||
</script> | ||
<!-- End Performancing Metrics --> | ||
HTML | ||
js | ||
end | ||
end | ||
|
||
end | ||
end | ||
end |