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
|
{% if not visitorData %}
<div class="pk-emptyDataTable">{{ 'CoreHome_ThereIsNoDataForThisReport'|translate }}</div>
{% else %}
<div class="visitor-profile"
data-visitor-id="{{ visitorData.lastVisits.getFirstRow().getColumn('visitorId') }}"
data-next-visitor="{{ visitorData.nextVisitorId }}"
data-prev-visitor="{{ visitorData.previousVisitorId }}"
tabindex="0">
<a href class="visitor-profile-close"></a>
<div class="visitor-profile-info">
<div>
<div class="visitor-profile-overview">
<div class="visitor-profile-avatar">
<div>
<div class="visitor-profile-image-frame">
<img src="{{ visitorData.visitorAvatar|default("plugins/Live/images/unknown_avatar.jpg") }}"
alt="{{ visitorData.visitorDescription|default('') }}"
title="{{ visitorData.visitorDescription|default('') }}" />
</div>
<img src="plugins/Live/images/paperclip.png" alt=""/>
</div>
<div>
<div class="visitor-profile-header">
{% if visitorData.previousVisitorId is not empty %}<a class="visitor-profile-prev-visitor" href="#" title="{{ 'Live_PreviousVisitor'|translate }}">←</a>{% endif %}
<h1>{{ 'Live_VisitorProfile'|translate }}
{%- if visitorData.userId is not empty %}: <span title="{{'General_UserId'|translate}}: {{ visitorData.userId|raw }}">{{ visitorData.userId|raw }}</span>{% endif -%}
<img class="loadingPiwik" style="display:none;" src="plugins/Morpheus/images/loading-blue.gif"/>
</h1>
<a href="http://piwik.org/docs/user-profile/" class="reportDocumentationIcon" rel="noreferrer" target="_blank" title="{{ 'General_ViewDocumentationFor'|translate("Live_VisitorProfile"|translate|ucwords) }}"></a>
{% if visitorData.nextVisitorId is not empty %}<a class="visitor-profile-next-visitor" href="#" title="{{ 'Live_NextVisitor'|translate }}">→</a>{% endif %}
</div>
<div class="visitor-profile-latest-visit">
{% include "@Live/getSingleVisitSummary.twig" with {'visitData': visitorData.lastVisits.getFirstRow().getColumns(), 'showLocation': false} %}
</div>
</div>
<p style="clear:both; border:none!important;"></p>
</div>
<div class="visitor-profile-summary">
<h1>{{ 'General_Summary'|translate }}</h1>
<div>
<p>{{ 'Live_VisitSummary'|translate('<strong>' ~ visitorData.totalVisitDurationPretty ~ '</strong>', '', '', '<strong>', visitorData.totalActions, visitorData.totalVisits, '</strong>')|raw }}</p>
<p>{% if visitorData.totalGoalConversions %}<strong>{% endif %}{{ 'Live_ConvertedNGoals'|translate(visitorData.totalGoalConversions) }}{% if visitorData.totalGoalConversions %}</strong>{% endif %}
{%- if visitorData.totalGoalConversions %} (
{%- for idGoal, totalConversions in visitorData.totalConversionsByGoal -%}
{%- set idGoal = idGoal[7:] -%}
{%- if not loop.first %}, {% endif -%}{{- totalConversions }} <span class="visitor-profile-goal-name">{{ goals[idGoal]['name'] -}}</span>
{%- endfor -%}
){% endif %}.</p>
{% if visitorData.totalEcommerceConversions|default(0) > 0 or visitorData.totalAbandonedCarts|default(0) > 0%}
<p>
{{ 'Goals_Ecommerce'|translate }}:
{%- if visitorData.totalEcommerceConversions|default(0) > 0 %} {{ 'Live_EcommerceSummaryConversions'|translate('<strong>', visitorData.totalEcommerceConversions, visitorData.totalEcommerceRevenue|money(idSite), '</strong>', visitorData.totalEcommerceItems)|raw }}
{%- endif -%}
{%- if visitorData.totalAbandonedCarts|default(0) > 0 %} {{ 'Live_AbandonedCartSummary'|translate('<strong>', visitorData.totalAbandonedCarts, '</strong>', visitorData.totalAbandonedCartsItems, '<strong>', visitorData.totalAbandonedCartsRevenue|money(idSite), '</strong>')|raw }}{%- endif -%}
</p>
{% endif %}
{% if visitorData.totalSearches|default(0) %}
<p>
{{ 'Actions_WidgetSearchKeywords'|translate }}:
{%- for entry in visitorData.searches %} <strong title="{% if entry.searches == 1 %}{{ 'Actions_OneSearch'|translate }}{% else %}{{ 'UserCountryMap_Searches'|translate(entry.searches) }}{% endif %}">{{ entry.keyword }}</strong>{% if not loop.last %},{% endif %}{% endfor %}
</p>
{% endif %}
{% if visitorData.averagePageGenerationTime is defined %}
<p title="{{ 'Live_CalculatedOverNPageViews'|translate(visitorData.totalPageViewsWithTiming) }}">
{{ 'Live_AveragePageGenerationTime'|translate('<strong>' ~ visitorData.averagePageGenerationTime ~ 's</strong>')|raw }}
</p>
{% endif %}
</div>
</div>
<div class="visitor-profile-important-visits">
{%- set keywordNotDefined = 'General_NotDefined'|translate('General_ColumnKeyword'|translate) -%}
<div>
<h1>{% if visitorData.visitsAggregated == 100 %}{{ 'General_Visit'|translate }}# 100{% else %}{{ 'Live_FirstVisit'|translate }}{% endif %}</h1>
<div>
<p><strong>{{ visitorData.firstVisit.prettyDate }}</strong><span> - {{ 'UserCountryMap_DaysAgo'|translate(visitorData.firstVisit.daysAgo) }}</span></p>
<p><span>{{ 'General_FromReferrer'|translate }}:</span>
<strong {% if visitorData.firstVisit.referrerType == 'search' and '(' not in visitorData.firstVisit.referralSummary %}title="{{ keywordNotDefined }}"{% endif %}>{{ visitorData.firstVisit.referralSummary }}</strong></p>
</div>
</div>
{% if visitorData.lastVisits.getRowsCount() != 1 %}
<div>
<h1>{{ 'Live_LastVisit'|translate }}</h1>
<div>
<p><strong>{{ visitorData.lastVisit.prettyDate }}</strong><span> - {{ 'UserCountryMap_DaysAgo'|translate(visitorData.lastVisit.daysAgo) }}</span></p>
<p><span>{{ 'General_FromReferrer'|translate }}:</span>
<strong {% if visitorData.lastVisit.referrerType == 'search' and '(' not in visitorData.lastVisit.referralSummary %}title="{{ keywordNotDefined }}"{% endif %}>{{ visitorData.lastVisit.referralSummary }}</strong></p>
</div>
</div>
{% endif %}
</div>
<div>
<div class="visitor-profile-location">
<h1>{{ 'UserCountry_Location'|translate }}</h1>
<p>
{%- for entry in visitorData.countries -%}
{% set entryCity -%}
{% if entry.cities is defined and 1 == entry.cities|length and entry.cities|join -%}
{{ entry.cities|join }}
{%- elseif entry.cities is defined and 1 < entry.cities|length -%}
<span title="{{ entry.cities|join(', ') }}">{{ 'UserCountry_FromDifferentCities'|translate }}</span>
{%- endif %}
{%- endset %}
{% set entryVisits -%}
<strong>
{% if entry.nb_visits == 1 -%}
{{ 'General_OneVisit'|translate }}
{%- else -%}
{{ 'General_NVisits'|translate(entry.nb_visits) }}
{%- endif -%}
</strong>
{%- endset %}
{% set entryCountry -%}
{%- if entryCity -%}
{{ 'UserCountry_CityAndCountry'|translate(entryCity, entry.prettyName)|raw }}
{%- else -%}
{{ entry.prettyName }}
{%- endif -%}
<img src="{{ entry.flag }}" title="{{ entry.prettyName }}"/>
{%- endset %}
{{- 'General_XFromY'|translate(entryVisits, entryCountry)|raw -}}{% if not loop.last %}, {% endif %}
{%- endfor %}
<a class="visitor-profile-show-map" href="#" {% if userCountryMapUrl|default('') is empty %}style="display:none"{% endif %}>({{ 'Live_ShowMap'|translate|replace({' ': ' '})|raw }})</a> <img class="loadingPiwik" style="display:none;" src="plugins/Morpheus/images/loading-blue.gif"/>
</p>
<div class="visitor-profile-map" style="display:none" data-href="{{ userCountryMapUrl|default('') }}">
</div>
</div>
</div>
</div>
<div class="visitor-profile-visits-info">
<div class="visitor-profile-pages-visited">
<h1>{{ 'Live_VisitedPages'|translate }}</h1>
</div>
<div class="visitor-profile-visits-container">
<ol class="visitor-profile-visits">
{% include "@Live/getVisitList.twig" with {'visits': visitorData.lastVisits, 'startCounter': 1} %}
</ol>
</div>
<div class="visitor-profile-more-info">
{% if visitorData.lastVisits.getRowsCount() >= constant("Piwik\\Plugins\\Live\\VisitorProfile::VISITOR_PROFILE_MAX_VISITS_TO_SHOW") %}
<a href="#">{{ 'Live_LoadMoreVisits'|translate }}</a> <img class="loadingPiwik" style="display:none;" src="plugins/Morpheus/images/loading-blue.gif"/>
{% else %}
<span class="visitor-profile-no-visits">{{ 'Live_NoMoreVisits'|translate }}</span>
{% endif %}
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
$(function() { require('piwik/UI').VisitorProfileControl.initElements(); });
</script>
{% endif %}
|