pod afGoogleAnalytics

(Internal) A simple efan component for rendering Google's Universal Analytics script

Mixins

GoogleAnalytics

(efan component) Renders the Google Universal Analytics script.

GoogleAnalyticsConfigIds

A list of required config values.

Classes

GoogleAnalyticsModule

The Ioc module class.

Overview

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.

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

Install

Install Google Analytics with the Fantom Repository Manager ( fanr ):

C:\> 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.0+"]

Documentation

Full API & fandocs are available on the Status302 repository.

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()

Release Notes

v0.0.6

v0.0.4

  • Chg: accountDomain defaults to BedSheet's host config value

v0.0.2

  • New: Preview Release