Pluf Framework

Pluf Framework Commit Details


Date:2010-04-10 10:31:42 (14 years 8 months ago)
Author:Loic d'Anterroches
Branch:develop, master
Commit:c44b777f8544db78d65888d3fa4a76d69b089a05
Parents: 9384edc574f3c4202890861d452997cb5b225e8f
Message:Improved the stats and layout in the funnel analysis.

Changes:

File differences

src/Pluf/AB/Funnel.php
147147
148148
149149
150
151
152
153
154
155
150156
151157
152158
......
155161
156162
157163
164
158165
166
167
168
159169
160170
171
161172
162173
163174
164175
165176
177
166178
167179
168180
return array();
}
$t1 = $steps[1]['total'];
$tprops = array();
foreach ($steps[1]['props'] as $v => $t) {
$tprops[$v] = $t; // some properties are set only in the
// middle of the funnel, we get the
// value in the step.
}
for ($i=2;$i<=20;$i++) {
if ($steps[$i] and $steps[$i-1]) {
$tp = $steps[$i-1]['total'];
$steps[$i]['conv1'] = sprintf('%01.2f%%', 100.0 - (float)($t1-$tn)/$t1*100.0);
if ($prop) {
$steps[$i]['sprops'] = array();
$steps[$i]['sprops1'] = array();
foreach ($steps[$i]['props'] as $v => $t) {
if (!isset($tprops[$v])) {
$tprops[$v] = $t;
}
$pv = isset($steps[$i-1]['props'][$v]) ? $steps[$i-1]['props'][$v] : 0;
$steps[$i]['sprops'][$v] = array($t, $pv);
$steps[$i]['sprops1'][$v] = array($t, $tprops[$v]);
if ($pv) {
$steps[$i]['sprops'][$v][] = round(100*(float)$t/(float)$pv,2).'%';
} else {
$steps[$i]['sprops'][$v][] = 0;
}
$steps[$i]['sprops1'][$v][] = round(100*(float)$t/(float)$tprops[$v],2).'%';
}
}
}
src/Pluf/templates/pluf/ab/base.html
133133
134134
135135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
136161
137162
138
163
139164
165
166
167
168
169
170
140171
141172
142173
margin-top: 5px;
}
.arrowl {
font-size: 0px; line-height: 0%; width: 0px;
border-top: 10px solid #fff;
border-right: 20px solid #d3d7cf;
border-bottom: 10px solid #fff;
margin-left: -27px;
position: relative;
top: -35px;
}
.stepstats {
background-color: #d3d7cf;
position: relative;
float: left;
margin-left: 20px;
padding: 0 7px;
}
.propsstats {
background-color: #d3d7cf;
padding: 1px 15px;
width: 50%;
}
.clear{clear:both;display:block;overflow:hidden;visibility:hidden;width:0;height:0}
td {
table.funnel td {
vertical-align: bottom;
border: none;
padding-right: 30px;
margin: 0;
}
table.funnel, table.funnel tr {
margin: 0; padding: 0;
}
{/literal}
src/Pluf/templates/pluf/ab/funnel.html
55
66
77
8
8
99
10
10
1111
1212
1313
......
3939
4040
4141
42
43
4244
43
44
45
45
46
47
48
49
4650
4751
4852
......
6771
6872
6973
74
75
76
77
78
79
80
7081
7182
7283
......
7485
7586
7687
77
78
79
8088
8189
8290
<h1>Funnel {$funnel} - {$nperiod}</h1>
<table summary=" ">
<table summary=" " class="funnel">
<tr>
<td width="600">
<td width="550">
<p class="right">
<a{if $period == 'today'} class="strong"{/if} href="{url 'pluf_ab_funnel', array($funnel), array('p'=> 'today', 'prop'=> $prop)}">Today</a> |
</form>
{/if}
{elseif isset($step['props'])}{assign $stepprops = $step['sprops']}
<div class="stepstats">
{foreach $stepprops as $k=>$t}
<p><strong>{$k}</strong><br/>
{$t[0]} out of {$t[1]} visitors{if $t[2]}({$t[2]}){/if}</p>
{/foreach}
<p><strong>{$k}</strong><br>{assign $nn = $t[1]}
{$t[0]} out of {blocktrans $nn}{$nn} visitor{plural}{$nn} visitors{/blocktrans}{if $t[2]} ({$t[2]}){/if}
{/foreach}</p>
<span class="arrowl"></span>
</div>
{/if}
</td>
</tr>
<p><strong>{$stats[$i]['total']}</strong> out of {$stats['1']['total']} visitors reached step {$i} of this funnel.
This is a completion rate of <strong>{$stats[$i]['conv1']}</strong>.</p>
<div class="propsstats">{assign $stepprops = $stats[$i]['sprops1']}
<h2>Visitor Property {$prop} </h2>
{foreach $stepprops as $k=>$t}
<p><strong>{$k}</strong>: {assign $nn = $t[1]}
{$t[0]} out of {blocktrans $nn}{$nn} visitor{plural}{$nn} visitors{/blocktrans}{if $t[2]} ({$t[2]}){/if}
{/foreach}</p>
</div>
<p class="note">
Note that if a user skip a given step, this can make the results a bit
off.
{else}
<p>We do not have statistics for this period.</p>
{/if}
{*<pre>
{$stats|dump}
</pre>*}
{/block}
{block details} {*

Archive Download the corresponding diff file

Branches

Tags

Number of commits:
Page rendered in 0.05965s using 13 queries.