Recherche avancée

Médias (91)

Autres articles (63)

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

  • Configurer la prise en compte des langues

    15 novembre 2010, par

    Accéder à la configuration et ajouter des langues prises en compte
    Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
    De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
    Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)

  • Sélection de projets utilisant MediaSPIP

    29 avril 2011, par

    Les exemples cités ci-dessous sont des éléments représentatifs d’usages spécifiques de MediaSPIP pour certains projets.
    Vous pensez avoir un site "remarquable" réalisé avec MediaSPIP ? Faites le nous savoir ici.
    Ferme MediaSPIP @ Infini
    L’Association Infini développe des activités d’accueil, de point d’accès internet, de formation, de conduite de projets innovants dans le domaine des Technologies de l’Information et de la Communication, et l’hébergement de sites. Elle joue en la matière un rôle unique (...)

Sur d’autres sites (4749)

  • How to expose new API methods in the HTTP Reporting API – Introducing the Piwik Platform

    26 février 2015, 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 write UI tests for your plugin). This time you’ll learn how to extend our Reporting API. For this tutorial you will need to have basic knowledge of PHP.

    What is Piwik’s Reporting API ?

    It allows third party applications to access analytics data and manipulate miscellaneous data (such as users or websites) through HTTP requests.

    What is it good for ?

    The Reporting API is used by the Piwik UI to render reports, to manage users, and more. If you want to add a feature to the Piwik UI, you might have to expose a method in the API to access this data. As the API is called via HTTP it allows you to fetch or manipulate any Piwik related data from anywhere. In these exposed API methods you can do pretty much anything you want, for example :

    • Enhance existing reports with additional data
    • Filter existing reports based on custom rules
    • Access the database and generate custom reports
    • Persist and read any data
    • Request server information

    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.
    • Generate a plugin : ./console generate:plugin --name="MyApiPlugin". There should now be a folder plugins/MyApiPlugin.
    • And activate the created plugin : ./console plugin:activate "MyApiPlugin"

    Let’s start creating an API

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

    ./console generate:api

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

    1. class API extends \Piwik\Plugin\API
    2. {
    3.     public function getAnswerToLife($truth = true)
    4.     {
    5.         if ($truth) {
    6.             return 42;
    7.         }
    8.  
    9.         return 24;
    10.     }
    11.  
    12.     public function getExampleReport($idSite, $period, $date, $wonderful = false)
    13.     {
    14.         $table = DataTable::makeFromSimpleArray(array(
    15.             array('label' => 'My Label 1', 'nb_visits' => '1'),
    16.             array('label' => 'My Label 2', 'nb_visits' => '5'),
    17.         ));
    18.  
    19.         return $table;
    20.     }
    21. }

    Télécharger

    Any public method in that file will be available via the Reporting API. For example the method getAnswerToLife can be called via this URL : index.php?module=API&method=MyApiPlugin.getAnswerToLife. The URL parameter method is a combination of your plugin name and the method name within this class.

    Passing parameters to your method

    Both example methods define some parameters. To pass any value to a parameter of your method simply specify them by name in the URL. For example ...&method=MyApiPlugin.getExampleReport&idSite=1&period=week&date=today&wonderful=1 to pass values to the parameters of the method getExampleReport.

    Returning a value

    In an API method you can return any boolean, number, string or array value. A resource or an object cannot be returned unless it implements the DataTableInterface such as DataTable (the primary data structure used to store analytics data in Piwik), DataTable\Map (stores a set of DataTables) and DataTable\Simple (a DataTable where every row has two columns : label and value).

    Did you know ? You can choose the response format of your API request by appending a parameter &format=JSON|XML|CSV|... to the URL. Check out the Reporting API Reference for more information.

    Best practices

    Check user permissions

    Do not forget to check whether a user actually has permissions to access data or to perform an action. If you’re not familiar with Piwik’s permissions and how to check them read our User Permission guide.

    Keep API methods small

    At Piwik we aim to write clean code. Therefore, we recommend to keep API methods small (separation of concerns). An API pretty much acts like a Controller :

    1. public function createLdapUser($idSite, $login, $password)
    2. {
    3.     Piwik::checkUserHasAdminAccess($idSite);
    4.     $this->checkLogin($login);
    5.     $this->checkPassword($password);
    6.    
    7.     $myModel = new LdapModel();
    8.     $success = $myModel->createUser($idSite, $login, $password);
    9.    
    10.     return $success;
    11. }

    Télécharger

    This is not only easy to read, it will also allow you to create simple tests for LdapModel (without having to bootstrap the whole Piwik layer) and you will be able to reuse it in other places if needed.

    Calling APIs of other plugins

    For example if you want to fetch an existing report from another plugin, say a list of all Page URLs, do not request this report by calling that method directly :

    \Piwik\Plugins\Actions\API::getInstance()->getPageUrls($idSite, $period, $date);

    . Instead, issue a new API request :

    $report = \Piwik\API\Request::processRequest('Actions.getPageUrls', array(
       'idSite' => $idSite,
       'period' => $period,
       'date'   => $date,
    ));

    This has several advantages :

    • It avoids a fatal error if the requested plugin is not available on a Piwik installation
    • Other plugins can extend the called API method via events (adding additional report data to a report, doing additional permission checks) but those events will be only triggered when requesting the report as suggested
    • If the method parameters change, your request will most likely still work

    Publishing your Plugin on the Marketplace

    In case you want to share your API 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 and best practices when publishing a plugin.

    Isn’t it easy to create a API ? We never even created a file ! If you have any feedback regarding our APIs or our guides in the Developer Zone feel free to send it to us.

  • How to expose new API methods in the HTTP Reporting API – Introducing the Piwik Platform

    26 février 2015, 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 write UI tests for your plugin). This time you’ll learn how to extend our Reporting API. For this tutorial you will need to have basic knowledge of PHP.

    What is Piwik’s Reporting API ?

    It allows third party applications to access analytics data and manipulate miscellaneous data (such as users or websites) through HTTP requests.

    What is it good for ?

    The Reporting API is used by the Piwik UI to render reports, to manage users, and more. If you want to add a feature to the Piwik UI, you might have to expose a method in the API to access this data. As the API is called via HTTP it allows you to fetch or manipulate any Piwik related data from anywhere. In these exposed API methods you can do pretty much anything you want, for example :

    • Enhance existing reports with additional data
    • Filter existing reports based on custom rules
    • Access the database and generate custom reports
    • Persist and read any data
    • Request server information

    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.
    • Generate a plugin : ./console generate:plugin --name="MyApiPlugin". There should now be a folder plugins/MyApiPlugin.
    • And activate the created plugin : ./console plugin:activate "MyApiPlugin"

    Let’s start creating an API

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

    ./console generate:api

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

    1. class API extends \Piwik\Plugin\API
    2. {
    3.     public function getAnswerToLife($truth = true)
    4.     {
    5.         if ($truth) {
    6.             return 42;
    7.         }
    8.  
    9.         return 24;
    10.     }
    11.  
    12.     public function getExampleReport($idSite, $period, $date, $wonderful = false)
    13.     {
    14.         $table = DataTable::makeFromSimpleArray(array(
    15.             array('label' => 'My Label 1', 'nb_visits' => '1'),
    16.             array('label' => 'My Label 2', 'nb_visits' => '5'),
    17.         ));
    18.  
    19.         return $table;
    20.     }
    21. }

    Télécharger

    Any public method in that file will be available via the Reporting API. For example the method getAnswerToLife can be called via this URL : index.php?module=API&method=MyApiPlugin.getAnswerToLife. The URL parameter method is a combination of your plugin name and the method name within this class.

    Passing parameters to your method

    Both example methods define some parameters. To pass any value to a parameter of your method simply specify them by name in the URL. For example ...&method=MyApiPlugin.getExampleReport&idSite=1&period=week&date=today&wonderful=1 to pass values to the parameters of the method getExampleReport.

    Returning a value

    In an API method you can return any boolean, number, string or array value. A resource or an object cannot be returned unless it implements the DataTableInterface such as DataTable (the primary data structure used to store analytics data in Piwik), DataTable\Map (stores a set of DataTables) and DataTable\Simple (a DataTable where every row has two columns : label and value).

    Did you know ? You can choose the response format of your API request by appending a parameter &format=JSON|XML|CSV|... to the URL. Check out the Reporting API Reference for more information.

    Best practices

    Check user permissions

    Do not forget to check whether a user actually has permissions to access data or to perform an action. If you’re not familiar with Piwik’s permissions and how to check them read our User Permission guide.

    Keep API methods small

    At Piwik we aim to write clean code. Therefore, we recommend to keep API methods small (separation of concerns). An API pretty much acts like a Controller :

    1. public function createLdapUser($idSite, $login, $password)
    2. {
    3.     Piwik::checkUserHasAdminAccess($idSite);
    4.     $this->checkLogin($login);
    5.     $this->checkPassword($password);
    6.    
    7.     $myModel = new LdapModel();
    8.     $success = $myModel->createUser($idSite, $login, $password);
    9.    
    10.     return $success;
    11. }

    Télécharger

    This is not only easy to read, it will also allow you to create simple tests for LdapModel (without having to bootstrap the whole Piwik layer) and you will be able to reuse it in other places if needed.

    Calling APIs of other plugins

    For example if you want to fetch an existing report from another plugin, say a list of all Page URLs, do not request this report by calling that method directly :

    \Piwik\Plugins\Actions\API::getInstance()->getPageUrls($idSite, $period, $date);

    . Instead, issue a new API request :

    $report = \Piwik\API\Request::processRequest('Actions.getPageUrls', array(
       'idSite' => $idSite,
       'period' => $period,
       'date'   => $date,
    ));

    This has several advantages :

    • It avoids a fatal error if the requested plugin is not available on a Piwik installation
    • Other plugins can extend the called API method via events (adding additional report data to a report, doing additional permission checks) but those events will be only triggered when requesting the report as suggested
    • If the method parameters change, your request will most likely still work

    Publishing your Plugin on the Marketplace

    In case you want to share your API 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 and best practices when publishing a plugin.

    Isn’t it easy to create a API ? We never even created a file ! If you have any feedback regarding our APIs or our guides in the Developer Zone feel free to send it to us.

  • How to Check Website Traffic As Accurately As Possible

    18 août 2023, par Erin — Analytics Tips

    If you want to learn about the health of your website and the success of your digital marketing initiatives, there are few better ways than checking your website traffic. 

    It’s a great way to get a quick dopamine hit when things are up, but you can also use traffic levels to identify issues, learn more about your users or benchmark your performance. That means you need a reliable and easy way to check your website traffic over time — as well as a way to check out your competitors’ traffic levels, too. 

    In this article, we’ll show you how to do just that. You’ll learn how to check website traffic for both your and your competitor’s sites and discover why some methods of checking website traffic are better than others. 

    Why check website traffic ? 

    Dopamine hits aside, it’s important to constantly monitor your website’s traffic for several reasons.

    There are five reasons to check website traffic

    Benchmark site performance

    Keeping regular tabs on your traffic levels is a great way to track your website’s performance over time. It can help you plan for the future or identify problems. 

    For instance, growing traffic levels may mean expanding your business’s offering or investing in more inventory. On the flip side, decreasing traffic levels may suggest it’s time to revamp your marketing strategies or look into issues impacting your SEO. 

    Analyse user behaviour

    Checking website traffic and user behaviour lets marketing managers understand how users interact with your website. Which pages are they visiting ? Which CTAs do they click on ? What can you do to encourage users to take the actions you want ? You can also identify issues that lead to high bounce rates and other problems. 

    The better you understand user behaviour, the easier it will be to give them what they want. For example, you may find that users spend more time on your landing pages than they do your blog pages. You could use that information to revise how you create blog posts or focus on creating more landing pages. 

    Improve the user experience

    Once you understand how users behave on your website, you can use that information to fix errors, update your content and improve the user experience for the site. 

    You can even personalise the experience for customers, leading to significant growth. Research shows companies that grow faster derive 40% more of their revenue from personalisation. 

    That could come in the form of sweeping personalisations — like rearranging your website’s navigation bar based on user behaviour — or individual personalisation that uses analytics to transform sections or entire pages of your site based on user behaviour. 

    Optimise marketing strategies

    You can use website traffic reports to understand where users are coming from and optimise your marketing plan accordingly. You may want to double down on organic traffic, for instance, or invest more in PPC advertising. Knowing current traffic estimates and how these traffic levels have trended over time can help you benchmark your campaigns and prioritise your efforts. 

    Increasing traffic levels from other countries can also help you identify new marketing opportunities. If you start seeing significant traffic levels from a neighbouring country or a large market, it could be time to take your business international and launch a cross-border campaign. 

    Filter unwanted traffic

    A not-insignificant portion of your site’s traffic may be coming from bots and other unwanted sources. These can compromise the quality of your analytics and make it harder to draw insights. You may not be able to get rid of this traffic, but you can use analytics tools to remove it from your stats. 

    How to check website traffic on Matomo

    If you want to check your website’s traffic, you’d be forgiven for heading to Google Analytics first. It’s the most popular analytics tool on the market, after all. But if you want a more reliable assessment of your website’s traffic, then we recommend using Matomo alongside Google Analytics. 

    The Matomo web analytics platform is an open-source solution that helps you collect accurate data about your website’s traffic and make more informed decisions as a result — all while enhancing the customer experience and ensuring GDPR compliance and user privacy. 

    Matomo also offers multiple ways to check website traffic :

    Let’s look at all of them one by one. 

    The visits log report is a unique rundown of all of the individual visitors to your site. This offers a much more granular view than other tools that just show the total number of visitors for a given period. 

    The Visits log report is a unique rundown of your site's visitors

    You can access the visits log report by clicking on the reporting menu, then clicking Visitor and Visits Log. From there, you’ll be able to scroll through every user session and see the following information :

    • The location of the user
    • The total number of actions they took
    • The length of time on site
    • How they arrived at your site
    • And the device they used to access your site 

    This may be overwhelming if your site receives thousands of visitors at a time. But it’s a great way to understand users at an individual level and appreciate the lifetime activity of specific users. 

    The Real-time visitor map is a visual display of users’ location for a given timeframe. If you have an international website, it’s a fantastic way to see exactly where in the world your traffic comes from.

    Use the Real-time Map to see the location of users over a given timeframe

    You can access the Real-time Visitor Map by clicking Visitor in the main navigation menu and then Real-time Map. The map itself is colour-coded. Larger orange bubbles represent recent visits, and smaller dark orange and grey bubbles represent older visits. The map will refresh every five seconds, and new users appear with a flashing effect. 

    If you run TV or radio adverts, Matomo’s Real-time Map provides an immediate read on the effectiveness of your campaign. If your map lights up in the minutes following your ad, you know it’s been effective. It can also help you identify the source of bot attacks, too. 

    Finally, the Visits in Real-time report provides a snapshot of who is browsing your website. You can access this report under Visitors > Real-time and add it to your custom dashboards as a widget. 

    Open the report, and you’ll see the real-time flow of your site’s users and counters for visits and pageviews over the last 30 minutes and 24 hours. The report refreshes every five seconds with new users added to the top of the report with a fade-in effect.

    Use the Visits in Real-Time report to get a snapshot of your site's most recent visitors

    The report provides a snapshot of each visitor, including :

    • Whether they are new or a returning 
    • Their country
    • Their browser
    • Their operating system
    • The number of actions they took
    • The time they spent on the site
    • The channel they came in from
    • Whether the visitor converted a goal

    3 other ways to check website traffic

    You don’t need to use Matomo to check your website traffic. Here are three other tools you can use instead. 

    How to check website traffic on Google Analytics

    Google Analytics is usually the first starting point for anyone looking to check their website traffic. It’s free to use, incredibly popular and offers a wide range of traffic reports. 

    Google Analytics lets you break down historical traffic data almost any way you wish. You can split traffic by acquisition channel (organic, social media, direct, etc.) by country, device or demographic.

    Google Analytics can split website traffic by channel

    It also provides real-time traffic reports that give you a snapshot of users on your site right now and over the last 30 minutes. 

    Google Analytics 4 shows the number of users over the last 30 minutes

    Google Analytics may be one of the most popular ways to check website traffic, but it could be better. Google Analytics 4 is difficult to use compared to its predecessor, and it also limits the amount of data you can track in accordance with privacy laws. If users refuse your cookie consent, Google Analytics won’t record these visits. In other words, you aren’t getting a complete view of your traffic by using Google Analytics alone. 

    That’s why it’s important to use Google Analytics alongside other web analytics tools (like Matomo) that don’t suffer from the same privacy issues. That way, you can make sure you track every single user who visits your site. 

    How to check website traffic on Google Search Console

    Google Search Console is a free tool from Google that lets you analyse the search traffic that your site gets from Google. 

    The top-line report shows you how many times your website has appeared in Google Search, how many clicks it has received, the average clickthrough rate and the average position of your website in the search results. 

    Google Search Console is a great way to understand what you rank for and how much traffic your organic rankings generate. It will also show you which pages are indexed in Google and whether there are any crawling errors. 

    Unfortunately, Google Search Console is limited if you want to get a complete view of your traffic. While you can analyse search traffic in a huge amount of detail, it will not tell you how users who access your website directly or via social media behave. 

    How to check website traffic on Similarweb

    Similarweb is a website analysis tool that estimates the total traffic of any site on the internet. It is one of the best tools for estimating how much traffic your competitors receive. 

    What’s great about Similarweb is that it estimates total traffic, not just traffic from search engines like many SEO tools. It even breaks down traffic by different channels, allowing you to see how your website compares against your competitors. 

    As you can see from the image above, Similarweb provides an estimate of total visits, bounce rate, the average number of pages users view per visit and the average duration on the site. The company also has a free browser extension that lets you check website traffic estimates as you browse the web. 

    You can use Similarweb for free to a point. But to really get the most out of this tool, you’ll need to upgrade to a premium plan which starts at $125 per user per month. 

    The price isn’t the only downside of using Similarweb to check the traffic of your own and your competitor’s websites. Ultimately, Similarweb is only an estimate — even if it’s a reasonably accurate one — and it’s no match for a comprehensive analytics tool. 

    7 website traffic metrics to track

    Now that you know how to check your website’s traffic, you can start to analyse it. You can use plenty of metrics to assess the quality of your website traffic, but here are some of the most important metrics to track. 

    • New visitors : These are users who have never visited your website before. They are a great sign that your marketing efforts are working and your site is reaching more people. But it’s also important to track how they behave on the website to ensure your site caters effectively to new visitors. 
    • Returning visitors : Returning visitors are coming back to your site for a reason : either they like the content you’re creating or they want to make a purchase. Both instances are great. The more returning visitors, the better. 
    • Bounce rate : This is a measure of how many users leave your website without taking action. Different analytics tools measure this metric differently.
    • Session duration : This is the length of time users spend on your website, and it can be a great gauge of whether they find your site engaging. Especially when combined with the metric below. 
    • Pages per session : This measures how many different pages users visit on average. The more pages they visit and the longer users spend on your website, the more engaging it is. 
    • Traffic source : Traffic can come from a variety of sources (organic, direct, social media, referral, etc.) Tracking which sources generate the most traffic can help you analyse and prioritise your marketing efforts. 
    • User demographics : This broad metric tells you more about who the users are that visit your website, what device they use, what country they come from, etc. While the bulk of your website traffic will come from the countries you target, an influx of new users from other countries can open the door to new opportunities.

    Why do my traffic reports differ ?

    If you use more than one of the methods above to check your website traffic, you’ll quickly realise that every traffic report differs. In some cases, the reasons are obvious. Any tool that estimates your traffic without adding code to your website is just that : an estimate. Tools like Similarweb will never offer the accuracy of analytics platforms like Matomo and Google Analytics. 

    But what about the differences between these analytics platforms themselves ? While each platform has a different way of recording user behaviour, significant differences in website traffic reports between analytics platforms are usually a result of how each platform handles user privacy. 

    A platform like Google Analytics requires users to accept a cookie consent banner to track them. If they accept, great. Google collects all of the data that any other analytics platform does. It may even collect more. If users reject cookie consent banners, however, then Google Analytics can’t track these visitors at all. They simply won’t show up in your traffic reports. 

    That doesn’t happen with all analytics platforms, however. A privacy-focused alternative like Matomo doesn’t require cookie consent banners (apart from in the United Kingdom and Germany) and can therefore continue to track visitors even after they have rejected a cookie consent screen from Google Analytics. This means that virtually all of your website traffic will be tracked regardless of whether users accept a cookie consent banner or not. And it’s why traffic reports in Matomo are often much higher than they are in Google Analytics.

    Matomo doesn't need cookie consent, so you see a complete view of your traffic

    Given that around half (47.32%) of adults in the European Union refuse to allow the use of personal data tracking for advertising purposes and that 95% of people will reject additional cookies when it is easy to do so, this means you could have vastly different traffic reports — and be missing out on a significant amount of user data. 

    If you’re serious about using web analytics to improve your website and optimise your marketing campaigns, then it is essential to use another analytics platform alongside Google Analytics. 

    Get more accurate traffic reports with Matomo

    There are several methods to check website traffic. Some, like Similarweb, can provide estimates on your competitors’ traffic levels. Others, like Google Analytics, are free. But data doesn’t lie. Only privacy-focused analytics solutions like Matomo can provide accurate reports that account for every visitor. 

    Join over one million organisations using Matomo to accurately check their website traffic. Try it for free alongside GA today. No credit card required.