Module: IscAnalytics::ControllerSupport

Extended by:
ControllerSupport::Base
Defined in:
lib/isc_analytics/controller_support.rb

Overview

A mixin that provides access to isc_analytics API in the controller.

Instance Method Summary collapse

Instance Method Details

#add_analyticsObject

This method will generate all the javascript needed for client-side analytics tracking. This also includes server-side analytics events that were queued to the client during the current request.



22
23
24
# File 'lib/isc_analytics/controller_support.rb', line 22

def add_analytics
  analytics.analytics_script_tags
end

#analyticsObject



26
27
28
# File 'lib/isc_analytics/controller_support.rb', line 26

def analytics
  isc_analytics
end

#opt_opt?Boolean

Is the analytics tracking disabled for the current page?

Returns:

  • (Boolean)


11
12
13
# File 'lib/isc_analytics/controller_support.rb', line 11

def opt_opt?
  analytics.opt_out?
end

#opt_out!Object

This method will disable the analytics tracking of the user



16
17
18
# File 'lib/isc_analytics/controller_support.rb', line 16

def opt_out!
  analytics.opt_out!
end