Help Center/ Huawei Cloud Flexus_Huawei Cloud Flexus L Instance/ Best Practices/ Setting Up an Application/ Analyzing Website Data Using the Matomo Application Image
Updated on 2024-09-27 GMT+08:00

Analyzing Website Data Using the Matomo Application Image

Application Scenario

Matomo is a powerful open-source network analysis platform that has full data ownership and ensures that the business complies with General Data Protection Regulation (GDPR) and California Consumer Privacy Act (CCPA). Supported By FlexusL, the Matomo application image uses Ubuntu 22.04 and is deployed using Docker. The Nginx, MySQL, phpMyAdmin, and Docker have been preconfigured in the image. You can use this application image to analyze website data.

Resource Planning and Costs

Resource

Configuration

Description

Cloud server

  • vCPUs: 2
  • Memory: 2 GiB

Select appropriate instance specifications based on your service requirements.

Image

Matomo

Select the Matomo application image.

Security group

Inbound rule:

  • Protocol/Application: TCP
  • Port: 80,9001
  • Source: 0.0.0.0/0
  • 80: Specifies the internal forwarding port of application images.
  • 9000: Allows external access to the dashboard of the application preinstalled in the image.
  • 9001: Allows external access to the application management page.

Process

Procedure

Description

Step 1: Purchase a FlexusL Instance

Purchase a FlexusL instance and select the Matomo application image.

Step 2: Configure Security Groups

Add inbound security group rules to ensure that the application preinstalled in the image can be accessed.

Step 3: Initialize Matomo

Install and initialize Matomo.

Step 4: Use Matomo to Monitor Websites

Add tracking code to the websites you want to monitor.

Step 1: Purchase a FlexusL Instance

  1. Log in to the FlexusLconsole and click Buy FlexusL.
  2. Specify required parameters for the FlexusL instance.

    Parameter

    Example

    Description

    Region

    CN-Hong Kong

    For low network latency and quick resource access, select the region nearest to your target users. After a FlexusL instance is created, the region cannot be changed. Exercise caution when selecting a region.

    Application Images

    Matomo

    Select the Matomo application image.

    Instance Specifications

    2 vCPUs | 2 GiB memory and 60 GiB system disk

    Select instance specifications as needed.

    Instance Name

    Matomo-Example

    Customize an instance name that is easy to identify, for example, Matomo-Example.

    (Optional) Associated Services

    • Data disk: 10 GiB
    • Host security
    • Cloud backup vault: 70 GiB

    You can bundle any of the services to your FlexusL instances as needed: EVS, HSS (basic edition), and CBR and set specifications as needed.

    Required Duration

    1 month

    The minimum duration of a purchase is one month and the maximum duration is three years.

    Auto-renew is enabled by default, which means the purchased FlexusL instances will be automatically renewed before they expire. If you do not enable auto-renew during the purchase process, you can still enable it later after the instances are created. For more information about auto-renewal rules, see Auto-Renewal Rules.

    Quantity

    1

    Set the number of FlexusL instances to be purchased.

  3. Click Buy Now and complete the payment as prompted.
  4. Go back to the FlexusL console and view the purchased FlexusL instance.

    After a FlexusL instance is created using an application image, wait until the image with the pre-installed application is up and running. Then, you can perform operations such as restarting or stopping the instance, or resetting the password. Otherwise, the installation may fail and you cannot log in to the image application dashboard.

Step 2: Configure Security Groups

Add inbound security group rules to ensure that the application preinstalled in the image can be accessed.

  1. Log in to the FlexusL console and click a resource card to go to the instance details page.
  2. In the navigation pane on the left, choose Cloud Servers. Locate the server and click its name.

  3. On the Security Groups tab, click Add Rule. In the displayed dialog box, add rules displayed in the following figure and click OK.

    The following figure only displays common rules. You can add more rules as needed.

    Table 1 Security group rules

    Priority

    Action

    Type

    Protocol & Port

    Source

    Description

    1

    Allow

    IPv4

    TCP: 80

    0.0.0.0/0

    Specifies the internal forwarding port of application images

    1

    Allow

    IPv4

    TCP: 9001

    0.0.0.0/0

    Allows external access to the application dashboard.

Step 3: Initialize Matomo

The image application dashboard needs to be initialized only when you log in for the first time.

  1. On the Overview page, click Access in the Dashboard field in the Image area.

    If the dashboard of WordPress cannot be accessed, it may be because the port for accessing the dashboard is not allowed or the application has not been up and running. To solve this problem, see Why Can't I Open the Dashboard of the Application Pre-installed in the Application Image?

  2. Click NEXT.

  3. Wait until Matomo completes the system check and click NEXT.

    Matomo automatically checks whether the server meets the requirements for installing Matomo and displays the check result for each item.

  4. Set up the MySQL database and click NEXT.

    The MySQL database and a default database account have been preset in Matomo. The information about the default database account is automatically obtained. Retain the default settings and click NEXT.

  5. After Matomo automatically creates data tables, click NEXT.
  6. On the Superuser page, set the username, password, and email address of the Matomo administrator, and click NEXT.

    The super user is the user that you created when you installed Matomo. Each Matomo has only one super user who has the highest permissions. Keep the username and password of the super user secure.

  7. On the Set up a Website page, add the name and URL of the first website you want to track and analyze with Matomo and click NEXT.

    You can add more websites to track later.

  8. Learn about the JavaScript tracking code and click NEXT.

    To track your web traffic with Matomo, you need to make sure that some extra code is added to each of your webpages. Matomo automatically generates a JavaScript tracking code. After the installation is complete, you can check the tracking code in the Tracking Code admin section.

  9. After the initialization configurations are complete, click Continue to Matomo.
  10. Enter the username and password of the super user and click SIGN IN.

Then, you have obtained a Matomo hosting server. You can start using Matomo or follow the instructions provided in Step 4: Use Matomo to Monitor Websites to monitor websites.

Step 4: Use Matomo to Monitor Websites

  1. On the dashboard, click the TRACKING CODE tab and copy the tracking code in the Tracking Code area.

  2. Copy the tracking code to each page of the website you want to monitor.

    Matomo can collect real-time analysis data of the website with the tracking code.

    For details about how to install the Matomo tracking code, see official documentation.

  3. Select All Websites to view the access to the monitored websites.