Sha256: a5b19c031d6d0cf784019d9c3c3146ff9bab747ed53e831972f8690fdd2a8f6e

Contents?: true

Size: 557 Bytes

Versions: 15

Compression:

Stored size: 557 Bytes

Contents

module JtRailsToolboxHelper

	def google_anaytics_tag(tracking_id)
		if Rails.env.production? && !tracking_id.blank?
			javascript_tag do
				"(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', '#{tracking_id}', 'auto');
ga('send', 'pageview');".html_safe
			end
		end
	end

end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
jt-rails-toolbox-2.8.1 app/helpers/jt_rails_toolbox_helper.rb
jt-rails-toolbox-2.8.0 app/helpers/jt_rails_toolbox_helper.rb
jt-rails-toolbox-2.7.0 app/helpers/jt_rails_toolbox_helper.rb
jt-rails-toolbox-2.6.0 app/helpers/jt_rails_toolbox_helper.rb
jt-rails-toolbox-2.5.0 app/helpers/jt_rails_toolbox_helper.rb
jt-rails-toolbox-2.4.3 app/helpers/jt_rails_toolbox_helper.rb
jt-rails-toolbox-2.4.2 app/helpers/jt_rails_toolbox_helper.rb
jt-rails-toolbox-2.4.1 app/helpers/jt_rails_toolbox_helper.rb
jt-rails-toolbox-2.4.0 app/helpers/jt_rails_toolbox_helper.rb
jt-rails-toolbox-2.3.1 app/helpers/jt_rails_toolbox_helper.rb
jt-rails-toolbox-2.3.0 app/helpers/jt_rails_toolbox_helper.rb
jt-rails-toolbox-2.2.2 app/helpers/jt_rails_toolbox_helper.rb
jt-rails-toolbox-2.2.1 app/helpers/jt_rails_toolbox_helper.rb
jt-rails-toolbox-2.2.0 app/helpers/jt_rails_toolbox_helper.rb
jt-rails-toolbox-2.1.0 app/helpers/jt_rails_toolbox_helper.rb