Mojolicious::Plugin::GoogleAnalytics - Mojolicious Plugin
# Mojolicious $self->plugin('GoogleAnalytics'); # Mojolicious::Lite plugin 'GoogleAnalytics'; # In your layout template <%= analytics_inc 'UA-32432-1', 'example.com', 1 %> </head> <!-- Make sure its just before closing head tag -->
Mojolicious::Plugin::GoogleAnalytics is a Mojolicious plugin. Inserts Google Analytics code and associates your analytics id.
Mojolicious::Plugin::GoogleAnalytics inherits all methods from Mojolicious::Plugin and implements the following new ones.
$plugin->register(Mojolicious->new);
Register plugin in Mojolicious application.
Put the domain which qualifies any subdomains you wish to track, eg. blog.example.com, apps.example.com will have the second arguement set to 'example.com'
Default is set to 1 to allow domains such as example.fr, example.cn, and example.com
Adam Stokes <adamjs@cpan.org>
Copyright 2013- Adam Stokes
Licensed under the same terms as Perl.
Mojolicious, Mojolicious::Guides, http://mojolicio.us.
To install Mojolicious::Plugin::GoogleAnalytics, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mojolicious::Plugin::GoogleAnalytics
CPAN shell
perl -MCPAN -e shell install Mojolicious::Plugin::GoogleAnalytics
For more information on module installation, please visit the detailed CPAN module installation guide.