Google AnalyticsUser Guide

Google Analytics is a support library that aids Alien-Factory in the development of other libraries, frameworks and applications. Though you are welcome to use it, you may find features are missing and the documentation incomplete.

Overview

Google Analytics is a simple efan component for rendering Google's Universal Analytics script.

Quick Start

Set the Google Analytic account in your AppModule:

using afIoc
using afIocConig
using afGoogleAnalytics

class AppModule {
  @Contribute { serviceType=ApplicationDefaults# }
  static Void contributeApplicationDefaults(Configuration 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()