Skip to content
This repository
tree: 3ac47e89eb
Fetching contributors…

Cannot retrieve contributors at this time

file 316 lines (285 sloc) 14.841 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 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 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316
<div class="visitorLog dataTable" data-report="{$properties.uniqueId}" data-params="{$javascriptVariablesToSet|@json_encode|escape:'html'}">

{if !$isWidget}
<h2>{if $javascriptVariablesToSet.filterEcommerce}{'Goals_EcommerceLog'|translate}{else}{'Live_VisitorLog'|translate}{/if}</h2>
{if !empty($reportDocumentation)}
<div class="reportDocumentation"><p>{$reportDocumentation}</p></div>
{/if}
{/if}
{capture assign='displayVisitorsInOwnColumn'}{if $isWidget}0{else}1{/if}{/capture}

<a graphid="VisitsSummarygetEvolutionGraph" name="evolutionGraph"></a>

{if isset($arrayDataTable.result) and $arrayDataTable.result == 'error'}
{$arrayDataTable.message}
{else}
{if count($arrayDataTable) == 0}
<a name="{$properties.uniqueId}"></a>
<div class="pk-emptyDataTable">{'CoreHome_ThereIsNoDataForThisReport'|translate}</div>
{else}
<a name="{$properties.uniqueId}"></a>

<table class="dataTable" cellspacing="0" width="100%" style="width:100%;">
<thead>
<tr>
<th style="display:none"></th>
<th id="label" class="sortable label" style="cursor: auto;width:12%" width="12%">
<div id="thDIV">{'General_Date'|translate}<div></th>
{if $displayVisitorsInOwnColumn}
<th id="label" class="sortable label" style="cursor: auto;width:13%" width="13%">
<div id="thDIV">{'General_Visitors'|translate}<div></th>
{/if}
<th id="label" class="sortable label" style="cursor: auto;width:15%" width="15%">
<div id="thDIV">{'Live_Referrer_URL'|translate}<div></th>
<th id="label" class="sortable label" style="cursor: auto;width:62%" width="62%">
<div id="thDIV">{'General_ColumnNbActions'|translate}<div></th>
</tr>
</thead>
<tbody>

{foreach from=$arrayDataTable item=visitor}

{capture assign='visitorColumnContent'}
&nbsp;<img src="{$visitor.columns.countryFlag}" title="{$visitor.columns.location|escape:'html'}, Provider {$visitor.columns.provider|escape:'html'}" />
&nbsp;<img src="{$visitor.columns.browserIcon}" title="{$visitor.columns.browserName} with plugins {$visitor.columns.plugins} enabled" />
&nbsp;<img src="{$visitor.columns.operatingSystemIcon}" title="{$visitor.columns.operatingSystem}, {$visitor.columns.resolution} ({$visitor.columns.screenType})" />
{if $visitor.columns.visitorTypeIcon}
{if !empty($visitor.columns.visitorId)}
<a class="rightLink" href="javascript:Piwik_Live_LoadVisitorPopover('{$visitor.columns.visitorId}')">
{/if}
&nbsp;- <img src="{$visitor.columns.visitorTypeIcon}" title="{'General_ReturningVisitor'|translate}{if !empty($visitor.columns.visitorId)} - {'General_ReturningVisitorAllVisits'|translate}{/if}" />
{if !empty($visitor.columns.visitorId)}</a>{/if}
{/if}
{if !$displayVisitorsInOwnColumn} <br/> <br/> {/if}
&nbsp;{if $visitor.columns.visitConverted}
<span title="{'General_VisitConvertedNGoals'|translate:$visitor.columns.goalConversions}" class='visitorRank' {if !$displayVisitorsInOwnColumn}style='margin-left:0'{/if}>
<img src="{$visitor.columns.visitConvertedIcon}" />
<span class='hash'>#</span>{$visitor.columns.goalConversions}
{if $visitor.columns.visitEcommerceStatusIcon}
&nbsp;- <img src="{$visitor.columns.visitEcommerceStatusIcon}" title="{$visitor.columns.visitEcommerceStatus}"/>
{/if}
</span>{/if}
<br/>
{if $displayVisitorsInOwnColumn}
{if count($visitor.columns.pluginsIcons) > 0}
<hr/>
{'UserSettings_Plugins'|translate}:
{foreach from=$visitor.columns.pluginsIcons item=pluginIcon name=plugins}
<img src="{$pluginIcon.pluginIcon}" title="{$pluginIcon.pluginName|capitalize:true}" alt="{$pluginIcon.pluginName|capitalize:true}" />
{/foreach}
{/if}
{/if}
{/capture}
{capture assign='visitorRow'}
<tr class="label{cycle values='odd,even'}">
<td style="display:none;"></td>
<td class="label" style="width:12%" width="12%">
<strong title="{if $visitor.columns.visitorType=='new'}{'General_NewVisitor'|translate}{else}{'Live_VisitorsLastVisit'|translate:$visitor.columns.daysSinceLastVisit}{/if}">
{$visitor.columns.serverDatePrettyFirstAction}
{if $isWidget}<br/>{else}-{/if} {$visitor.columns.serverTimePrettyFirstAction}</strong>
{if !empty($visitor.columns.visitIp)} <br/><span title="{if !empty($visitor.columns.visitorId)}{'General_VisitorID'|translate}: {$visitor.columns.visitorId}{/if}{if $visitor.columns.latitude || $visitor.columns.longitude}

GPS (lat/long): {$visitor.columns.latitude|escape:'html'},{$visitor.columns.longitude|escape:'html'}{/if}">IP: {$visitor.columns.visitIp}</span>{/if}
{if (isset($visitor.columns.provider)&&$visitor.columns.provider!='IP')}
<br />
{'Provider_ColumnProvider'|translate}:
<a href="{$visitor.columns.providerUrl}" target="_blank" title="{$visitor.columns.providerUrl}" style="text-decoration:underline;">
{$visitor.columns.provider}
</a>
{/if}
{if !empty($visitor.columns.customVariables)}
<br/>
{foreach from=$visitor.columns.customVariables item=customVariable key=id}
{capture assign=name}customVariableName{$id}{/capture}
{capture assign=value}customVariableValue{$id}{/capture}
<br/><acronym title="{'CustomVariables_CustomVariables'|translate} (index {$id})">{$customVariable.$name|truncate:30:"...":true|escape:'html'}</acronym>{if strlen($customVariable.$value)>0}: {$customVariable.$value|truncate:50:"...":true|escape:'html'}{/if}
{/foreach}
{/if}
{if !$displayVisitorsInOwnColumn}
<br/>
{$visitorColumnContent}
{/if}
</td>
{if $displayVisitorsInOwnColumn}
<td class="label" style="width:13%" width="13%">
{$visitorColumnContent}
</td>
{/if}
<td class="column" style="width:20%" width="20%">
<div class="referer">
{if $visitor.columns.referrerType == 'website'}
{'Referers_ColumnWebsite'|translate}:
<a href="{$visitor.columns.referrerUrl|escape:'html'}" target="_blank" title="{$visitor.columns.referrerUrl|escape:'html'}" style="text-decoration:underline;">
{$visitor.columns.referrerName|escape:'html'}
</a>
{/if}
{if $visitor.columns.referrerType == 'campaign'}
{'Referers_ColumnCampaign'|translate}
<br />
{$visitor.columns.referrerName|escape:'html'}
{if !empty($visitor.columns.referrerKeyword)} - {$visitor.columns.referrerKeyword|escape:'html'}{/if}
{/if}
{if $visitor.columns.referrerType == 'search'}
{if !empty($visitor.columns.searchEngineIcon)}
<img src="{$visitor.columns.searchEngineIcon}" alt="{$visitor.columns.referrerName|escape:'html'}" />
{/if}
{$visitor.columns.referrerName|escape:'html'}
{if !empty($visitor.columns.referrerKeyword)}{'Referers_Keywords'|translate}:
<br />
<a href="{$visitor.columns.referrerUrl|escape:'html'}" target="_blank" style="text-decoration:underline;">
"{$visitor.columns.referrerKeyword|escape:'html'}"</a>
{/if}
{capture assign='keyword'}{$visitor.columns.referrerKeyword|escape:'html'}{/capture}
{capture assign='searchName'}{$visitor.columns.referrerName|escape:"html"}{/capture}
{capture assign='position'}#{$visitor.columns.referrerKeywordPosition}{/capture}
{if !empty($visitor.columns.referrerKeywordPosition)}<span title='{'Live_KeywordRankedOnSearchResultForThisVisitor'|translate:$keyword:$position:$searchName}' class='visitorRank'><span class='hash'>#</span>{$visitor.columns.referrerKeywordPosition}</span>{/if}
{/if}
{if $visitor.columns.referrerType == 'direct'}{'Referers_DirectEntry'|translate}{/if}
</div>
</td>
<td class="column {if $visitor.columns.visitConverted && !$isWidget}highlightField{/if}" style="width:55%" width="55%">
<strong>
{$visitor.columns.actionDetails|@count}
{if $visitor.columns.actionDetails|@count <= 1}
{'Live_Action'|translate}
{else}
{'Live_Actions'|translate}
{/if}
{if $visitor.columns.visitDuration > 0}- {$visitor.columns.visitDurationPretty}{/if}
</strong>
<br />
<ol class='visitorLog'>
{capture assign='visitorHasSomeEcommerceActivity'}0{/capture}
{foreach from=$visitor.columns.actionDetails item=action}
{capture assign='customVariablesTooltip'}{if !empty($action.customVariables)}{'CustomVariables_CustomVariables'|translate}
{foreach from=$action.customVariables item=customVariable key=id}{capture assign=name}customVariableName{$id}{/capture}{capture assign=value}customVariableValue{$id}{/capture}

- {$customVariable.$name|escape:'html'} {if strlen($customVariable.$value) > 0} = {$customVariable.$value|escape:'html'}{/if}
{/foreach}{/if}
{/capture}
{if !$javascriptVariablesToSet.filterEcommerce
|| $action.type == 'ecommerceOrder'
|| $action.type == 'ecommerceAbandonedCart'}
<li class="{if !empty($action.goalName)}goal{else}action{/if}" title="{$action.serverTimePretty|escape:'html'}{if !empty($action.url) && strlen(trim($action.url))} - {$action.url|escape:'html'}{/if} {if strlen(trim($customVariablesTooltip))}

{$customVariablesTooltip|trim}{/if}{if isset($action.timeSpentPretty)}

{'General_TimeOnPage'|translate}: {$action.timeSpentPretty}{/if}">
{if $action.type == 'ecommerceOrder' || $action.type == 'ecommerceAbandonedCart'}
{* Ecommerce Abandoned Cart / Ecommerce Order *}
<img src="{$action.icon}" />
{if $action.type == 'ecommerceOrder'}
{capture assign='visitorHasSomeEcommerceActivity'}1{/capture}
<strong>{'Goals_EcommerceOrder'|translate}</strong> <span style='color:#666666'>({$action.orderId})</span>
{else}<strong>{'Goals_AbandonedCart'|translate}</strong>
{* TODO: would be nice to have the icons Orders / Cart in the ecommerce log footer *}
{if $javascriptVariablesToSet.filterEcommerce == 2}{capture assign='visitorHasSomeEcommerceActivity'}1{/capture}{/if}
{/if} <br/>
<span {if !$isWidget}style='margin-left:20px'{/if}>
{if $action.type == 'ecommerceOrder'}
<abbr title="
{'Live_GoalRevenue'|translate}: {$action.revenue|money:$javascriptVariablesToSet.idSite}
{if !empty($action.revenueSubTotal)} - {'General_Subtotal'|translate}: {$action.revenueSubTotal|money:$javascriptVariablesToSet.idSite}{/if}
{if !empty($action.revenueTax)} - {'General_Tax'|translate}: {$action.revenueTax|money:$javascriptVariablesToSet.idSite}{/if}
{if !empty($action.revenueShipping)} - {'General_Shipping'|translate}: {$action.revenueShipping|money:$javascriptVariablesToSet.idSite}{/if}
{if !empty($action.revenueDiscount)} - {'General_Discount'|translate}: {$action.revenueDiscount|money:$javascriptVariablesToSet.idSite}{/if}
">{'Live_GoalRevenue'|translate}:
{else}
{capture assign='revenueLeft'}{'Live_GoalRevenue'|translate}{/capture}{'Goals_LeftInCart'|translate:$revenueLeft}:
{/if}
<strong>{$action.revenue|money:$javascriptVariablesToSet.idSite}</strong>{if $action.type == 'ecommerceOrder'}</abbr>{/if},
{'General_Quantity'|translate}: {$action.items}
{* Ecommerce items in Cart/Order *}
{if !empty($action.itemDetails)}
<ul style='list-style:square;margin-left:{if $isWidget}15{else}50{/if}px'>
{foreach from=$action.itemDetails item=product}
<li>{$product.itemSKU|escape}{if !empty($product.itemName)}: {$product.itemName|escape}{/if}{if !empty($product.itemCategory)} ({$product.itemCategory|escape}){/if},
{'General_Quantity'|translate}: {$product.quantity},
{'General_Price'|translate}: {$product.price|money:$javascriptVariablesToSet.idSite}
</li>
{/foreach}
</ul>
{/if}
</span>
{elseif empty($action.goalName)}
{* Page view / Download / Outlink *}
{if !empty($action.pageTitle)}
{if $action.type == 'search'}<img src='{$action.icon}' title='{'Actions_SubmenuSitesearch'|translate|escape:'html'}'>{/if}
{$action.pageTitle|unescape|urldecode|escape:'html'|truncate:80:"...":true}
{/if}
{if !empty($action.url)}
{if $action.type == 'action' && !empty($action.pageTitle)}<br/>{/if}
{if $action.type == 'download'
|| $action.type == 'outlink'}
<img src='{$action.icon}'>
{/if}
<a href="{$action.url|escape:'html'}" target="_blank" style="{if $action.type=='action' && !empty($action.pageTitle)}margin-left: 25px;{/if}text-decoration:underline;">{$action.url|escape:'html'|truncate:80:"...":true}</a>
{elseif $action.type!='search'}
<br/>
<span style="margin-left: 25px;">{$javascriptVariablesToSet.pageUrlNotDefined}</span>
{/if}
{else}
{* Goal conversion *}
<img src="{$action.icon}" />
<strong>{$action.goalName|escape:'html'}</strong>
{if $action.revenue > 0}, {'Live_GoalRevenue'|translate}: <strong>{$action.revenue|money:$javascriptVariablesToSet.idSite}</strong>{/if}
{/if}
</li>
{/if}
{/foreach}
</ol>
</td>
</tr>
{/capture}
{if !$javascriptVariablesToSet.filterEcommerce
|| !empty($visitorHasSomeEcommerceActivity)}
{$visitorRow}
{/if}
{/foreach}

</tbody>
</table>
{/if}

{if $properties.show_footer}
{include file="CoreHome/templates/datatable_footer.tpl"}
{/if}

{include file="CoreHome/templates/datatable_js.tpl"}
<script type="text/javascript" defer="defer">

var visitorLogTitle = '{'Live_VisitorLog'|translate|escape:'javascript'}';
function Piwik_Live_LoadVisitorPopover(visitorId)
{ldelim}
var startingDate = piwik.minDateYear +'-01-01';
var url = 'module=Live&action=getVisitorLog&period=range&date='+ startingDate +',today&show_footer=0&segment=visitorId'+encodeURIComponent('==')+visitorId;
return Piwik_Popover.createPopupAndLoadUrl(url,visitorLogTitle);
{rdelim}

$(document).ready(function(){ldelim}
{literal}
// Replace duplicated page views by a NX count instead of using too much vertical space
$("ol.visitorLog").each(function () {
        var prevelement;
        var prevhtml;
        var counter = 0;
        $(this).find("li").each(function () {
            counter++;
            $(this).val(counter);
            var current = $(this).html();
            if (current == prevhtml) {
var repeat = prevelement.find(".repeat")
if (repeat.length) {
repeat.html( (parseInt(repeat.html()) + 1) + "x" );
} else {
prevelement.append($("<em title='{/literal}{'Live_PageRefreshed'|translate|escape:'js'}{literal}' class='repeat'>2x</em>"));
}
$(this).hide();
} else {
prevhtml = current;
prevelement = $(this);
}
});
});
});
{/literal}
</script>
{/if}

{literal}
<style type="text/css">
hr {
background:none repeat scroll 0 0 transparent;
border: 0 none #000;
border-bottom: 1px solid #ccc;
color:#eee;
margin:0 2em 0.5em;
padding:0 0 0.5em;
}

</style>
{/literal}

</div>
Something went wrong with that request. Please try again.