The GoogleAnalytics
helper provides easy insertion of Google Analytics
tracking code into your site.
To use the GoogleAnalytics
helper, simply configure it into your _ext/pipeline.rb
file.
Awestruct::Extensions::Pipeline.new do
helper Awestruct::Extensions::GoogleAnalytics
end
Typically in a core HTML layout, simply invoke the helper
= google_analytics_universal({ :account => 'UA-REDACTED' })
The function takes a hash with options.
The account option with the Tracking-ID is required.
Typically in a core HTML layout, simply invoke the helper
= google_analytics({ :account => 'UA-REDACTED' })
The function takes a hash with options.
The account option with the Tracking-ID is required.
This way of doing the configuration still works but you will get a warning that there was a syntax change.
Your _config/site.yml
needs to include the property google_analytics
with your account identifier.
Property | Description |
---|---|
google_analytics |
The identifier for your Google Analytics site tracking |
google_analytics_anonymize |
if true, enforce anonymization of IPs (in async mode only) |
Typically in a core HTML layout, simply invoke the helper
= google_analytics
If you want to use Google Analytics in async mode, use
= google_analytics_async