Jozef Kutej > WWW-Tracking > WWW::Tracking::Data::Plugin::Piwik

Download:
WWW-Tracking-0.02.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.02   Source  

NAME ^

WWW::Tracking::Data::Plugin::Piwik - serialize to Piwik Tracking URL

SYNOPSIS ^

        use WWW::Tracking;
        use WWW::Tracking::Data::Plugin::Piwik;
        
    my $wt = WWW::Tracking->new(
        'tracker_account' => 5,
        'tracker_type'    => 'piwick',
                'tracker_url'     => 'http://stats.meon.eu/piwik.php',
    );
    $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 - '.$@);
    }

DESCRIPTION ^

syntax highlighting: