NAME
WWW::Analytics::MultiTouch - Multi-touch web analytics, using Google Analytics
SYNOPSIS
use WWW::Analytics::MultiTouch;
# Simple, all-in-one approach
WWW::Analytics::MultiTouch->process(user => $username,
pass => $password,
id => $analytics_id,
start_date => '2010-01-01',
end_date => '2010-02-01',
filename => 'report.xls');
# Or step by step
my $mt = WWW::Analytics::MultiTouch->new(user => $username,
pass => $password,
id => $analytics_id);
$mt->get_data(start_date => '2010-01-01',
end_date => '2010-02-01');
$mt->summarise(window_length => 45);
$mt->report(filename => 'report-45day.xls');
$mt->summarise(window_length => 30);
$mt->report(filename => 'report-30day.xls');
DESCRIPTION
This module provides reporting for multi-touch web analytics, as described at http://www.multitouchanalytics.com.
Unlike typical last-session attribution web analytics, multi-touch gives insight into all of the various marketing channels to which a visitor is exposed before finally making the decision to buy.
Multi-touch analytics uses a javascript library to send information from a web user's browser to Google Analytics for raw data collection; this module uses the Google Analytics API to collate the data and then summarises it in a spreadsheet, showing (for example):
Summary of marketing channels and number of transactions to which each channel had some contribution (sum of transactions > total transactions)
Summary of channels and fair attribution of transactions (sum of transactions = total transactions)
-item * List of each transaction and the contributing channels
BASIC USAGE
process
WWW::Analytics::MultiTouch->process(%options)
The process() function integrates all of the steps required to generate a report into one, i.e. it creates a WWW::Analytics::MultiTouch object, fetches data from the Google Analytics API, summarises the data and generates a report.
Options available are all of the options for new, get_data, summarise and report. Minimum options are user, pass, id, and typically start_date, end_date and filename.
Typically the most time consuming part of the process is fetching the data from Google. The process() function is suitable if only one set of parameters is to be used for the reports; to generate multiple reports using, for example, different attribution windows, it is more efficient to use the full API to fetch the data once and then run all the needed reports.
METHODS
new
my $mt = WWW::Analytics::MultiTouch->new(%options)
Creates a new WWW::Analytics::MultiTouch object.
Options are:
user, pass, id
These are the Google Analytics username, password and reporting ID respectively. These parameters are mandatory.
event_category
The name of the event category used in Google Analytics to store multi-touch data. Defaults to 'multitouch' and only needs to be changed if the equivalent variable in the associated javascript library has been customised.
fieldsep, recsep
Field and record separators for stored multi-touch data. These default to '!' and '*' respectively and only need to be changed if the equivalent variables in the associated javascript library has been customised.
patsep
The pattern separator for turning source, medium and subcategory information into a "channel" identifier. See the
channel_pattern
option under summarise for more information. Defaults to '-'.debug
Enable debug output.
get_data
$mt->get_data(%options)
Get data via the Google Analytics API.
Options are:
start_date, end_date
Start and end dates respectively. The total interval includes both start and end dates. Date format is YYYY-MM-DD or YYYYMMDD.
summarise
$mt->summarise(%options)
Summarise data.
Options are:
window_length
The analysis window length, in days. Only touches this many days prior to any given order will be included in the analysis.
single_order_model
If set, any touch is counted only once, toward the next order only; subsequent repeat orders do not include touches prior to the initial order.
channel_pattern
Each "channel" is derived from the Google source (source), Google medium (med) and a subcategory (subcat) field that can be set in the javascript calls, joined using the pattern separator patsep (defined in new, default '-').
For example, the source might be 'yahoo' or 'google' and the medium 'organic' or 'cpc'. To see a report on channels yahoo-organic, google-organic, google-cpc etc, the channel pattern would be 'source-med'. To see the report just at the search engine level, channel pattern would be 'source', and to see the report just at the medium level, the channel pattern would be 'med'.
Arbitrary ordering is permissible, e.g. med-subcat-source.
The default channel pattern is 'source-med-subcat'.
report
$mt->report(%options)
Generate reports.
Options are:
filename
Name of file in which to save reports. If not specified, output is sent to STDOUT. The filename extension, if given, is used to determine the file format, which can be xls, csv or txt.
format
May be set to xls, csv or txt to specify Excel, CSV and Text format output respectively. The filename extension takes precedence over this parameter.
title
Title to insert into reports.
all_touches
If set, the generated report includes the all-touches report; enabled by default. The all-touches report shows, for each channel, the total number of transactions and the total revenue amount in which that channel played a role. Since multiple channels may have contributed to each transaction, the total of all transactions across all channels will exceed the actual number of transactions.
distributed_touches
If set, the generated report includes the distributed-touches report; enabled by default. The distributed-touches report shows, for each channel, a number of transactions and revenue amount in proportion to the number of touches for that channel. Since each individual transaction is distributed across the contributing channels, the total of all transactions (revenue) across all channels will equal the actual number of transactions (revenue).
transactions
If set, the generated report includes transactions report; enabled by default. The transactions report lists each transaction and the channels that contributed to it.
RELATED INFORMATION
See http://www.multitouchanalytics.com for further details.
AUTHOR
Jon Schutz, <jon at jschutz.net>
BUGS
Please report any bugs or feature requests to bug-www-analytics-multitouch at rt.cpan.org
, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=WWW-Analytics-MultiTouch. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
SUPPORT
You can find documentation for this module with the perldoc command.
perldoc WWW::Analytics::MultiTouch
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=WWW-Analytics-MultiTouch
AnnoCPAN: Annotated CPAN documentation
CPAN Ratings
Search CPAN
COPYRIGHT & LICENSE
Copyright 2010 YourAmigo Ltd.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.