const mixinafGoogleAnalytics::GoogleAnalytics
afGoogleAnalytics::GoogleAnalytics
(Service) - Renders the Google Universal Analytics script and sends page views and events.
- accountDomain
abstract Str? accountDomain()
Returns the domain used to setup the google script.
- accountNumber
abstract Str accountNumber()
Returns the account used to setup the google script.
- pageViewRendered
abstract Bool pageViewRendered()
Returns
true
if the page has already rendered Javascript to send a page view event.This allows individual pages to send page views for canonical URLs and a layout component to send general page views if the page hasn't done so.
- sendEvent
abstract Void sendEvent(Str category, Str action, Str? label := null)
Renders Javascript to send an event to google analytics.
- sendPageView
abstract Void sendPageView(Uri? url := null)
Renders Javascript to send a page view to google analytics. If
url
is given then it should start with a leading/
, e.g. /about