Commit 7e544167 authored by danielgrippi's avatar danielgrippi
Browse files

finally fixed analytics helper [ci skip]

parent 786a0be8
......@@ -6,10 +6,10 @@ module AnalyticsHelper
def include_mixpanel
include_analytics "mixpanel" do |service_uid|
javascript_tag do
<<-JS
<<-JS.html_safe
(function(d,c){var a,b,g,e;a=d.createElement('script');a.type='text/javascript';a.async=!0;a.src=('https:'===d.location.protocol?'https:':'http:')+'//api.mixpanel.com/site_media/js/api/mixpanel.2.js';b=d.getElementsByTagName('script')[0];b.parentNode.insertBefore(a,b);c._i=[];c.init=function(a,d,f){var b=c;'undefined'!==typeof f?b=c[f]=[]:f='mixpanel';g='disable track track_pageview track_links track_forms register register_once unregister identify name_tag set_config'.split(' ');
for(e=0;e<g.length;e++)(function(a){b[a]=function(){b.push([a].concat(Array.prototype.slice.call(arguments,0)))}})(g[e]);c._i.push([a,d,f])};window.mixpanel=c})(document,[]);
mixpanel.init(#{service_uid});
mixpanel.init("#{AppConfig[:mixpanel_uid]}");
JS
end
end
......@@ -24,7 +24,7 @@ module AnalyticsHelper
include_analytics "chartbeat" do |service_uid|
javascript_tag do
<<-JS
var _sf_async_config = { uid: #{service_uid}, domain: '#{AppConfig[:pod_uri].host}' };
var _sf_async_config = { uid: #{AppConfig[:mixpanel_uid]}, domain: '#{AppConfig[:pod_uri].host}' };
(function() {
function loadChartbeat() {
window._sf_endpt = (new Date()).getTime();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment