Recherche avancée

Médias (0)

Mot : - Tags -/diogene

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

Autres articles (32)

  • Des sites réalisés avec MediaSPIP

    2 mai 2011, par

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

  • 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

  • Soumettre améliorations et plugins supplémentaires

    10 avril 2011

    Si vous avez développé une nouvelle extension permettant d’ajouter une ou plusieurs fonctionnalités utiles à MediaSPIP, faites le nous savoir et son intégration dans la distribution officielle sera envisagée.
    Vous pouvez utiliser la liste de discussion de développement afin de le faire savoir ou demander de l’aide quant à la réalisation de ce plugin. MediaSPIP étant basé sur SPIP, il est également possible d’utiliser le liste de discussion SPIP-zone de SPIP pour (...)

Sur d’autres sites (6936)

  • How to create a scheduled task – Introducing the Piwik Platform

    28 août 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 custom theme in Piwik). This time you’ll learn how to execute scheduled tasks in the background, for instance sending a daily email. For this tutorial you will need to have basic knowledge of PHP.

    What can you do with scheduled tasks ?

    Scheduled tasks let you execute tasks regularly (hourly, weekly, …). For instance you can :

    • create and send custom reports or summaries
    • sync users and websites with other systems
    • clear any caches
    • import third-party data into Piwik
    • monitor your Piwik instance
    • execute any other task you can think of

    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="MyTasksPlugin". There should now be a folder plugins/MyTasksPlugin.
    • And activate the created plugin under Settings => Plugins.

    Let’s start creating a scheduled task

    We start by using the Piwik Console to create a tasks template :

    ./console generate:scheduledtask

    The command will ask you to enter the name of the plugin the task should belong to. I will simply use the above generated plugin name “MyTasksPlugin”. There should now be a file plugins/MyTasksPlugin/Tasks.php which contains some examples to get you started easily :

    class Tasks extends \Piwik\Plugin\Tasks
    {
       public function schedule()
       {
           $this->hourly('myTask');  // method will be executed once every hour
           $this->daily('myTask');   // method will be executed once every day
           $this->weekly('myTask');  // method will be executed once every week
           $this->monthly('myTask'); // method will be executed once every month

           // pass a parameter to the task
           $this->weekly('myTaskWithParam', 'anystring');

           // specify a different priority
           $this->monthly('myTask', null, self::LOWEST_PRIORITY);
           $this->monthly('myTaskWithParam', 'anystring', self::HIGH_PRIORITY);
       }

       public function myTask()
       {
           // do something
       }

       public function myTaskWithParam($param)
       {
           // do something
       }
    }

    A simple example

    As you can see in the generated template you can execute tasks hourly, daily, weekly and monthly by registering a method which represents the actual task :

    public function schedule()
    {
       // register method remindMeToLogIn to be executed once every day
       $this->daily('remindMeToLogIn');  
    }

    public function remindMeToLogIn()
    {
       $mail = new \Piwik\Mail();
       $mail->addTo('me@example.com');
       $mail->setSubject('Check stats');
       $mail->setBodyText('Log into your Piwik instance and check your stats!');
       $mail->send();
    }

    This example sends you an email once a day to remind you to log into your Piwik daily. The Piwik platform makes sure to execute the method remindMeToLogIn exactly once every day.

    How to pass a parameter to a task

    Sometimes you want to pass a parameter to a task method. This is useful if you want to register for instance one task for each user or for each website. You can achieve this by specifying a second parameter when registering the method to execute.

    public function schedule()
    {
       foreach (\Piwik\Site::getSites() as $site) {
           // create one task for each site and pass the URL of each site to the task
           $this->hourly('pingSite', $site['main_url']);
       }
    }

    public function pingSite($siteMainUrl)
    {
       file_get_contents($siteMainUrl);
    }

    How to test scheduled tasks

    After you have created your task you are surely wondering how to test it. First, you should write a unit or integration test which we will cover in one of our future blog posts. Just one hint : You can use the command ./console generate:test to create a test. To manually execute all scheduled tasks you can execute the API method CoreAdminHome.runScheduledTasks by opening the following URL in your browser :

    http://piwik.example.com/index.php?module=API&method=CoreAdminHome.runScheduledTasks&token_auth=YOUR_API_TOKEN

    Don’t forget to replace the domain and the token_auth URL parameter.

    There is one problem with executing the scheduled tasks : The platform makes sure they will be executed only once an hour, a day, etc. This means you can’t simply reload the URL and test the method again and again as you would have to wait for the next hour or day. The proper solution is to set the constant DEBUG_FORCE_SCHEDULED_TASKS to true within the file Core/TaskScheduler.php. Don’t forget to set it back to false again once you have finished testing it.

    Starting from Piwik 2.6.0 you can alternatively execute the following command :

    ./console core:run-scheduled-tasks --force --token-auth=YOUR_TOKEN_AUTH

    The option “–force” will make sure to execute even tasks that are not due to run at this time. So you won’t have to modify any files.

    Which tasks are registered and when is the next execution time of my task ?

    The TasksTimetable plugin from the Marketplace can answer this question for you. Simply install and activate the plugin with one click by going to Settings => Marketplace => Get new functionality. It’ll add a new admin menu item under Settings named Scheduled Tasks.

    Publishing your Plugin on the Marketplace

    In case you want to share your task(s) 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 scheduled tasks ? 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. For instance, you can define priorities, you can directly register methods from different objects and classes, you can specify at which time of a day a task should run and more.

    Would you like to know more about tasks ? Go to our Tasks class reference 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 create a scheduled task – Introducing the Piwik Platform

    28 août 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 custom theme in Piwik). This time you’ll learn how to execute scheduled tasks in the background, for instance sending a daily email. For this tutorial you will need to have basic knowledge of PHP.

    What can you do with scheduled tasks ?

    Scheduled tasks let you execute tasks regularly (hourly, weekly, …). For instance you can :

    • create and send custom reports or summaries
    • sync users and websites with other systems
    • clear any caches
    • import third-party data into Piwik
    • monitor your Piwik instance
    • execute any other task you can think of

    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="MyTasksPlugin". There should now be a folder plugins/MyTasksPlugin.
    • And activate the created plugin under Settings => Plugins.

    Let’s start creating a scheduled task

    We start by using the Piwik Console to create a tasks template :

    ./console generate:scheduledtask

    The command will ask you to enter the name of the plugin the task should belong to. I will simply use the above generated plugin name “MyTasksPlugin”. There should now be a file plugins/MyTasksPlugin/Tasks.php which contains some examples to get you started easily :

    class Tasks extends \Piwik\Plugin\Tasks
    {
       public function schedule()
       {
           $this->hourly('myTask');  // method will be executed once every hour
           $this->daily('myTask');   // method will be executed once every day
           $this->weekly('myTask');  // method will be executed once every week
           $this->monthly('myTask'); // method will be executed once every month

           // pass a parameter to the task
           $this->weekly('myTaskWithParam', 'anystring');

           // specify a different priority
           $this->monthly('myTask', null, self::LOWEST_PRIORITY);
           $this->monthly('myTaskWithParam', 'anystring', self::HIGH_PRIORITY);
       }

       public function myTask()
       {
           // do something
       }

       public function myTaskWithParam($param)
       {
           // do something
       }
    }

    A simple example

    As you can see in the generated template you can execute tasks hourly, daily, weekly and monthly by registering a method which represents the actual task :

    public function schedule()
    {
       // register method remindMeToLogIn to be executed once every day
       $this->daily('remindMeToLogIn');  
    }

    public function remindMeToLogIn()
    {
       $mail = new \Piwik\Mail();
       $mail->addTo('me@example.com');
       $mail->setSubject('Check stats');
       $mail->setBodyText('Log into your Piwik instance and check your stats!');
       $mail->send();
    }

    This example sends you an email once a day to remind you to log into your Piwik daily. The Piwik platform makes sure to execute the method remindMeToLogIn exactly once every day.

    How to pass a parameter to a task

    Sometimes you want to pass a parameter to a task method. This is useful if you want to register for instance one task for each user or for each website. You can achieve this by specifying a second parameter when registering the method to execute.

    public function schedule()
    {
       foreach (\Piwik\Site::getSites() as $site) {
           // create one task for each site and pass the URL of each site to the task
           $this->hourly('pingSite', $site['main_url']);
       }
    }

    public function pingSite($siteMainUrl)
    {
       file_get_contents($siteMainUrl);
    }

    How to test scheduled tasks

    After you have created your task you are surely wondering how to test it. First, you should write a unit or integration test which we will cover in one of our future blog posts. Just one hint : You can use the command ./console generate:test to create a test. To manually execute all scheduled tasks you can execute the API method CoreAdminHome.runScheduledTasks by opening the following URL in your browser :

    http://piwik.example.com/index.php?module=API&method=CoreAdminHome.runScheduledTasks&token_auth=YOUR_API_TOKEN

    Don’t forget to replace the domain and the token_auth URL parameter.

    There is one problem with executing the scheduled tasks : The platform makes sure they will be executed only once an hour, a day, etc. This means you can’t simply reload the URL and test the method again and again as you would have to wait for the next hour or day. The proper solution is to set the constant DEBUG_FORCE_SCHEDULED_TASKS to true within the file Core/TaskScheduler.php. Don’t forget to set it back to false again once you have finished testing it.

    Starting from Piwik 2.6.0 you can alternatively execute the following command :

    ./console core:run-scheduled-tasks --force --token-auth=YOUR_TOKEN_AUTH

    The option “–force” will make sure to execute even tasks that are not due to run at this time. So you won’t have to modify any files.

    Which tasks are registered and when is the next execution time of my task ?

    The TasksTimetable plugin from the Marketplace can answer this question for you. Simply install and activate the plugin with one click by going to Settings => Marketplace => Get new functionality. It’ll add a new admin menu item under Settings named Scheduled Tasks.

    Publishing your Plugin on the Marketplace

    In case you want to share your task(s) 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 scheduled tasks ? 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. For instance, you can define priorities, you can directly register methods from different objects and classes, you can specify at which time of a day a task should run and more.

    Would you like to know more about tasks ? Go to our Tasks class reference 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 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.