diff options
author | Matthieu Aubry <mattab@users.noreply.github.com> | 2017-09-05 07:38:21 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-05 07:38:21 +0300 |
commit | b018cf1dad2f96dd15464b4617599298b5f02e3e (patch) | |
tree | a18702ac6e6c601cc22a47502811bd4bbcdb6908 /plugins | |
parent | 8a23b7e718ed107abeba1efbfbfbdd2d6b9ab58e (diff) |
Add a link to Campaign tracking docs + URL Builder + Marketing Campaigns Reporting plugin (#11997)
* Add a link to Campaign tracking docs + URL Builder + Marketing Campaigns Reporting plugin
* Update UI tests
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/ProfessionalServices/ProfessionalServices.php | 12 | ||||
-rw-r--r-- | plugins/ProfessionalServices/templates/promoBelowCampaigns.twig | 7 | ||||
-rw-r--r-- | plugins/Referrers/Reports/GetCampaigns.php | 15 |
3 files changed, 34 insertions, 0 deletions
diff --git a/plugins/ProfessionalServices/ProfessionalServices.php b/plugins/ProfessionalServices/ProfessionalServices.php index d11bc22b38..5e6ef3f6f0 100644 --- a/plugins/ProfessionalServices/ProfessionalServices.php +++ b/plugins/ProfessionalServices/ProfessionalServices.php @@ -26,6 +26,7 @@ class ProfessionalServices extends \Piwik\Plugin 'Template.afterGoalCannotAddNewGoal' => array('function' => 'getGoalOverviewPromo', 'after' => true), 'Template.endGoalEditTable' => array('function' => 'getGoalFunnelOverviewPromo', 'after' => true), 'Template.afterEventsReport' => 'getEventsPromo', + 'Template.afterCampaignsReport' => 'getCampaignsPromo', 'Template.afterReferrersKeywordsReport' => 'getSearchKeywordsPerformancePromo', 'Template.afterOverlaySidebar' => 'getHeatmapPromo', 'Template.afterVisitorProfileOverview' => 'getSessionRecordingPromo', @@ -124,6 +125,17 @@ class ProfessionalServices extends \Piwik\Plugin $out .= $view->render(); } + public function getCampaignsPromo(&$out) + { + if ($this->isRequestForDashboardWidget()) { + return; + } + + $view = new View('@ProfessionalServices/promoBelowCampaigns'); + $view->displayMarketingCampaignsReportingAd = !$this->isPluginActivated('MarketingCampaignsReporting'); + $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 new file mode 100644 index 0000000000..f929642bd5 --- /dev/null +++ b/plugins/ProfessionalServices/templates/promoBelowCampaigns.twig @@ -0,0 +1,7 @@ +<p style="margin-top:3em" class=" alert-info alert">Did you know? + <br/> <a target="_blank" rel="noreferrer" href="https://piwik.org/docs/tracking-campaigns/">Campaign tracking</a> lets you measure the effectiveness of your marketing campaigns such as emails marketing, paid search, banner ads, affiliates links, etc. + Use the <a target="_blank" rel="noreferrer" href="https://piwik.org/docs/tracking-campaigns/">URL Builder tool</a> to create your links with new URL campaign parameters. + {% if displayMarketingCampaignsReportingAd %} + <br/> Install our <a target="_blank" rel="noreferrer" href="https://plugins.piwik.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 %} +</p>
\ No newline at end of file diff --git a/plugins/Referrers/Reports/GetCampaigns.php b/plugins/Referrers/Reports/GetCampaigns.php index 1d375423d8..a1b5f6fd94 100644 --- a/plugins/Referrers/Reports/GetCampaigns.php +++ b/plugins/Referrers/Reports/GetCampaigns.php @@ -8,6 +8,7 @@ */ namespace Piwik\Plugins\Referrers\Reports; +use Piwik\EventDispatcher; use Piwik\Piwik; use Piwik\Plugin\ViewDataTable; use Piwik\Plugins\Referrers\Columns\Campaign; @@ -34,6 +35,20 @@ class GetCampaigns extends Base $view->config->addTranslation('label', $this->dimension->getName()); $view->requestConfig->filter_limit = 25; + + $this->configureFooterMessage($view); } + + protected function configureFooterMessage(ViewDataTable $view) + { + if ($this->isSubtableReport) { + // no footer message for subtables + return; + } + + $out = ''; + EventDispatcher::getInstance()->postEvent('Template.afterCampaignsReport', array(&$out)); + $view->config->show_footer_message = $out; + } } |