Recherche avancée

Médias (91)

Autres articles (70)

  • Support de tous types de médias

    10 avril 2011

    Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...) ; audio (MP3, Ogg, Wav et autres...) ; vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...) ; contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google Earth) (...)

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 est la première version de MediaSPIP stable.
    Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • Les tâches Cron régulières de la ferme

    1er décembre 2010, par

    La gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
    Le super Cron (gestion_mutu_super_cron)
    Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)

Sur d’autres sites (4717)

  • A Guide to App Analytics Tools that Drive Growth

    7 mars, par Daniel Crough — App Analytics

    Mobile apps are big business, generating £438 billion in global revenue between in-app purchases (38%) and ad revenue (60%). And with 96% of apps relying on in-app monetisation, the competition is fierce.

    To succeed, app developers and marketers need strong app analytics tools to understand their customers’ experiences and the effectiveness of their development efforts.

    This article discusses app analytics, how it works, the importance and benefits of mobile app analytics tools, key metrics to track, and explores five of the best app analytics tools on the market.

    What are app analytics tools ?

    Mobile app analytics tools are software solutions that provide insights into how users interact with mobile applications. They track user behaviour, engagement and in-app events to reveal what’s working well and what needs improvement.

    Insights gained from mobile app analytics help companies make more informed decisions about app development, marketing campaigns and monetisation strategies.

    What do app analytics tools do ?

    App analytics tools embed a piece of code, called a software development kit (SDK), into an app. These SDKs provide the essential infrastructure for the following functions :

    • Data collection : The SDK collects data within your app and records user actions and events, like screen views, button clicks, and in-app purchases.
    • Data filtering : SDKs often include mechanisms to filter data, ensuring that only relevant information is collected.
    • Data transmission : Once collected and filtered, the SDK securely transmits the data to an analytics server. The SDK provider can host this server (like Firebase or Amplitude), or you can host it on-premise.
    • Data processing and analysis : Servers capture, process and analyse large stores of data and turn it into useful information.
    • Visualisation and reporting : Dashboards, charts and graphs present processed data in a user-friendly format.
    Schematics of how mobile app analytics tools work

    Six ways mobile app analytics tools fuel marketing success and drive product growth

    Mobile app analytics tools are vital in driving product development, enhancing user experiences, and achieving business objectives.

    #1. Improving user understanding

    The better a business understands its customers, the more likely it is to succeed. For mobile apps, that means understanding how and why people use them.

    Mobile analytics tools provide detailed insights into user behaviours and preferences regarding apps. This knowledge helps marketing teams create more targeted messaging, detailed customer journey maps and improve user experiences.

    It also helps product teams understand the user experience and make improvements based on those insights.

    For example, ecommerce companies might discover that users in a particular area are more likely to buy certain products. This allows the company to tailor its offers and promotions to target the audience segments most likely to convert.

    #2 Optimising monetisation strategies for increased revenue and user retention

    In-app purchases and advertising make up 38% and 60% of mobile app revenue worldwide, respectively. App analytics tools provide insights companies need to optimise app monetisation by :

    • Analysing purchase patterns to identify popular products and understand pricing sensitivities.
    • Tracking in-app behaviour to identify opportunities for enhancing user engagement.

    App analytics can track key metrics like visit duration, user flow, and engagement patterns. These metrics provide critical information about user experiences and can help identify areas for improvement.

    How meaningful are the impacts ?

    Duolingo, the popular language learning app, reported revenue growth of 45% and an increase in daily active users (DAU) of 65% in its Q4 2023 financial report. The company attributed this success to its in-house app analytics platform.

    Duolingo logo showing statistics of growth from 2022 to 2023, in part thanks to an in-house app analytics tool.

    #3. Understanding user experiences

    Mobile app analytics tools track the performance of user interactions within your app, such as :

    • Screen views : Which screens users visit most frequently
    • User flow : How users navigate through your app
    • Session duration : How long users spend in your app
    • Interaction events : Which buttons, features, and functions users engage with most

    Knowing how users interact with your app can help refine your approach, optimise your efforts, and drive more conversions.

    #4. Personalising user experiences

    A recent McKinsey survey showed that 71% of users expect personalised app experiences. Product managers must stay on top of this since 76% of users get frustrated if they don’t receive the personalisation they expect.

    Personalisation on mobile platforms requires data capture and analysis. Mobile analytics platforms can provide the data to personalise the user onboarding process, deliver targeted messages and recommend relevant content or offers.

    Spotify is a prime example of personalisation done right. A recent case study by Pragmatic Institute attributed the company’s growth to over 500 million active daily users to its ability to capture, analyse and act on :

    • Search behaviour
    • Individual music preferences
    • Playlist data
    • Device usage
    • Geographical location

    The streaming service uses its mobile app analytics software to turn this data into personalised music recommendations for its users. Spotify also has an in-house analytics tool called Spotify Premium Analytics, which helps artists and creators better understand their audience.

    #5. Enhancing app performance

    App analytics tools can help identify performance issues that might be affecting user experience. By monitoring metrics like load time and app performance, developers can pinpoint areas that need improvement.

    Performance optimisation is crucial for user retention. According to Google research, 53% of mobile site visits are abandoned if pages take longer than three seconds to load. While this statistic refers to websites, similar principles apply to apps—users expect fast, responsive experiences.

    Analytics data can help developers prioritise performance improvements by showing which screens or features users interact with most frequently, allowing teams to focus their optimisation efforts where they’ll have the greatest impact.

    #6. Identifying growth opportunities

    App analytics tools can reveal untapped opportunities for growth by highlighting :

    • Features users engage with most
    • Underutilised app sections that might benefit from redesign
    • Common user paths that could be optimised
    • Moments where users tend to drop off

    This intelligence helps product teams make data-informed decisions about future development priorities, feature enhancements, and potential new offerings.

    For example, a streaming service might discover through analytics that users who create playlists have significantly higher retention rates. This insight could lead to development of enhanced playlist functionality to encourage more users to create them, ultimately boosting overall retention.

    Key app metrics to track

    Using mobile analytics tools, you can track dozens of key performance indicators (KPIs) that measure everything from customer engagement to app performance. This section focuses on the most important KPIs for app analytics, classified into three categories :

    • App performance KPIs
    • User engagement KPIs
    • Business impact KPIs

    While the exact metrics to track will vary based on your specific goals, these fundamental KPIs form the foundation of effective app analytics.

    Mobile App Analytics KPIs

    App performance KPIs

    App performance metrics tell you whether an app is reliable and operating properly. They help product managers identify and address technical issues that may negatively impact user experiences.

    Some key metrics to assess performance include :

    • Screen load time : How quickly screens load within your app
    • App stability : How often your app crashes or experiences errors
    • Response time : How quickly your app responds to user interactions
    • Network performance : How efficiently your app handles data transfers

    User engagement KPIs

    Engagement KPIs provide insights into how users interact with an app. These metrics help you understand user behaviour and make UX improvements.

    Important engagement metrics include :

    • Returning visitors : A measure of how often users return to an app
    • Visit duration : How long users spend in your app per session
    • User flow : Visualisation of the paths users take through your app, offering insights into navigation patterns
    • Event tracking : Specific interactions users have with app elements
    • Screen views : Which screens are viewed most frequently

    Business impact KPIs

    Business impact KPIs connect app analytics to business outcomes, helping demonstrate the app’s value to the organisation.

    Key business impact metrics include :

    • Conversion events : Completion of desired actions within your app
    • Goal completions : Tracking when users complete specific objectives
    • In-app purchases : Monitoring revenue from within the app
    • Return on investment : Measuring the business value generated relative to development costs

    Privacy and app analytics : A delicate balance

    While app analytics tools can be a rich source of user data, they must be used responsibly. Tracking user in-app behaviour and collecting user data, especially without consent, can raise privacy concerns and erode user trust. It can also violate data privacy laws like the GDPR in Europe or the OCPA, FDBR and TDPSA in the US.

    With that in mind, it’s wise to choose user-tracking tools that prioritise user privacy while still collecting enough data for reliable analysis.

    Matomo is a privacy-focused web and app analytics solution that allows you to collect and analyse user data while respecting user privacy and following data protection rules like GDPR.

    The five best app analytics tools to prove marketing value

    In this section, we’ll review the five best app analytics tools based on their features, pricing and suitability for different use cases.

    Matomo — Best for privacy-compliant app analytics

    Matomo app analytics is a powerful, open-source platform that prioritises data privacy and compliance.

    It offers a suite of features for tracking user engagement and conversions across websites, mobile apps and intranets.

    Key features

    • Complete data ownership : Full control over your analytics data with no third-party access
    • User flow analysis : Track user journeys across different screens in your app
    • Custom event tracking : Monitor specific user interactions with customisable events
    • Ecommerce tracking : Measure purchases and product interactions
    • Goal conversion monitoring : Track completion of important user actions
    • Unified analytics : View web and app analytics in one platform for a complete digital picture

    Benefits

    • Eliminate compliance risks without sacrificing insights
    • Get accurate data with no sampling or data manipulation
    • Choose between self-hosting or cloud deployment
    • Deploy one analytics solution across your digital properties (web and app) for a single source of truth

    Pricing

    PlanPrice
    CloudStarts at £19/month
    On-PremiseFree

    Matomo is a smart choice for businesses that value data privacy and want complete control over their analytics data. It’s particularly well-suited for organisations in highly regulated industries, like banking.

    While Matomo’s app analytics features focus on core analytics capabilities, its privacy-first approach offers unique advantages. For organisations already using Matomo for web analytics, extending to mobile creates a unified analytics ecosystem with consistent privacy standards across all digital touchpoints, giving organisations a complete picture of the customer journey.

    Firebase — Best for Google services integration

    Firebase is the mobile app version of Google Analytics. It’s the most popular app analytics tool on the market, with over 99% of Android apps and 77% of iOS apps using Firebase.

    Firebase is popular because it works well with other Google services. It also has many features, like crash reporting, A/B testing and user segmentation.

    Pricing

    PlanPrice
    SparkFree
    BlazePay-as-you-go based on usage
    CustomBespoke pricing for high-volume enterprise users

    Adobe Analytics — Best for enterprise app analytics

    Adobe Analytics is an enterprise-grade analytics solution that provides valuable insights into user behaviour and app performance.

    It’s part of the Adobe Marketing Cloud and integrates easily with other Adobe products. Adobe Analytics is particularly well-suited for large organisations with complex analytics needs.

    Pricing

    PlanPrice
    SelectPricing on quote
    PrimePricing on quote
    UltimatePricing on quote

    While you must request a quote for pricing, Scandiweb puts Adobe Analytics at £2,000/mo–£2,500/mo for most companies, making it an expensive option.

    Apple App Analytics — Best for iOS app analysis

    Apple App Analytics is a free, built-in analytics tool for iOS app developers.

    This analytics platform provides basic insights into user engagement, app performance and marketing campaigns. It has fewer features than other tools on this list, but it’s a good place for iOS developers who want to learn how their apps work.

    Pricing

    Apple Analytics is free.

    Amplitude — Best for product analytics

    Amplitude is a product analytics platform that helps businesses understand user behaviour and build better products.

    It excels at tracking user journeys, identifying user segments and measuring the impact of product changes. Amplitude is a good choice for product managers and data analysts who want to make informed decisions about product development.

    Pricing

    PlanPrice
    StarterFree
    PlusFrom £49/mo
    GrowthPricing on quote

    Choose Matomo’s app analytics to unlock growth

    App analytics tools help marketers and product development teams understand user experiences, improve app performance and enhance products. Some of the best app analytics tools available for 2025 include Matomo, Firebase and Amplitude.

    However, as you evaluate your options, consider taking a privacy-first approach to app data collection and analysis, especially if you’re in a highly regulated industry like banking or fintech. Matomo Analytics offers a powerful and ethical solution that allows you to gain valuable insights while respecting user privacy.

    Ready to take control of your app analytics ? Start your 21-day free trial.

  • How to add new pages and menu items to Piwik – Introducing the Piwik Platform

    11 septembre 2014, par Thomas Steur — Development

    This is the next post of our blog series where we introduce the capabilities of the Piwik platform (our previous post was How to create a widget). This time you’ll learn how to extend Piwik by adding new pages and menu items. For this tutorial you will need to have basic knowledge of PHP and optionally of Twig which is the template engine we use.

    What can be displayed in a page ?

    To make it short : You can display any corporate related content, key metrics, news, help pages, custom reports, contact details, information about your server, forms to manage any data and anything else.

    Getting started

    In this series of posts, we assume that you have already set up your development environment. If not, visit the Piwik Developer Zone where you’ll find the tutorial Setting up Piwik.

    To summarize the things you have to do to get setup :

    • Install Piwik (for instance via git).
    • Activate the developer mode : ./console development:enable --full.
    • Generate a plugin : ./console generate:plugin --name="MyControllerPlugin". There should now be a folder plugins/MyControllerPlugin.
    • And activate the created plugin under Settings => Plugins.

    Let’s start creating a page

    We start by using the Piwik Console to create a new page :

    ./console generate:controller

    The command will ask you to enter the name of the plugin the controller should belong to. I will simply use the above chosen plugin name “MyControllerPlugin”. There should now be two files plugins/MyControllerPlugin/Controller.php and plugins/MyControllerPlugin/templates/index.twig which both already contain an example to get you started easily :

    Controller.php

    1. class Controller extends \Piwik\Plugin\Controller
    2. {
    3.     public function index()
    4.     {
    5.         return $this->renderTemplate('index', array(
    6.              'answerToLife' => 42
    7.         ));
    8.     }
    9. }

    Télécharger

    and templates/index.twig

    1. {% extends 'dashboard.twig' %}
    2.  
    3. {% block content %}
    4.     <strong>Hello world!</strong>
    5.     <br/>
    6.  
    7.     The answer to life is {{ answerToLife }}
    8. {% endblock %}

    Télécharger

    Note : If you are generating the Controller before Piwik 2.7.0 the example will look slightly different.

    The controller action index assigns the view variable answerToLife to the view and renders the Twig template templates/index.twig. Any variable assigned this way can then be used in the view using for example {{ answerToLife }}.

    Using a Twig template to generate the content of your page is actually optional : instead feel free to generate any content as desired and return a string in your controller action.

    As the above template index.twig is extending the dashboard template the Logo as well as the top menu will automatically appear on top of your content which is defined within the block content.

    Rendered page content

    How to display the page within the admin

    If you would like to add the admin menu on the left you have to modify the following parts :

    • Extend \Piwik\Plugin\ControllerAdmin instead of \Piwik\Plugin\Controller in the file Controller.php. In a future version of Piwik this step will be no longer neccessary, see #6151
    • Extend the template admin.twig instead of dashboard.twig
    • Define a headline using an H2-element
    1. {% extends 'admin.twig' %}
    2.  
    3. {% block content %}
    4.     <h2>Hello world!</h2>
    5.     <br/>
    6.  
    7.     The answer to life is {{ answerToLife }}
    8. {% endblock %}

    Télécharger

    Note : Often one needs to add a page to the admin to make a plugin configurable. We have a unified solution for this using the Settings API.

    Admin page

    How to display a blank page

    If you would like to generate a blank page that shows only your content the template should contain only your markup as follows :

    1. <strong>Hello world!</strong>
    2. <br/>
    3.  
    4. The answer to life is {{ answerToLife }}

    Télécharger

    Predefined variables, UI components, security and accessing query parameters

    In this blog post we only cover the basics to get you started. We highly recommend to read the MVC guide on our developer pages which covers some of those advanced topics. For instance you might be wondering how to securely access $_GET or $_POST parameters, you might want to restrict the content of your page depending on a user role, and much more.

    If you would like to know how to make use of JavaScript, CSS and Less have a look at our Working with Piwik’s UI guide.

    Note : How to include existing UI components such as a site selector or a date selector will be covered in a future blog post. Also, there are default variables assigned to the view depending on the context. A list of those variables that may or may not be defined is unfortunately not available yet but we will catch up on this.

    Let’s add a menu item to make the page accessible

    So far you have created a page but you can still not access it. Therefore we need to add a menu item to one of the Piwik menus. We start by using the Piwik Console to create a menu template :

    ./console generate:menu

    The command will ask you to enter the name of the plugin the menu should belong to. I will use again the above chosen plugin name “MyControllerPlugin”. There should now be a file plugins/MyControllerPlugin/Menu.php which contains an example to get you started easily :

    Menu.php

    1. class Menu extends \Piwik\Plugin\Menu
    2. {
    3.     public function configureUserMenu(MenuUser $menu)
    4.     {
    5.         // reuse an existing category.
    6.         $menu->addManageItem('My User Item', $this->urlForAction('showList'));
    7.  
    8.         // or create a custom category
    9.         $menu->addItem('My Custom Category', 'My User Item', $this->urlForDefaultAction());
    10.     }
    11. }

    Télécharger

    This is only a part of the generated template since all the examples of the different menus are similar. You can add items to four menus :

    • configureReportingMenu To add a new item to the reporting menu which includes all the reports like “Actions” and “Visitors”.
    • configureAdminMenu To add a new item to the admin menu which includes items like “User settings” and “Websites”.
    • configureTopMenu To add a new item to the top menu which includes items like “All Websites” and “Logout”.
    • configureUserMenu To add a new item to the user menu which is accessible when clicking on the username on the top right.

    In this blog post we will add a new item to the user menu and to do so we adjust the generated template like this :

    1. class Menu extends \Piwik\Plugin\Menu
    2. {
    3.     public function configureUserMenu(MenuUser $menu)
    4.     {
    5.         $menu->addManageItem('My User Item', $this->urlForAction($method = 'index'), $orderId = 30);
    6.     }
    7. }

    Télécharger

    That’s it. This will add a menu item named “My User Item” to the “Manage” section of the user menu. When a user chooses the menu item, the “index” method of your controller will be executed and your previously created page will be first rendered and then displayed. Optionally, you can define an order to influence the position of the menu item within the manage section. Following this example you can add an item to any menu for any action. I think you get the point !

    User menu

    Note : In Piwik 2.6.0 and before the above example would look like this :

    1. class Menu extends \Piwik\Plugin\Menu
    2. {
    3.     public function configureUserMenu(MenuUser $menu)
    4.     {
    5.         $menu->addManageItem('My User Item', array($module = 'MyControllerPlugin', $action = 'index'), $orderId = 30);
    6.     }
    7. }

    Télécharger

    How to test a page

    After you have created your page you are surely wondering how to test it. A controller should be usually very simple as it is only the connector between model and view. Therefore, we do usually not create unit or integration test for controllers and for the view less than ever. Instead we would create a UI test that takes a screenshot of your page and compares it with an expected screenshot. Luckily, there is already a section UI tests in our Automated tests guide.

    Publishing your Plugin on the Marketplace

    In case you want to share your page with other Piwik users you can do this by pushing your plugin to a public GitHub repository and creating a tag. Easy as that. Read more about how to distribute a plugin.

    Advanced features

    Isn’t it easy to create a page ? We never even created a file ! Of course, based on our API design principle “The complexity of our API should never exceed the complexity of your use case.” you can accomplish more if you want : You can make use of Vanilla JavaScript, jQuery, AngularJS, Less and CSS, you can reuse UI components, you can access query parameters and much more.

    Would you like to know more about this ? Go to our MVC (Model-View-Controller) and Working with Piwik’s UI guides in the Piwik Developer Zone.

    If you have any feedback regarding our APIs or our guides in the Developer Zone feel free to send it to us.

  • How to add new pages and menu items to Piwik – Introducing the Piwik Platform

    11 septembre 2014, par Thomas Steur — Development

    This is the next post of our blog series where we introduce the capabilities of the Piwik platform (our previous post was How to create a widget). This time you’ll learn how to extend Piwik by adding new pages and menu items. For this tutorial you will need to have basic knowledge of PHP and optionally of Twig which is the template engine we use.

    What can be displayed in a page ?

    To make it short : You can display any corporate related content, key metrics, news, help pages, custom reports, contact details, information about your server, forms to manage any data and anything else.

    Getting started

    In this series of posts, we assume that you have already set up your development environment. If not, visit the Piwik Developer Zone where you’ll find the tutorial Setting up Piwik.

    To summarize the things you have to do to get setup :

    • Install Piwik (for instance via git).
    • Activate the developer mode : ./console development:enable --full.
    • Generate a plugin : ./console generate:plugin --name="MyControllerPlugin". There should now be a folder plugins/MyControllerPlugin.
    • And activate the created plugin under Settings => Plugins.

    Let’s start creating a page

    We start by using the Piwik Console to create a new page :

    ./console generate:controller

    The command will ask you to enter the name of the plugin the controller should belong to. I will simply use the above chosen plugin name “MyControllerPlugin”. There should now be two files plugins/MyControllerPlugin/Controller.php and plugins/MyControllerPlugin/templates/index.twig which both already contain an example to get you started easily :

    Controller.php

    1. class Controller extends \Piwik\Plugin\Controller
    2. {
    3.     public function index()
    4.     {
    5.         return $this->renderTemplate('index', array(
    6.              'answerToLife' => 42
    7.         ));
    8.     }
    9. }

    Télécharger

    and templates/index.twig

    1. {% extends 'dashboard.twig' %}
    2.  
    3. {% block content %}
    4.     <strong>Hello world!</strong>
    5.     <br/>
    6.  
    7.     The answer to life is {{ answerToLife }}
    8. {% endblock %}

    Télécharger

    Note : If you are generating the Controller before Piwik 2.7.0 the example will look slightly different.

    The controller action index assigns the view variable answerToLife to the view and renders the Twig template templates/index.twig. Any variable assigned this way can then be used in the view using for example {{ answerToLife }}.

    Using a Twig template to generate the content of your page is actually optional : instead feel free to generate any content as desired and return a string in your controller action.

    As the above template index.twig is extending the dashboard template the Logo as well as the top menu will automatically appear on top of your content which is defined within the block content.

    Rendered page content

    How to display the page within the admin

    If you would like to add the admin menu on the left you have to modify the following parts :

    • Extend \Piwik\Plugin\ControllerAdmin instead of \Piwik\Plugin\Controller in the file Controller.php. In a future version of Piwik this step will be no longer neccessary, see #6151
    • Extend the template admin.twig instead of dashboard.twig
    • Define a headline using an H2-element
    1. {% extends 'admin.twig' %}
    2.  
    3. {% block content %}
    4.     <h2>Hello world!</h2>
    5.     <br/>
    6.  
    7.     The answer to life is {{ answerToLife }}
    8. {% endblock %}

    Télécharger

    Note : Often one needs to add a page to the admin to make a plugin configurable. We have a unified solution for this using the Settings API.

    Admin page

    How to display a blank page

    If you would like to generate a blank page that shows only your content the template should contain only your markup as follows :

    1. <strong>Hello world!</strong>
    2. <br/>
    3.  
    4. The answer to life is {{ answerToLife }}

    Télécharger

    Predefined variables, UI components, security and accessing query parameters

    In this blog post we only cover the basics to get you started. We highly recommend to read the MVC guide on our developer pages which covers some of those advanced topics. For instance you might be wondering how to securely access $_GET or $_POST parameters, you might want to restrict the content of your page depending on a user role, and much more.

    If you would like to know how to make use of JavaScript, CSS and Less have a look at our Working with Piwik’s UI guide.

    Note : How to include existing UI components such as a site selector or a date selector will be covered in a future blog post. Also, there are default variables assigned to the view depending on the context. A list of those variables that may or may not be defined is unfortunately not available yet but we will catch up on this.

    Let’s add a menu item to make the page accessible

    So far you have created a page but you can still not access it. Therefore we need to add a menu item to one of the Piwik menus. We start by using the Piwik Console to create a menu template :

    ./console generate:menu

    The command will ask you to enter the name of the plugin the menu should belong to. I will use again the above chosen plugin name “MyControllerPlugin”. There should now be a file plugins/MyControllerPlugin/Menu.php which contains an example to get you started easily :

    Menu.php

    1. class Menu extends \Piwik\Plugin\Menu
    2. {
    3.     public function configureUserMenu(MenuUser $menu)
    4.     {
    5.         // reuse an existing category.
    6.         $menu->addManageItem('My User Item', $this->urlForAction('showList'));
    7.  
    8.         // or create a custom category
    9.         $menu->addItem('My Custom Category', 'My User Item', $this->urlForDefaultAction());
    10.     }
    11. }

    Télécharger

    This is only a part of the generated template since all the examples of the different menus are similar. You can add items to four menus :

    • configureReportingMenu To add a new item to the reporting menu which includes all the reports like “Actions” and “Visitors”.
    • configureAdminMenu To add a new item to the admin menu which includes items like “User settings” and “Websites”.
    • configureTopMenu To add a new item to the top menu which includes items like “All Websites” and “Logout”.
    • configureUserMenu To add a new item to the user menu which is accessible when clicking on the username on the top right.

    In this blog post we will add a new item to the user menu and to do so we adjust the generated template like this :

    1. class Menu extends \Piwik\Plugin\Menu
    2. {
    3.     public function configureUserMenu(MenuUser $menu)
    4.     {
    5.         $menu->addManageItem('My User Item', $this->urlForAction($method = 'index'), $orderId = 30);
    6.     }
    7. }

    Télécharger

    That’s it. This will add a menu item named “My User Item” to the “Manage” section of the user menu. When a user chooses the menu item, the “index” method of your controller will be executed and your previously created page will be first rendered and then displayed. Optionally, you can define an order to influence the position of the menu item within the manage section. Following this example you can add an item to any menu for any action. I think you get the point !

    User menu

    Note : In Piwik 2.6.0 and before the above example would look like this :

    1. class Menu extends \Piwik\Plugin\Menu
    2. {
    3.     public function configureUserMenu(MenuUser $menu)
    4.     {
    5.         $menu->addManageItem('My User Item', array($module = 'MyControllerPlugin', $action = 'index'), $orderId = 30);
    6.     }
    7. }

    Télécharger

    How to test a page

    After you have created your page you are surely wondering how to test it. A controller should be usually very simple as it is only the connector between model and view. Therefore, we do usually not create unit or integration test for controllers and for the view less than ever. Instead we would create a UI test that takes a screenshot of your page and compares it with an expected screenshot. Luckily, there is already a section UI tests in our Automated tests guide.

    Publishing your Plugin on the Marketplace

    In case you want to share your page with other Piwik users you can do this by pushing your plugin to a public GitHub repository and creating a tag. Easy as that. Read more about how to distribute a plugin.

    Advanced features

    Isn’t it easy to create a page ? We never even created a file ! Of course, based on our API design principle “The complexity of our API should never exceed the complexity of your use case.” you can accomplish more if you want : You can make use of Vanilla JavaScript, jQuery, AngularJS, Less and CSS, you can reuse UI components, you can access query parameters and much more.

    Would you like to know more about this ? Go to our MVC (Model-View-Controller) and Working with Piwik’s UI guides in the Piwik Developer Zone.

    If you have any feedback regarding our APIs or our guides in the Developer Zone feel free to send it to us.