Class: UrchinTrackingModule
- Inherits:
-
Object
- Object
- UrchinTrackingModule
- Defined in:
- lib/urchin_tracking_module.rb,
lib/urchin_tracking_module/version.rb
Defined Under Namespace
Modules: Slicable Classes: Defaults
Constant Summary collapse
- TRACKING_PARAMETERS =
%i(utm_source utm_medium utm_term utm_content utm_campaign)
- VERSION =
"1.0.6"
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(url) ⇒ UrchinTrackingModule
constructor
A new instance of UrchinTrackingModule.
- #tracking(params = defaults) ⇒ Object
Constructor Details
#initialize(url) ⇒ UrchinTrackingModule
Returns a new instance of UrchinTrackingModule.
16 17 18 |
# File 'lib/urchin_tracking_module.rb', line 16 def initialize(url) @url = url end |
Class Method Details
.configure(&block) ⇒ Object
57 58 59 |
# File 'lib/urchin_tracking_module.rb', line 57 def self.configure(&block) Defaults.configure(&block) end |
Instance Method Details
#tracking(params = defaults) ⇒ Object
20 21 22 23 24 25 26 27 28 |
# File 'lib/urchin_tracking_module.rb', line 20 def tracking(params=defaults) filtered_params(params).inject(@url) do |url,(name,value)| unless value.nil? url = add_param(url, "#{name}", value) url = add_param(url, "src", value) if name == :utm_source end url end end |