lib/insales/yandex_metrika.rb
def add_yandex_metrika_code(options = {})
      if YandexMetrika.defer_load
        append_to_body(/<\/body>/i, "#{yandex_metrika_code(options)}</body>")
      else
        append_to_body(/(<body[^>]*>)/i, "\\1#{yandex_metrika_code(options)}")
      end
    end
# An after_filter to automatically add the analytics code.
# If you intend to use the link_to_tracked view helpers, you need to set Insales::YandexMetrika.defer_load = false
# to load the code at the top of the page
An after_filter to automatically add the analytics code.
If you intend to use the link_to_tracked view helpers, you need to set Insales::YandexMetrika.defer_load = false
to load the code at the top of the page
An after_filter to automatically add the analytics code . If you intend to use the link_to_tracked view helpers you need to set Insales :: YandexMetrika . defer_load = false to load the code at the top of the page
def add_yandex_metrika_code(options = {})
      if YandexMetrika.defer_load
        append_to_body(/<\/body>/i, "#{yandex_metrika_code(options)}</body>")
      else
        append_to_body(/(<body[^>]*>)/i, "\\1#{yandex_metrika_code(options)}")
      end
    end
def add_yandex_metrika_code ( options = { } ) if YandexMetrika . defer_load append_to_body ( / < \/ body> /i , "#{yandex_metrika_code(options)}</body>" ) else append_to_body ( / (<body[^>]*>) /i , "\\1#{yandex_metrika_code(options)}" ) end end
An after_filter to automatically add the analytics code.
An after_filter to automatically add the analytics code .
options