Statistics report for TV and Movies

Statistics report for TV and Movies

What are IPTV statistic reports?

IPTV statistic reports provide valuable insights into user behavior, allowing you to track the consumption of IPTV services by room and date. These reports show detailed information about what TV channels were watched and for how long, as well as which movies were viewed. You can export this data in a .csv format for further analysis, making it easy to integrate with other tools or systems.

Additionally, there’s an option to automatically send monthly TV and video reports to a dedicated email address. Below, we’ll explain how to set up and access these reports.

How it works?

1 Check the statistic on the IPTV manager

 

  1. Accessing reports: Navigate to the Reporting section in the top menu. There, you'll find two key submenus in Entertainment menu:

    • TV watched

    • Video watched

  2. Viewing TV channel data: Selecting TV watched will display a list of TV channels along with information on how frequently they were viewed. You can use the filters at the top to narrow down the data by date, room, or specific channels.

  3. Exporting data: At the end of the data table, there’s an Export data button. Clicking this will allow you to download the report as a .csv file, which can be used for in-depth analysis or integration with survey and statistics tools.

  4. Clear old data: The last button in the row is labelled Clear old data. When you press this button, a confirmation prompt will appear, asking you to confirm the deletion of old data. Note that only data from previous years will be deleted—this year's data will remain in the system.

image-20241024-124021.png

 

2 Automating the export of data

Follow these steps to automate the exporting and emailing of your IPTV data reports.

1. Set up the SMTP server

To enable automatic email reports, first configure your SMTP server for sending emails.

  • Open the file /var/www/portal_base/application/etc/resources.ini.

  • In this file, locate the SMTP configuration section. You can use Google SMTP or set up your own SMTP server.

Example for Google SMTP:

image-20241024-125420.png

2. Set Up the recipient email

Next, specify the email address that should receive the monthly report.

  • Open the file /var/www/portal_base/application/etc/profiles/default.ini.

  • Find the line with the recipient email setting and replace the default with your desired email address:

profiles.default.email.statistics.0 = "nevron@nevron.eu"

3. Test email sending

Before automating, test the script to ensure it sends the report successfully.

  • Manually trigger the report by running the following command in your SSH terminal:

/var/www/portal_base/scripts/cron/statistics.sh

If the email is received, your setup is correct.

4. Automate with a cron job

Once you have confirmed the script works, schedule it to run automatically once a month using a cron job.

  • Open the cron job file /etc/cron.d/base-iptv-month:

Open the file: /etc/cron.d/base-iptv-month

Add the following line to trigger the script at midnight on the 1st of every month:

0 0 1 * * /var/www/portal_base/scripts/cron/statistics.sh

5. Final check

Once everything is set up, your system will automatically send a report via email on the 1st of each month at midnight. Test the cron job by waiting for the scheduled time or by manually running the script again.

And that’s it! Your data export automation is now fully configured.