Sha256: ff042f84e7bea15c7809e150b43a8158ef7434763773804b38d2456e45ee3552

Contents?: true

Size: 1.03 KB

Versions: 35

Compression:

Stored size: 1.03 KB

Contents

<%
sc = site.social_config
if sc.auto_ga_js && sc.google_analytics_id 
%>
  <script>
    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
    (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
    m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
    })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
    ga('create', '<%= raw sc.google_analytics_id %>', 'auto');
    ga('send', 'pageview');
    <% if ga_events && ga_events.count > 0 %>    
      <% ga_events.each do |arr| %>
        <%
        cat    = arr[0] ? arr[0] : nil 
        action = arr[1] ? arr[1] : nil 
        label  = arr[2] ? arr[2] : nil 
        value  = arr[3] ? arr[3] : nil
        arr2 = [cat, action]
        arr2 << (label ? label : '') if label || (label.nil? && value)    
        arr2 << value if value          
        %>
    ga('send', 'event'<% arr2.each do |x| %>, <%= raw Caboose.json(x) %><% end %>);
      <% end %>    
    <% end %>
  </script>
<% end %>

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
caboose-cms-0.6.16 app/views/caboose/blocks/_ga.html.erb
caboose-cms-0.6.15 app/views/caboose/blocks/_ga.html.erb
caboose-cms-0.6.14 app/views/caboose/blocks/_ga.html.erb
caboose-cms-0.6.13 app/views/caboose/blocks/_ga.html.erb
caboose-cms-0.6.12 app/views/caboose/blocks/_ga.html.erb
caboose-cms-0.6.11 app/views/caboose/blocks/_ga.html.erb
caboose-cms-0.6.10 app/views/caboose/blocks/_ga.html.erb
caboose-cms-0.6.9 app/views/caboose/blocks/_ga.html.erb
caboose-cms-0.6.8 app/views/caboose/blocks/_ga.html.erb
caboose-cms-0.6.7 app/views/caboose/blocks/_ga.html.erb
caboose-cms-0.6.6 app/views/caboose/blocks/_ga.html.erb
caboose-cms-0.6.5 app/views/caboose/blocks/_ga.html.erb
caboose-cms-0.6.4 app/views/caboose/blocks/_ga.html.erb
caboose-cms-0.6.3 app/views/caboose/blocks/_ga.html.erb
caboose-cms-0.6.2 app/views/caboose/blocks/_ga.html.erb
caboose-cms-0.6.1 app/views/caboose/blocks/_ga.html.erb
caboose-cms-0.5.238 app/views/caboose/blocks/_ga.html.erb
caboose-cms-0.5.237 app/views/caboose/blocks/_ga.html.erb
caboose-cms-0.5.236 app/views/caboose/blocks/_ga.html.erb
caboose-cms-0.5.235 app/views/caboose/blocks/_ga.html.erb