html += %Q(ga('create', '#{options[:account]}', 'auto');\n)
html += %Q(ga('send', 'pageview');\n)
html += %Q(ga('set', 'anonymizeIp', true);\n) if options[:anonymizeIp]
html += %Q(ga('require', 'displayfeatures');\n) if options[:demographics]
html += %Q(ga('require', 'linkid', 'linkid.js');\n) if options[:linkAttribution]
html += %Q(setTimeout("ga('send', 'event', 'read', '#{options[:bounceTime]} seconds')", #{options[:bounceTime]}000);\n) if options[:bounceTime]
Similar to
awestruct
it should support further options:https://github.com/awestruct/awestruct/blob/master/lib/awestruct/extensions/google_analytics.rb#L61