Google AnalyticsUser Guide
Overview
Google Analytics is a support library that aids Alien-Factory in the development of libraries, frameworks and applications. Though you are welcome to use it, you may find features are missing and the documentation incomplete.
Google Analytics is a simple efan component for rendering Google's Universal Analytics script.
Install
Install Google Analytics with the Fantom Respository Manager ( fanr ):
$ fanr install -r http://repo.status302.com/fanr/ afGoogleAnalytics
To use in a Fantom project, add a dependency to build.fan:
depends = ["sys 1.0", ..., "afGoogleAnalytics 0+"]
Quick Start
Set the Google Analytic account in your AppModule:
using afIoc
using afIocConig
using afGoogleAnalytics
class AppModule {
@Contribute { serviceType=ApplicationDefaults# }
static Void contributeApplicationDefaults(MappedConfig config) {
config[GoogleAnalyticsConfigIds.accountNumber] = "XX-99999999-9"
config[GoogleAnalyticsConfigIds.accountDomain] = `wotever.com`
}
}
Then render it in your efan component, you should place it just before the closing <body> tag:
<html>
<body>
...
<% afGa.renderGoogleAnalytics() %>
</body>
</html>
Or if using Slim:
html
body
...
-- afGa.renderGoogleAnalytics()
Release Notes
v0.0.4
- Chg:
accountDomaindefaults to BedSheet'shostconfig value
v0.0.2
- New: Preview Release