NAME
WWW::Tracking::Data::Plugin::GoogleAnalytics - serialize to Google Analytics URL
SYNOPSIS
use WWW::Tracking;
use WWW::Tracking::Data::Plugin::GoogleAnalytics;
my $wt = WWW::Tracking->new(
'tracker_account' => 'MO-9226801-5',
'tracker_type' => 'ga',
);
$wt->from(
'headers' => {
'headers' => $headers,
'request_uri' => $request_uri,
'remote_ip' => $remote_ip,
'visitor_cookie_name' => $VISITOR_COOKIE_NAME,
},
);
my $visitor_id = $wt->data->visitor_id;
my $tracking_cookie = Apache2::Cookie->new(
$apache,
'-name' => $VISITOR_COOKIE_NAME,
'-value' => $visitor_id,
'-expires' => '+3M',
'-path' => '/',
);
$tracking_cookie->bake($apache);
eval { $wt->make_tracking_request; };
if ($@) {
$logger->warn('failed to do request tracking - '.$@);
}