Recherche avancée

Médias (91)

Autres articles (61)

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • Submit bugs and patches

    13 avril 2011

    Unfortunately a software is never perfect.
    If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
    If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
    You may also (...)

Sur d’autres sites (3453)

  • A Guide to App Analytics Tools that Drive Growth

    7 mars, par Daniel Crough — App Analytics

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

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

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

    What are app analytics tools ?

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

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

    What do app analytics tools do ?

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

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

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

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

    #1. Improving user understanding

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

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

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

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

    #2 Optimising monetisation strategies for increased revenue and user retention

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

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

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

    How meaningful are the impacts ?

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

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

    #3. Understanding user experiences

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

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

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

    #4. Personalising user experiences

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

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

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

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

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

    #5. Enhancing app performance

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

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

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

    #6. Identifying growth opportunities

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

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

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

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

    Key app metrics to track

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

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

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

    Mobile App Analytics KPIs

    App performance KPIs

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

    Some key metrics to assess performance include :

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

    User engagement KPIs

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

    Important engagement metrics include :

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

    Business impact KPIs

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

    Key business impact metrics include :

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

    Privacy and app analytics : A delicate balance

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

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

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

    The five best app analytics tools to prove marketing value

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

    Matomo — Best for privacy-compliant app analytics

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

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

    Key features

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

    Benefits

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

    Pricing

    PlanPrice
    CloudStarts at £19/month
    On-PremiseFree

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

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

    Firebase — Best for Google services integration

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

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

    Pricing

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

    Adobe Analytics — Best for enterprise app analytics

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

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

    Pricing

    PlanPrice
    SelectPricing on quote
    PrimePricing on quote
    UltimatePricing on quote

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

    Apple App Analytics — Best for iOS app analysis

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

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

    Pricing

    Apple Analytics is free.

    Amplitude — Best for product analytics

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

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

    Pricing

    PlanPrice
    StarterFree
    PlusFrom £49/mo
    GrowthPricing on quote

    Choose Matomo’s app analytics to unlock growth

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

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

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

  • How can I build a custom version of opencv while enabling CUDA and opengl ?

    1er avril, par Josh

    I have a hard requirement of python3.7 for certain libraries (aeneas & afaligner). I've been using the regular opencv-python and ffmpeg libraries in my program and they've been working find.

    


    Recently I wanted to adjust my program to use h264 instead of mpeg4 and ran down a licensing rabbit hole of how opencv-python uses a build of ffmpeg with opengl codecs off to avoid licensing issues. x264 is apparently opengl, and is disabled in the opencv-python library.

    


    In order to solve this issue, I built a custom build of opencv using another custom build of ffmpeg both with opengl enabled. This allowed me to use the x264 encoder with the VideoWriter in my python program.

    


    Here's the dockerfile of how I've been running it :

    



    FROM python:3.7-slim

# Set optimization flags and number of cores globally
ENV CFLAGS="-O3 -march=native -ffast-math -flto -fno-fat-lto-objects -ffunction-sections -fdata-sections" \
    CXXFLAGS="-O3 -march=native -ffast-math -flto -fno-fat-lto-objects -ffunction-sections -fdata-sections" \
    LDFLAGS="-flto -fno-fat-lto-objects -Wl,--gc-sections" \
    MAKEFLAGS="-j\$(nproc)"

# Combine all system dependencies in a single layer
RUN apt-get update && apt-get install -y --no-install-recommends \
    build-essential \
    cmake \
    git \
    wget \
    unzip \
    yasm \
    pkg-config \
    libsm6 \
    libxext6 \
    libxrender-dev \
    libglib2.0-0 \
    libavcodec-dev \
    libavformat-dev \
    libswscale-dev \
    libavutil-dev \
    libswresample-dev \
    nasm \
    mercurial \
    libnuma-dev \
    espeak \
    libespeak-dev \
    libtiff5-dev \
    libjpeg62-turbo-dev \
    libopenjp2-7-dev \
    zlib1g-dev \
    libfreetype6-dev \
    liblcms2-dev \
    libwebp-dev \
    tcl8.6-dev \
    tk8.6-dev \
    python3-tk \
    libharfbuzz-dev \
    libfribidi-dev \
    libxcb1-dev \
    python3-dev \
    python3-setuptools \
    libsndfile1 \
    libavdevice-dev \
    libavfilter-dev \
    libpostproc-dev \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*

# Build x264 with optimizations
RUN cd /tmp && \
    wget https://code.videolan.org/videolan/x264/-/archive/master/x264-master.tar.bz2 && \
    tar xjf x264-master.tar.bz2 && \
    cd x264-master && \
    ./configure \
        --enable-shared \
        --enable-pic \
        --enable-asm \
        --enable-lto \
        --enable-strip \
        --enable-optimizations \
        --bit-depth=8 \
        --disable-avs \
        --disable-swscale \
        --disable-lavf \
        --disable-ffms \
        --disable-gpac \
        --disable-lsmash \
        --extra-cflags="-O3 -march=native -ffast-math -fomit-frame-pointer -flto -fno-fat-lto-objects" \
        --extra-ldflags="-O3 -flto -fno-fat-lto-objects" && \
    make && \
    make install && \
    cd /tmp && \
    # Build FFmpeg with optimizations
    wget https://ffmpeg.org/releases/ffmpeg-7.1.tar.bz2 && \
    tar xjf ffmpeg-7.1.tar.bz2 && \
    cd ffmpeg-7.1 && \
    ./configure \
        --enable-gpl \
        --enable-libx264 \
        --enable-shared \
        --enable-nonfree \
        --enable-pic \
        --enable-asm \
        --enable-optimizations \
        --enable-lto \
        --enable-pthreads \
        --disable-debug \
        --disable-static \
        --disable-doc \
        --disable-ffplay \
        --disable-ffprobe \
        --disable-filters \
        --disable-programs \
        --disable-postproc \
        --extra-cflags="-O3 -march=native -ffast-math -fomit-frame-pointer -flto -fno-fat-lto-objects -ffunction-sections -fdata-sections" \
        --extra-ldflags="-O3 -flto -fno-fat-lto-objects -Wl,--gc-sections" \
        --prefix=/usr/local && \
    make && \
    make install && \
    ldconfig && \
    rm -rf /tmp/*

# Install Python dependencies first
RUN pip install --no-cache-dir --upgrade pip setuptools wheel && \
    pip install --no-cache-dir numpy py-spy

# Build OpenCV with optimized configuration
RUN cd /tmp && \
    # Download specific OpenCV version archives
    wget -O opencv.zip https://github.com/opencv/opencv/archive/4.8.0.zip && \
    wget -O opencv_contrib.zip https://github.com/opencv/opencv_contrib/archive/4.8.0.zip && \
    unzip opencv.zip && \
    unzip opencv_contrib.zip && \
    mv opencv-4.8.0 opencv && \
    mv opencv_contrib-4.8.0 opencv_contrib && \
    rm opencv.zip opencv_contrib.zip && \
    cd opencv && \
    mkdir build && cd build && \
    cmake \
        -D CMAKE_BUILD_TYPE=RELEASE \
        -D CMAKE_C_FLAGS="-O3 -march=native -ffast-math -flto -fno-fat-lto-objects -ffunction-sections -fdata-sections" \
        -D CMAKE_CXX_FLAGS="-O3 -march=native -ffast-math -flto -fno-fat-lto-objects -ffunction-sections -fdata-sections -Wno-deprecated" \
        -D CMAKE_EXE_LINKER_FLAGS="-flto -fno-fat-lto-objects -Wl,--gc-sections" \
        -D CMAKE_SHARED_LINKER_FLAGS="-flto -fno-fat-lto-objects -Wl,--gc-sections" \
        -D CMAKE_INSTALL_PREFIX=/usr/local \
        -D ENABLE_FAST_MATH=ON \
        -D CPU_BASELINE_DETECT=ON \
        -D CPU_BASELINE=SSE3 \
        -D CPU_DISPATCH=SSE4_1,SSE4_2,AVX,AVX2,AVX512_SKX,FP16 \
        -D WITH_OPENMP=ON \
        -D OPENCV_ENABLE_NONFREE=ON \
        -D WITH_FFMPEG=ON \
        -D FFMPEG_ROOT=/usr/local \
        -D OPENCV_EXTRA_MODULES_PATH=/tmp/opencv_contrib/modules \
        -D PYTHON_EXECUTABLE=/usr/local/bin/python3.7 \
        -D PYTHON3_EXECUTABLE=/usr/local/bin/python3.7 \
        -D PYTHON3_INCLUDE_DIR=/usr/local/include/python3.7m \
        -D PYTHON3_LIBRARY=/usr/local/lib/libpython3.7m.so \
        -D PYTHON3_PACKAGES_PATH=/usr/local/lib/python3.7/site-packages \
        -D PYTHON3_NUMPY_INCLUDE_DIRS=/usr/local/lib/python3.7/site-packages/numpy/core/include \
        -D BUILD_opencv_python3=ON \
        -D INSTALL_PYTHON_EXAMPLES=OFF \
        -D BUILD_TESTS=OFF \
        -D BUILD_PERF_TESTS=OFF \
        -D BUILD_EXAMPLES=OFF \
        -D BUILD_DOCS=OFF \
        -D BUILD_opencv_apps=OFF \
        -D WITH_OPENCL=OFF \
        -D WITH_CUDA=OFF \
        -D WITH_IPP=OFF \
        -D WITH_TBB=OFF \
        -D WITH_V4L=OFF \
        -D WITH_QT=OFF \
        -D WITH_GTK=OFF \
        -D BUILD_LIST=core,imgproc,imgcodecs,videoio,python3 \
        .. && \
    make && \
    make install && \
    ldconfig && \
    rm -rf /tmp/*

# Set working directory and copy application code
WORKDIR /app

COPY requirements.txt .

RUN apt-get update && apt-get install -y --no-install-recommends ffmpeg

RUN pip install --no-cache-dir aeneas afaligner && \
    pip install --no-cache-dir -r requirements.txt

COPY . .

# Make entrypoint executable
RUN chmod +x entrypoint.sh
ENTRYPOINT ["./entrypoint.sh"]


    


    My trouble now, is I've been considering running parts of my program on my GPU, it's creating graphics for a video after all. I have no idea how to edit my Dockerfile to make the opencv build run with CUDA enabled, every combination I try leads to issues.

    


    How can I tell which version of CUDA, opencv and ffmpeg are compatible with python 3.7 ?

    


  • Track API calls in Node.js with Piwik

    25 juin 2014, par Frederic Hemberger — Community, API, Node.js

    When using Piwik for analytics, sometimes you don’t want to track only your website’s visitors. Especially as modern web services usually offer RESTful APIs, why not use Piwik to track those requests as well ? It really gives you a more accurate view on how users interact with your services : In which ways do your clients use your APIs compared to your website ? Which of your services are used the most ? And what kind of tools are consuming your API ?

    If you’re using Node.js as your application platform, you can use piwik-tracker. It’s a lightweight wrapper for Piwik’s own Tracking HTTP API, which helps you tracking your requests.

    First, start with installing piwik-tracker as a dependency for your project :

    npm install piwik-tracker --save

    Then create a new tracking instance with your Piwik URL and the site ID of the project you want to track. As Piwik requires a fully qualified URL for analytics, add it in front of the actual request URL.

    var PiwikTracker = require('piwik-tracker');

    // Initialize with your site ID and Piwik URL
    var piwik = new PiwikTracker(1, 'http://mywebsite.com/piwik.php');

    // Piwik works with absolute URLs, so you have to provide protocol and hostname
    var baseUrl = 'http://example.com';

    // Track a request URL:
    piwik.track(baseUrl + req.url);

    Of cause you can do more than only tracking simple URLs : All parameters offered by Piwik’s Tracking HTTP API Reference are supported, this also includes custom variables. During Piwik API calls, those are referenced as JSON string, so for better readability, you should use JSON.stringify({}) instead of manual encoding.

    piwik.track({
       // The full request URL
       url: baseUrl + req.url,

       // This will be shown as title in your Piwik backend
       action_name: 'API call',

       // User agent and language settings of the client
       ua: req.header('User-Agent'),
       lang: req.header('Accept-Language'),

       // Custom request variables
       cvar: JSON.stringify({
         '1': ['API version', 'v1'],
         '2': ['HTTP method', req.method]
       })
    });

    As you can see, you can pass along arbitrary fields of a Node.js request object like HTTP header fields, status code or request method (GET, POST, PUT, etc.) as well. That should already cover most of your needs.

    But so far, all requests have been tracked with the IP/hostname of your Node.js application. If you also want the API user’s IP to show up in your analytics data, you have to override Piwik’s default setting, which requires your secret Piwik token :

    function getRemoteAddr(req) {
       if (req.ip) return req.ip;
       if (req._remoteAddress) return req._remoteAddress;
       var sock = req.socket;
       if (sock.socket) return sock.socket.remoteAddress;
       return sock.remoteAddress;
    }

    piwik.track({
       // …
       token_auth: '<YOUR SECRET API TOKEN>',
       cip: getRemoteAddr(req)
    });

    As we have now collected all the values that we wanted to track, we’re basically done. But if you’re using Express or restify for your backend, we can still go one step further and put all of this together into a custom middleware, which makes tracking requests even easier.

    First we start off with the basic code of our new middleware and save it as lib/express-piwik-tracker.js :

    // ./lib/express-piwik-tracker.js
    var PiwikTracker = require('piwik-tracker');

    function getRemoteAddr(req) {
       if (req.ip) return req.ip;
       if (req._remoteAddress) return req._remoteAddress;
       var sock = req.socket;
       if (sock.socket) return sock.socket.remoteAddress;
       return sock.remoteAddress;
    }

    exports = module.exports = function analytics(options) {
       var piwik = new PiwikTracker(options.siteId, options.piwikUrl);

       return function track(req, res, next) {
           piwik.track({
               url: options.baseUrl + req.url,
               action_name: 'API call',
               ua: req.header('User-Agent'),
               lang: req.header('Accept-Language'),
               cvar: JSON.stringify({
                 '1': ['API version', 'v1'],
                 '2': ['HTTP method', req.method]
               }),
               token_auth: options.piwikToken,
               cip: getRemoteAddr(req)

           });
           next();
       }
    }

    Now to use it in our application, we initialize it in our main app.js file :

    // app.js
    var express      = require('express'),
       piwikTracker = require('./lib/express-piwik-tracker.js'),
       app          = express();

    // This tracks ALL requests to your Express application
    app.use(piwikTracker({
       siteId    : 1,
       piwikUrl  : 'http://mywebsite.com/piwik.php',
       baseUrl   : 'http://example.com',
       piwikToken: '<YOUR SECRET API TOKEN>'
    }));

    This will now track each request going to every URL of your API. If you want to limit tracking to a certain path, you can also attach it to a single route instead :

    var tracker = piwikTracker({
       siteId    : 1,
       piwikUrl  : 'http://mywebsite.com/piwik.php',
       baseUrl   : 'http://example.com',
       piwikToken: '<YOUR SECRET API TOKEN>'
    });

    router.get('/only/track/me', tracker, function(req, res) {
       // Your code that handles the route and responds to the request
    });

    And that’s everything you need to track your API users alongside your regular website users.