zhhz / gulp-ga

Adds google analystics code into html file
MIT License
5 stars 4 forks source link

support more options #2

Closed tcurdt closed 9 years ago

tcurdt commented 9 years ago

Similar to awestruct it should support further options:

https://github.com/awestruct/awestruct/blob/master/lib/awestruct/extensions/google_analytics.rb#L61

    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]
zhhz commented 9 years ago

Done! Added those four options. Please update your package.json to 0.0.3. Let me know if you have any questions. Thanks for the link.

tcurdt commented 9 years ago

Wow! That was quick :) Thanks!