Module: PiwikAnalyticsWithUser::Helpers

Defined in:
lib/piwik_analytics_with_user/helpers.rb

Instance Method Summary collapse

Instance Method Details

#piwik_tracking_tag(id_user = nil) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/piwik_analytics_with_user/helpers.rb', line 3

def piwik_tracking_tag(id_user = nil)
  config = PiwikAnalyticsWithUser.configuration
  return if config.disabled?

  if config.use_async?
    file = "piwik_analytics_with_user/piwik_tracking_tag_async"
  else
    file = "piwik_analytics_with_user/piwik_tracking_tag"
  end
  render({
    :file => file,
    :locals => {:url => config.url, :id_site => config.id_site, :id_user => id_user}
  })
end