Net-Google-Analytics-MeasurementProtocol
This is a Perl interface to Google Analytics Measurement Protocol, allowing developers to make HTTP requests to send raw user interaction data directly to Google Analytics servers. It can be used to tie online to offline behaviour, sending analytics data from both the web (via JavaScript) and from the server (via this module).
use Net::Google::Analytics::MeasurementProtocol;
my $ga = Net::Google::Analytics::MeasurementProtocol->new(
tid => 'UA-XXXX-Y',
);
# Now, instead of this JavaScript:
# ga('send', 'pageview', {
# 'dt': 'my new title'
# });
# you can do this, in Perl:
$ga->send( 'pageview', {
dt => 'my new title',
dl => 'http://www.example.com/some/page',
});
See Google's complete parameter reference for all the options you can pass.
Installation
cpanm Net::Google::Analytics::MeasurementProtocol
or manually:
perl Makefile.PL
make test
make install
Please refer to this module's complete documentation for extra information.