Recherche avancée

Médias (0)

Mot : - Tags -/diogene

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (97)

  • Personnaliser les catégories

    21 juin 2013, par

    Formulaire de création d’une catégorie
    Pour ceux qui connaissent bien SPIP, une catégorie peut être assimilée à une rubrique.
    Dans le cas d’un document de type catégorie, les champs proposés par défaut sont : Texte
    On peut modifier ce formulaire dans la partie :
    Administration > Configuration des masques de formulaire.
    Dans le cas d’un document de type média, les champs non affichés par défaut sont : Descriptif rapide
    Par ailleurs, c’est dans cette partie configuration qu’on peut indiquer le (...)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

  • MediaSPIP Player : problèmes potentiels

    22 février 2011, par

    Le lecteur ne fonctionne pas sur Internet Explorer
    Sur Internet Explorer (8 et 7 au moins), le plugin utilise le lecteur Flash flowplayer pour lire vidéos et son. Si le lecteur ne semble pas fonctionner, cela peut venir de la configuration du mod_deflate d’Apache.
    Si dans la configuration de ce module Apache vous avez une ligne qui ressemble à la suivante, essayez de la supprimer ou de la commenter pour voir si le lecteur fonctionne correctement : /** * GeSHi (C) 2004 - 2007 Nigel McNie, (...)

Sur d’autres sites (9373)

  • How to Track Website Visitors : Benefits, Tools and FAQs

    31 août 2023, par Erin — Analytics Tips, Marketing

    Businesses spend a ton of time, money and effort into creating websites that are not only helpful and captivating, but also highly effective at converting visitors. They’ll create content, revise designs, add new pages and change forms, all in the hope of getting visitors to stay on the site and convert into leads or customers.

    When you track website visitors, you can see which of your efforts are moving the needle. While many people are familiar with pageviews as a metric, website visitor tracking can be much more in-depth and insightful.

    In this article, we’ll cover how website visitor tracking works, what you can track, and how this information can improve sales and marketing results. We’ll also explain global privacy concerns and how businesses can choose the right tracking software. 

    What is website visitor tracking ? 

    Website visitor tracking uses software and applications to track and analyse how visitors interact with your website. It’s a vital tool to help businesses understand whether their website design and content are having the desired effect.

    Website with user profile

    Website visitor tracking includes very broad, non-specific data, like how many times visitors have come to your site. But it can also get very specific, with personal information about the user and even recordings of their visit to your site. Site visits, which may include visiting several different pages of the same site, are often referred to as “sessions.”

    Although Google Analytics is the most widely used website visitor tracking software, it isn’t the most comprehensive or powerful. Companies that want a more in-depth understanding of their website may need to consider running a more precise tool alongside Google Analytics, like Matomo.

    As we’ll cover later, website tracking has many important business applications, but it also poses privacy and security concerns, causing some states and countries to impose strict regulations. Privacy laws and your company’s values should also impact what web analytics tool you choose.

    How website tracking works

    Website tracking starts with the collection of data as users interact with the website. Tracking technologies like cookies, JavaScript and pixels are embedded into web pages. These technologies then gather data about user behaviour, session details and user actions, such as pageviews, clicks, form submissions and more.

    More advanced tracking systems assign unique identifiers (such as cookies or visitor IDs) to individual users. This enables tracking of user journeys across multiple sessions and pages. These detailed journeys can often tell a different story and provide different insights than aggregated numbers do. 

    All this collected data is transmitted from the user’s browser to a centralised tracking system, which can be a third-party web analytics tool or a self-hosted solution. The collected data is stored in databases and processed to generate meaningful insights. This process involves organising the data, aggregating metrics, and creating reports.

    Analytics tools process the collected data to generate reports and visualisations that provide insights into user behaviour. Metrics such as pageviews, bounce rates, conversion rates and user paths are analysed. Good web analytics tools are able to present these insights in a user-friendly way. Analysts and marketing professionals then use this knowledge to make informed decisions to improve the user experience (UX).

    Advanced tracking systems allow data segmentation and filtering based on various criteria, such as user demographics, traffic sources, devices and more. This enables deeper analysis of specific user groups. For example, you might find that your conversion rate is much lower when your website is viewed on a mobile device. You can then dig deeper into that segment of data to find out why and experiment with changes that might increase mobile conversions.

    3 types of website tracking and their benefits

    There are three main categories of website tracking, and they each provide different information that can be used by sales, marketing, engineering and others. Here, we cover those three types and how businesses use them to understand customers and create better experiences.

    Website analytics 

    Website analytics is all about understanding the traffic your website receives. This type of tracking allows you to learn how the website performs based on pageviews, real-time traffic, bounce rate and conversions. 

    For example, you would use website analytics to determine how effectively your homepage drives people toward a product or pricing page. You can use pageviews and previous page statistics to learn how many people who land on your homepage read your blog posts. From there, you could use web analytics to determine the conversion rate of the call to action at the end of each article.

    Analytics, user behaviour and information

    User behaviour

    While website analytics focuses on the website’s performance, user behaviour tracking is about monitoring and quantifying user behaviour. One of the most obvious aspects of user behaviour is what they click on, but there are many other actions you can track. 

    The time a user spends on a page can help you determine whether the content on the page is engaging. Some tracking tools can also measure how far down the page a user scrolls, which reveals whether some content is even being seen. 

    Session recordings are another popular tool for analysing user behaviour. They not only show concrete actions, like clicks, but can also show how the user moves throughout the page. Where do they stop ? What do they scroll right past ? This is one example of how user behaviour data can be quantitative or qualitative.

    Visitor information

    Tracking can also include gathering or uncovering information about visitors to your site. This might include demographic information, such as language and location, or details like what device a website visitor is using and on which browser they view your website. 

    This type of data helps your web and marketing teams make better decisions about how to design and format the site. If you know, for example, that the website for your business-to-business (B2B) software is overwhelmingly viewed on desktop computers, that will affect how you structure your pages and choose images. 

    Similarly, if visitor information tells you that you have a significant audience in France, your marketing team might develop new content to appeal to those potential customers.

    Use website visitor tracking to improve marketing, sales and UX 

    Website visitor tracking has various applications for different parts of your business, from marketing to sales and much more. When you understand the impact tracking has on different teams, you can better evaluate your company’s needs and build buy-in among stakeholders.

    Marketing

    At many companies, the marketing team owns and determines what kind of content is on your website. From landing pages to blog posts to the navigation bar, you want to create an experience that drives people toward making a purchase. When marketers can track website visitors, they can get a real look at how visitors respond to and engage with their marketing efforts. Pageviews, conversion rates and time spent on pages help them better understand what your customers care about and what messaging resonates.

    But web analytics can even help marketing teams better understand how their external marketing campaigns are performing. Tracking tools like Matomo reveal your most important traffic sources. The term “traffic source” refers to the content or web property from which someone arrives at your site. 

    For instance, you might notice that an older page got a big boost in traffic this month. You can then check the traffic sources, where you find that an influential LinkedIn user posted a link to the page. This presents an opportunity to adjust the influencer or social media aspects of your marketing strategy.

    Beyond traffic sources, Matomo can provide a visual user journey (also known as User Flow), showing which pages visitors tend to view in a session and even in what order they progress. This gives you a bird’s-eye view of the customer journey.

    Sales

    Just like your marketing team, your sales team can benefit from tracking and analysing website visitor information. Data about user behaviour and visitor demographics helps sales representatives better understand the people they’re talking to. Segmented visitor tracking data can even provide clues as to how to appeal to different buyer personas.

    Sales leadership can use web analytics to gauge interest over time, tie visitors to revenue and develop more accurate sales forecasts and goals. 

    And it’s not just aggregated website tracking data that your sales team can use to better serve customers. They can also use insights about an individual visitor to tailor their approach. Matomo’s Visits Log report and Visitor Profiles allow you to see which pages a prospect has viewed. This tells your sales team which products and features the prospect is most interested in, leading to more relevant interactions and more effective sales efforts.

    User experience and web development

    The way users interact with and experience your website has a big impact on their impression of your brand and, ultimately, whether they become customers. While marketing often controls much of a website’s content, the backend and technical operation of the site usually falls to a web development or engineering team. Website analytics and tracking inform their work, too.

    Along with data about website traffic and conversion rates, web development teams often monitor bounce rates (the percentage of people who leave your website entirely after landing on a page) and page load time (the time it takes for an individual web page to load for a user). Besides the fact that slow loading times inconvenience visitors, they can also negatively affect your search engine optimization (SEO).

    Along with session recordings, user experience teams and web developers may use heatmaps to find out what parts of a page draw a visitor’s attention and where they are most likely to convert or take some other action. They can then use these insights to make a web page more intuitive and useful.

    Visitor tracking and privacy regulations 

    There are different data privacy standards in other parts of the world, which are designed to ensure that businesses collect and use consumer data ethically. The most-discussed of these privacy standards is the General Data Protection Regulation (GDPR), which was instituted by the European Union (EU) but affects businesses worldwide. However, it’s important to note that individual countries or states can have different privacy laws.

    Many privacy laws govern how websites can use cookies to track visitors. With a user’s consent, cookies can help websites identify and remember visitors. However, many web visitors will reject cookie consent banners. When this happens, analysts and marketers can’t collect information from these visitors and have to work with incomplete tracking data. Incomplete data leads to poor decision-making. What’s more, cookie consent banners can create a poor user experience and often annoy web visitors.

    With Matomo’s industry-leading measures to protect user privacy, France’s data protection agency (CNIL) has confirmed that Matomo is exempt from tracking consent in France. Matomo users have peace of mind knowing they can uphold the GDPR and collect data without needing to collect and track cookie consent. Only in Germany and the UK are cookie consent banners still required.

    Choosing user tracking software

    The benefits and value of tracking website visitors are enormous, but not all tracking software is equal. Different tools have different core functionalities. For instance, some focus on user behaviour over traditional web analytics. Others offer detailed website performance data but offer little in the way of visitor information. It’s a good idea to start by identifying your company’s most important tracking goals.

    Along with core features, look for useful tools to experiment with and optimise your website with. For example, Matomo enables A/B testing while many other tools do not.

    Along with users of your website, you also need to think about the employees who will be using the tracking software. The interface can have a big impact on the value you get from a tool. Matomo’s session recording functionality, for example, not only provides you with video but with a colour-coded timeline identifying important user actions.

    Privacy standards and compliance should also be a part of the conversation. Different tools use different tracking methods, impacting accuracy and security and can even cause legal trouble. You should consider which data privacy laws you are subject to, as well as the privacy expectations of your users.

    Cloud-based tool and on-premises software

    Some industries have especially high data security standards. Government and healthcare organisations, for example, may require visitor tracking software that is hosted on their premises. While there are many purely cloud-based software-as-a-service (SaaS) tracking tools, Matomo is available both On-Premise (also known as self-hosted) and in the Cloud.

    Frequently asked questions

    Here are answers to some of people’s most common questions about tracking website visitors.

    Can you track who visited your website ?

    In most cases, tracking your website’s traffic is possible. Still, the extent of the tracking depends on the visitor-tracking technology you use and the privacy settings and precautions the visitor uses. For example, some technologies can pinpoint users by IP address. In other cases, you may only have access to anonymized data.

    Is it legal to track someone’s IP address ?

    It is legal for websites and businesses to track someone’s IP address in the sense that they can identify that someone from the same IP address is visiting a page repeatedly. Under the General Data Protection Regulation (GDPR), IP addresses are considered personally identifiable information (PII). The GDPR mandates that websites only log and store a user’s IP address with the user’s consent.

    How do you find where visitors are clicking the most ?

    Heatmap tools are among the most common tools for learning where visitors click the most on your website. Heatmaps use colour-coding to show what parts of a web page users either click on or hover over the most.

    Unique tracking URLs are another way to determine what part of your website gets the most clicks. For example, if you have three links on a page that all go to the same destination, you can use tracking links to determine how many clicks each link generates.

    Matomo also offers a Tag Manager within the platform that lets you manage and unify all your tracking and marketing tags to find out where visitors are clicking.

    What is the best tool for website visitor tracking ?

    Like most tools, the best website visitor tracking tool depends on your needs. Each tool offers different functionalities, user interfaces and different levels of accuracy and privacy. Matomo is a good choice for companies that value privacy, compliance and accuracy.

    Tracking for powerful insights and better performance

    Tracking website visitors is now a well-ingrained part of business operations. From sales reps seeking to understand their leads to marketers honing their ad spend, tracking helps teams do their jobs better.

    Take the time to consider what you want to learn from website tracking and let those priorities guide your choice of visitor tracking software. Whatever your industry or needs, user privacy and compliance must be a priority.

    Find out how much detail and insight Matomo can give you with our free 21-day trial — no credit card required.

  • 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.