diff options
author | mattab <matthieu.aubry@gmail.com> | 2014-11-27 08:17:46 +0300 |
---|---|---|
committer | mattab <matthieu.aubry@gmail.com> | 2014-11-27 08:17:46 +0300 |
commit | 0805e5fde0ce64098fcc6017b77b01463c3620bc (patch) | |
tree | e47aa145a93a87778c45bffb8d1e79c792ca2fe6 /plugins/Live | |
parent | 42e0ee9476f060312ebc61b65c3620fd41743975 (diff) |
Fixes #6713 Ecommerce log will now show the full Log for each visit who converted some ecommerce conversions or abandoned carts. Removed 'filterEcommerce' hack from codebase.
Diffstat (limited to 'plugins/Live')
-rw-r--r-- | plugins/Live/Controller.php | 1 | ||||
-rw-r--r-- | plugins/Live/VisitorLog.php | 26 | ||||
-rw-r--r-- | plugins/Live/templates/_actionsList.twig | 177 | ||||
-rw-r--r-- | plugins/Live/templates/_dataTableViz_visitorLog.twig | 4 | ||||
-rw-r--r-- | plugins/Live/templates/getVisitList.twig | 1 | ||||
-rw-r--r-- | plugins/Live/templates/indexVisitorLog.twig | 2 |
6 files changed, 90 insertions, 121 deletions
diff --git a/plugins/Live/Controller.php b/plugins/Live/Controller.php index 0b540b71d8..9df3e26ff8 100644 --- a/plugins/Live/Controller.php +++ b/plugins/Live/Controller.php @@ -57,7 +57,6 @@ class Controller extends \Piwik\Plugin\Controller public function indexVisitorLog() { $view = new View('@Live/indexVisitorLog.twig'); - $view->filterEcommerce = Common::getRequestVar('filterEcommerce', 0, 'int'); $view->visitorLog = $this->renderReport(new GetLastVisitsDetails()); return $view->render(); } diff --git a/plugins/Live/VisitorLog.php b/plugins/Live/VisitorLog.php index 054b2f50ae..d3d93c2dd4 100644 --- a/plugins/Live/VisitorLog.php +++ b/plugins/Live/VisitorLog.php @@ -67,8 +67,6 @@ class VisitorLog extends Visualization $this->config->documentation = Piwik::translate('Live_VisitorLogDocumentation', array('<br />', '<br />')); - $filterEcommerce = Common::getRequestVar('filterEcommerce', 0, 'int'); - if (!is_array($this->config->custom_parameters)) { $this->config->custom_parameters = array(); } @@ -76,7 +74,6 @@ class VisitorLog extends Visualization // set a very high row count so that the next link in the footer of the data table is always shown $this->config->custom_parameters['totalRows'] = 10000000; $this->config->custom_parameters['smallWidth'] = (1 == Common::getRequestVar('small', 0, 'int')); - $this->config->custom_parameters['filterEcommerce'] = $filterEcommerce; $this->config->custom_parameters['pageUrlNotDefined'] = Piwik::translate('General_NotDefined', Piwik::translate('Actions_ColumnPageURL')); $this->config->footer_icons = array( @@ -91,28 +88,5 @@ class VisitorLog extends Visualization ) ) ); - - // determine if each row has ecommerce activity or not - if ($filterEcommerce) { - $this->dataTable->filter( - 'ColumnCallbackAddMetadata', - array( - 'actionDetails', - 'hasEcommerce', - function ($actionDetails) use ($filterEcommerce) { - foreach ($actionDetails as $action) { - $isEcommerceOrder = $action['type'] == 'ecommerceOrder' - && $filterEcommerce == \Piwik\Plugins\Goals\Controller::ECOMMERCE_LOG_SHOW_ORDERS; - $isAbandonedCart = $action['type'] == 'ecommerceAbandonedCart' - && $filterEcommerce == \Piwik\Plugins\Goals\Controller::ECOMMERCE_LOG_SHOW_ABANDONED_CARTS; - if ($isAbandonedCart || $isEcommerceOrder) { - return true; - } - } - return false; - } - ) - ); - } } } diff --git a/plugins/Live/templates/_actionsList.twig b/plugins/Live/templates/_actionsList.twig index cc798f4f6e..0598c2608f 100644 --- a/plugins/Live/templates/_actionsList.twig +++ b/plugins/Live/templates/_actionsList.twig @@ -12,34 +12,34 @@ {% endfor %} {% endif %} {% endset %} - {% if not clientSideParameters.filterEcommerce or action.type == 'ecommerceOrder' or action.type == 'ecommerceAbandonedCart' %} - <li class="{% if action.goalName is defined %}goal{% else %}action{% endif %}" - title="{{ action.serverTimePretty }}{% if action.url is defined and action.url|trim|length %} + + <li class="{% if action.goalName is defined %}goal{% else %}action{% endif %}" + title="{{ action.serverTimePretty }}{% if action.url is defined and action.url|trim|length %} {{ action.url }}{% endif %}{% if customVariablesTooltip|trim|length %} {{ customVariablesTooltip|trim }}{% endif -%} - {%- if action.generationTime is defined %} + {%- if action.generationTime is defined %} {{ 'General_ColumnGenerationTime'|translate }}: {{ action.generationTime|raw }}{% endif %} - {%- if action.timeSpentPretty is defined %} + {%- if action.timeSpentPretty is defined %} {{ 'General_TimeOnPage'|translate }}: {{ action.timeSpentPretty|raw }}{% endif -%}"> - <div> - {% if action.type == 'ecommerceOrder' or action.type == 'ecommerceAbandonedCart' %} - {# Ecommerce Abandoned Cart / Ecommerce Order #} - <img src="{{ action.icon }}"/> - {% if action.type == 'ecommerceOrder' %} - <strong>{{ 'Goals_EcommerceOrder'|translate }}</strong> - <span style='color:#666;'>({{ action.orderId }})</span> - {% else %} - <strong>{{'Goals_AbandonedCart'|translate}}</strong> + <div> + {% if action.type == 'ecommerceOrder' or action.type == 'ecommerceAbandonedCart' %} + {# Ecommerce Abandoned Cart / Ecommerce Order #} + <img src="{{ action.icon }}"/> + {% if action.type == 'ecommerceOrder' %} + <strong>{{ 'Goals_EcommerceOrder'|translate }}</strong> + <span style='color:#666;'>({{ action.orderId }})</span> + {% else %} + <strong>{{'Goals_AbandonedCart'|translate}}</strong> - {# TODO: would be nice to have the icons Orders / Cart in the ecommerce log footer #} - {% endif %} - <p> - <span {% if not isWidget %}style='margin-left:20px;'{% endif %}> - {% if action.type == 'ecommerceOrder' %} + {# TODO: would be nice to have the icons Orders / Cart in the ecommerce log footer #} + {% endif %} + <p> + <span {% if not isWidget %}style='margin-left:20px;'{% endif %}> + {% if action.type == 'ecommerceOrder' %} {# spacing is important for tooltip to look nice #} {% set ecommerceOrderTooltip %}{{ 'General_ColumnRevenue'|translate }}: {{ action.revenue|money(clientSideParameters.idSite)|raw }} {% if action.revenueSubTotal is not empty %} - {{ 'General_Subtotal'|translate }}: {{ action.revenueSubTotal|money(clientSideParameters.idSite)|raw }}{% endif %} @@ -50,83 +50,82 @@ {% if action.revenueDiscount is not empty %} - {{ 'General_Discount'|translate }}: {{ action.revenueDiscount|money(clientSideParameters.idSite)|raw }}{% endif %} {% endset %} - <abbr title="{{ ecommerceOrderTooltip }}">{{ 'General_ColumnRevenue'|translate }}: - {% else %} - {% set revenueLeft %}{{ 'General_ColumnRevenue'|translate }}{% endset %} - {{ 'Goals_LeftInCart'|translate(revenueLeft) }}: - {% endif %} - <strong>{{ action.revenue|money(clientSideParameters.idSite)|raw }}</strong> - {% if action.type == 'ecommerceOrder' %} - </abbr> - {% endif %}, {{ 'General_Quantity'|translate }}: {{ action.items }} + <abbr title="{{ ecommerceOrderTooltip }}">{{ 'General_ColumnRevenue'|translate }}: + {% else %} + {% set revenueLeft %}{{ 'General_ColumnRevenue'|translate }}{% endset %} + {{ 'Goals_LeftInCart'|translate(revenueLeft) }}: + {% endif %} + <strong>{{ action.revenue|money(clientSideParameters.idSite)|raw }}</strong> + {% if action.type == 'ecommerceOrder' %} + </abbr> + {% endif %}, {{ 'General_Quantity'|translate }}: {{ action.items }} - {# Ecommerce items in Cart/Order #} - {% if action.itemDetails is not empty %} - <ul style='list-style:square;margin-left:{% if isWidget %}15{% else %}50{% endif %}px;'> - {% for product in action.itemDetails %} - <li> - {{ product.itemSKU }}{% if product.itemName is not empty %}: {{ product.itemName }}{% endif %} - {% if product.itemCategory is not empty %} ({{ product.itemCategory }}){% endif %} - , - {{ 'General_Quantity'|translate }}: {{ product.quantity }}, - {{ 'General_Price'|translate }}: {{ product.price|money(clientSideParameters.idSite)|raw }} - </li> - {% endfor %} - </ul> - {% endif %} - </span> - </p> - {% elseif action.goalName is not defined%} - {# Page view / Download / Outlink / Event #} - {% if action.pageTitle|default(false) is not empty %} - <span class="truncated-text-line">{{ action.pageTitle|rawSafeDecoded }}</span> + {# Ecommerce items in Cart/Order #} + {% if action.itemDetails is not empty %} + <ul style='list-style:square;margin-left:{% if isWidget %}15{% else %}50{% endif %}px;'> + {% for product in action.itemDetails %} + <li> + {{ product.itemSKU }}{% if product.itemName is not empty %}: {{ product.itemName }}{% endif %} + {% if product.itemCategory is not empty %} ({{ product.itemCategory }}){% endif %} + , + {{ 'General_Quantity'|translate }}: {{ product.quantity }}, + {{ 'General_Price'|translate }}: {{ product.price|money(clientSideParameters.idSite)|raw }} + </li> + {% endfor %} + </ul> {% endif %} - {% if action.siteSearchKeyword is defined %} - {% if action.type == 'search' %} - <img src='{{ action.icon }}' title='{{ 'Actions_SubmenuSitesearch'|translate }}' class="action-list-action-icon"> - {% endif %} - <span class="truncated-text-line">{{ action.siteSearchKeyword }}</span> + </span> + </p> + {% elseif action.goalName is not defined%} + {# Page view / Download / Outlink / Event #} + {% if action.pageTitle|default(false) is not empty %} + <span class="truncated-text-line">{{ action.pageTitle|rawSafeDecoded }}</span> + {% endif %} + {% if action.siteSearchKeyword is defined %} + {% if action.type == 'search' %} + <img src='{{ action.icon }}' title='{{ 'Actions_SubmenuSitesearch'|translate }}' class="action-list-action-icon"> {% endif %} - {% if action.eventCategory|default(false) is not empty %} - <img src='{{ action.icon }}' title='{{ 'Events_Event'|translate }}' class="action-list-action-icon"> - <span class="truncated-text-line">{{ action.eventCategory|rawSafeDecoded }} - {{ action.eventAction|rawSafeDecoded }} {% if action.eventName is defined %}- {{ action.eventName|rawSafeDecoded }}{% endif %} {% if action.eventValue is defined %}[{{ action.eventValue }}]{% endif %}</span> + <span class="truncated-text-line">{{ action.siteSearchKeyword }}</span> + {% endif %} + {% if action.eventCategory|default(false) is not empty %} + <img src='{{ action.icon }}' title='{{ 'Events_Event'|translate }}' class="action-list-action-icon"> + <span class="truncated-text-line">{{ action.eventCategory|rawSafeDecoded }} - {{ action.eventAction|rawSafeDecoded }} {% if action.eventName is defined %}- {{ action.eventName|rawSafeDecoded }}{% endif %} {% if action.eventValue is defined %}[{{ action.eventValue }}]{% endif %}</span> + {% endif %} + {% if action.url is not empty %} + {% if action.type == 'action' and action.pageTitle|default(false) is not empty %}<p>{% endif %} + {% if action.type == 'download' or action.type == 'outlink' %} + <img src='{{ action.icon }}' class="action-list-action-icon"> {% endif %} - {% if action.url is not empty %} - {% if action.type == 'action' and action.pageTitle|default(false) is not empty %}<p>{% endif %} - {% if action.type == 'download' or action.type == 'outlink' %} - <img src='{{ action.icon }}' class="action-list-action-icon"> - {% endif %} - {% if action.eventCategory|default(false) is not empty - and previousAction.url|default(false) == action.url %} - {# For events, do not show (url) if the Event URL is the same as the URL last displayed #} - {% else %} - <a href="{{ action.url }}" rel="noreferrer" target="_blank" rel="noreferrer" class="{% if action.eventCategory|default(false) is empty %}action-list-url{# don't put URL on new line for events #}{% endif %} truncated-text-line" - {% if overrideLinkStyle is not defined or overrideLinkStyle %}style="{% if action.type=='action' and action.pageTitle|default(false) is not empty %}margin-left: 9px;{% endif %}text-decoration:underline;"{% endif %}> - {% if action.eventCategory|default(false) is not empty %} - (url) - {% else %} - {{ action.url }} - {% endif %} - </a> - {% endif %} - {% if action.type == 'action' and action.pageTitle|default(false) is not empty %}</p>{% endif %} - {% elseif action.type != 'search' and action.type != 'event' %} - <p> - <span style="margin-left: 9px;">{{ clientSideParameters.pageUrlNotDefined }}</span> - </p> - {% endif %} - {% else %} - {# Goal conversion #} - <img src="{{ action.icon }}" /> - <strong>{{ action.goalName }}</strong> - {% if action.revenue > 0 %}, {{ 'General_ColumnRevenue'|translate }}: - <strong>{{ action.revenue|money(clientSideParameters.idSite)|raw }}</strong> + {% if action.eventCategory|default(false) is not empty + and previousAction.url|default(false) == action.url %} + {# For events, do not show (url) if the Event URL is the same as the URL last displayed #} + {% else %} + <a href="{{ action.url }}" rel="noreferrer" target="_blank" rel="noreferrer" class="{% if action.eventCategory|default(false) is empty %}action-list-url{# don't put URL on new line for events #}{% endif %} truncated-text-line" + {% if overrideLinkStyle is not defined or overrideLinkStyle %}style="{% if action.type=='action' and action.pageTitle|default(false) is not empty %}margin-left: 9px;{% endif %}text-decoration:underline;"{% endif %}> + {% if action.eventCategory|default(false) is not empty %} + (url) + {% else %} + {{ action.url }} + {% endif %} + </a> {% endif %} + {% if action.type == 'action' and action.pageTitle|default(false) is not empty %}</p>{% endif %} + {% elseif action.type != 'search' and action.type != 'event' %} + <p> + <span style="margin-left: 9px;">{{ clientSideParameters.pageUrlNotDefined }}</span> + </p> + {% endif %} + {% else %} + {# Goal conversion #} + <img src="{{ action.icon }}" /> + <strong>{{ action.goalName }}</strong> + {% if action.revenue > 0 %}, {{ 'General_ColumnRevenue'|translate }}: + <strong>{{ action.revenue|money(clientSideParameters.idSite)|raw }}</strong> {% endif %} - </div> - </li> - {% endif %} + {% endif %} + </div> + </li> {% set previousAction = action %} {% endfor %}
\ No newline at end of file diff --git a/plugins/Live/templates/_dataTableViz_visitorLog.twig b/plugins/Live/templates/_dataTableViz_visitorLog.twig index 922ed2057b..cf0460501a 100644 --- a/plugins/Live/templates/_dataTableViz_visitorLog.twig +++ b/plugins/Live/templates/_dataTableViz_visitorLog.twig @@ -198,9 +198,7 @@ GPS (lat/long): {{ visitor.getColumn('latitude') }},{{ visitor.getColumn('longit </tr> {% endset %} - {% if not clientSideParameters.filterEcommerce or visitor.getMetadata('hasEcommerce') %} - {{ visitorRow }} - {% endif %} + {{ visitorRow }} {% endfor %} </tbody> diff --git a/plugins/Live/templates/getVisitList.twig b/plugins/Live/templates/getVisitList.twig index 478219748b..b536f2f36f 100644 --- a/plugins/Live/templates/getVisitList.twig +++ b/plugins/Live/templates/getVisitList.twig @@ -15,7 +15,6 @@ <ol class="visitor-profile-actions"> {% include "@Live/_actionsList.twig" with {'actionDetails': visitInfo.getColumn('actionDetails'), 'clientSideParameters': { - 'filterEcommerce': false, 'idSite': idSite, 'pageUrlNotDefined': 'General_NotDefined'|translate('Actions_ColumnPageURL'|translate) }, diff --git a/plugins/Live/templates/indexVisitorLog.twig b/plugins/Live/templates/indexVisitorLog.twig index c856fa72e8..3e3460c072 100644 --- a/plugins/Live/templates/indexVisitorLog.twig +++ b/plugins/Live/templates/indexVisitorLog.twig @@ -1,3 +1,3 @@ -<h2 piwik-enriched-headline>{% if filterEcommerce %}{{ 'Goals_EcommerceLog'|translate }}{% else %}{{ 'Live_VisitorLog'|translate }}{% endif %}</h2> +<h2 piwik-enriched-headline>{% if currentAction == 'indexVisitorLog' %}{{ 'Goals_EcommerceLog'|translate }}{% else %}{{ 'Live_VisitorLog'|translate }}{% endif %}</h2> {{ visitorLog|raw }} |