diff options
author | Thomas Steur <tsteur@users.noreply.github.com> | 2018-03-20 13:11:03 +0300 |
---|---|---|
committer | Matthieu Aubry <mattab@users.noreply.github.com> | 2018-03-20 13:11:03 +0300 |
commit | edfc875f782abc603afdd5898b7fa503310f951a (patch) | |
tree | 26999734dc75576bbcf06802bf43f02fb243a801 /plugins | |
parent | 319adb5f232e669b943cd8ab79f73e725eefd84a (diff) |
Adding some more did you know sections (#12356)
Diffstat (limited to 'plugins')
6 files changed, 61 insertions, 11 deletions
diff --git a/plugins/CustomVariables/Reports/GetCustomVariables.php b/plugins/CustomVariables/Reports/GetCustomVariables.php index 9e1c473ebb..e2ece1a5d4 100644 --- a/plugins/CustomVariables/Reports/GetCustomVariables.php +++ b/plugins/CustomVariables/Reports/GetCustomVariables.php @@ -46,7 +46,7 @@ class GetCustomVariables extends Base } /** - * @return array + * @return string */ public function getFooterMessageExplanationMissingMetrics() { @@ -60,7 +60,18 @@ class GetCustomVariables extends Base $messageEnd = Piwik::translate('CustomVariables_MetricsNotAvailableForPageScope', array("'page'", '\'-\'')); - return $messageStart . ' ' . $messageEnd; + $message = $messageStart . ' ' . $messageEnd; + + if (!$this->isSubtableReport) { + // no footer message for subtables + $out = ''; + Piwik::postEvent('Template.afterCustomVariablesReport', array(&$out)); + if (!empty($message)) { + $message .= $out; + } + } + + return $message; } /** diff --git a/plugins/ProfessionalServices/ProfessionalServices.php b/plugins/ProfessionalServices/ProfessionalServices.php index 5e6ef3f6f0..7c821418c6 100644 --- a/plugins/ProfessionalServices/ProfessionalServices.php +++ b/plugins/ProfessionalServices/ProfessionalServices.php @@ -27,7 +27,9 @@ class ProfessionalServices extends \Piwik\Plugin 'Template.endGoalEditTable' => array('function' => 'getGoalFunnelOverviewPromo', 'after' => true), 'Template.afterEventsReport' => 'getEventsPromo', 'Template.afterCampaignsReport' => 'getCampaignsPromo', + 'Template.afterReferrerTypeReport' => 'getReferrerTypePromo', 'Template.afterReferrersKeywordsReport' => 'getSearchKeywordsPerformancePromo', + 'Template.afterCustomVariablesReport' => 'getCustomVariablesPromo', 'Template.afterOverlaySidebar' => 'getHeatmapPromo', 'Template.afterVisitorProfileOverview' => 'getSessionRecordingPromo', ); @@ -96,22 +98,26 @@ class ProfessionalServices extends \Piwik\Plugin public function getGoalFunnelOverviewPromo(&$out) { - if (!$this->shouldShowPromoForPlugin('Funnels')) { - return; + if ($this->shouldShowPromoForPlugin('Funnels')) { + $view = new View('@ProfessionalServices/promoFunnel'); + $out .= $view->render(); } - - $view = new View('@ProfessionalServices/promoFunnel'); - $out .= $view->render(); } public function getGoalOverviewPromo(&$out) { - if (!$this->shouldShowPromoForPlugin('AbTesting')) { - return; + if ($this->shouldShowPromoForPlugin('AbTesting')) { + $view = new View('@ProfessionalServices/promoExperiments.twig'); + $out .= $view->render(); } + } - $view = new View('@ProfessionalServices/promoExperiments.twig'); - $out .= $view->render(); + public function getCustomVariablesPromo(&$out) + { + if ($this->shouldShowPromoForPlugin('CustomReports')) { + $view = new View('@ProfessionalServices/promoCustomVariables.twig'); + $out .= $view->render(); + } } public function getEventsPromo(&$out) @@ -133,9 +139,18 @@ class ProfessionalServices extends \Piwik\Plugin $view = new View('@ProfessionalServices/promoBelowCampaigns'); $view->displayMarketingCampaignsReportingAd = !$this->isPluginActivated('MarketingCampaignsReporting'); + $view->multiChannelConversionAttributionAd = !$this->isPluginActivated('MultiChannelConversionAttribution') && !empty($_REQUEST['idGoal']); $out .= $view->render(); } + public function getReferrerTypePromo(&$out) + { + if ($this->shouldShowPromoForPlugin('MultiChannelConversionAttribution') && !empty($_REQUEST['idGoal'])) { + $view = new View('@ProfessionalServices/promoBelowReferrerTypes'); + $out .= $view->render(); + } + } + private function shouldShowPromoForPlugin($pluginName) { return !$this->isPluginActivated($pluginName) && !$this->isRequestForDashboardWidget(); diff --git a/plugins/ProfessionalServices/templates/promoBelowCampaigns.twig b/plugins/ProfessionalServices/templates/promoBelowCampaigns.twig index 2b9efc0bf3..1aa00beabf 100644 --- a/plugins/ProfessionalServices/templates/promoBelowCampaigns.twig +++ b/plugins/ProfessionalServices/templates/promoBelowCampaigns.twig @@ -4,4 +4,8 @@ {% if displayMarketingCampaignsReportingAd %} <br/> Install our <a target="_blank" rel="noreferrer" href="https://plugins.matomo.org/MarketingCampaignsReporting">Marketing Campaigns Reporting plugin</a> to get even more campaigns reports and new segments for up to five marketing channels (campaign, source, medium, keyword, content). {% endif %} + {% if multiChannelConversionAttributionAd %} + <br /> + Discover how much each campaign truly contributes to your success by applying attribution models using the <a target="_blank" rel="noreferrer" href="https://plugins.piwik.org/MarketingCampaignsReporting">Multi Channel Conversion Attribution</a> premium feature. + {% endif %} </p>
\ No newline at end of file diff --git a/plugins/ProfessionalServices/templates/promoBelowReferrerTypes.twig b/plugins/ProfessionalServices/templates/promoBelowReferrerTypes.twig new file mode 100644 index 0000000000..673c4f4367 --- /dev/null +++ b/plugins/ProfessionalServices/templates/promoBelowReferrerTypes.twig @@ -0,0 +1,3 @@ +<p style="margin-top:3em" class=" alert-info alert">Did you know? + <br/>You can get advanced insights into how much each of your marking channel truly contributes to your success by applying attribution models using the <a target="_blank" rel="noreferrer" href="https://plugins.piwik.org/MultiChannelConversionAttribution">Multi Channel Conversion Attribution</a> premium feature. +</p>
\ No newline at end of file diff --git a/plugins/ProfessionalServices/templates/promoCustomVariables.twig b/plugins/ProfessionalServices/templates/promoCustomVariables.twig new file mode 100644 index 0000000000..69da4dbc11 --- /dev/null +++ b/plugins/ProfessionalServices/templates/promoCustomVariables.twig @@ -0,0 +1,3 @@ +<p style="margin-top:1em" class=" alert-info alert">Did you know? + <br/> With the <a target="_blank" rel="noreferrer" href="https://plugins.piwik.org/CustomReports">Custom Reports</a> premium feature you can pull out the information you need in a matter of seconds. +</p>
\ No newline at end of file diff --git a/plugins/Referrers/Reports/GetReferrerType.php b/plugins/Referrers/Reports/GetReferrerType.php index dea44ccb5a..8f937f1a41 100644 --- a/plugins/Referrers/Reports/GetReferrerType.php +++ b/plugins/Referrers/Reports/GetReferrerType.php @@ -9,6 +9,7 @@ namespace Piwik\Plugins\Referrers\Reports; use Piwik\Common; +use Piwik\EventDispatcher; use Piwik\Piwik; use Piwik\Plugin\ViewDataTable; use Piwik\Plugins\CoreVisualizations\Visualizations\HtmlTable; @@ -107,6 +108,19 @@ class GetReferrerType extends Base if ($view->isViewDataTableId(HtmlTable::ID)) { $view->config->disable_subtable_when_show_goals = true; } + + $this->configureFooterMessage($view); } + protected function configureFooterMessage(ViewDataTable $view) + { + if ($this->isSubtableReport) { + // no footer message for subtables + return; + } + + $out = ''; + Piwik::postEvent('Template.afterReferrerTypeReport', array(&$out)); + $view->config->show_footer_message = $out; + } } |