Google AnalyticsUser Guide
Overview
Google Analytics is a support library that aids the development of other Alien-Factory libraries and frameworks. Though you are welcome to use it, you may find features are missing and the documentation incomplete.
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
Or to install manually, download the pod from Status302 and copy it to %FAN_HOME%/lib/fan/.
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:
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>
...
<% afGua.renderGoogleAnalytics() %>
</body>
</html>
Release Notes
v0.0.2
- New: Preview Release