lib/gabba/custom_vars.rb
# Public: Renders the custom variable data in the format needed for GA
# (http://code.google.com/apis/analytics/docs/tracking/gaTrackingCustomVariables.html)
# Called before actually sending the data along to GA.
Renders the custom variable data in the format needed for GA

Called before actually sending the data along to GA.
Renders the custom variable data in the format needed for GA Called before actually sending the data along to GA .
def custom_var_data
        names  = []
        values = []
        scopes = []
        idx = 1
        @custom_vars.each_with_index do |(n, v, s), i|
          next if !n || !v || (/\w/ !~ n) || (/\w/ !~ v)
          prefix = "#{i}!" if idx != i
          names  << "#{prefix}#{escape(n)}"
          values << "#{prefix}#{escape(v)}"
          scopes << "#{prefix}#{escape(s)}"
          idx = i + 1
        end
        names.empty? ? "" : "8(#{names.join('*')})9(#{values.join('*')})11(#{scopes.join('*')})"
      end
def custom_var_data names = [ ] values = [ ] scopes = [ ] idx = 1 @custom_vars . each_with_index do | ( n , v , s ) , i | next if ! n || ! v || ( / \w / !~ n ) || ( / \w / !~ v ) prefix = "#{i}!" if idx != i names << "#{prefix}#{escape(n)}" values << "#{prefix}#{escape(v)}" scopes << "#{prefix}#{escape(s)}" idx = i + 1 end names . empty? ? "" : "8(#{names.join('*')})9(#{values.join('*')})11(#{scopes.join('*')})" end
Public: Renders the custom variable data in the format needed for GA
(http://code.google.com/apis/analytics/docs/tracking/gaTrackingCustomVariables.html)
Called before actually sending the data along to GA.
Public : Renders the custom variable data in the format needed for GA ( http : // code . google . com / apis / analytics / docs / tracking / gaTrackingCustomVariables . html ) Called before actually sending the data along to GA .