mirror of
https://code.castopod.org/adaures/castopod.git
synced 2024-10-02 22:46:54 +02:00
03e23a28bf
- https://iabtechlab.com/wp-content/uploads/2017/12/Podcast_Measurement_v2-Dec-20-2017.pdf - no IP address is ever stored on the server. Only aggregate data is stored in the dababase. - rolling 24-hour window - castopod does not do pre-load - IP Blacklisting https://github.com/client9/ipcat - user-agent Filtering https://github.com/opawg/user-agents - ignores 2 bytes range "Range: 0-1" (performed by official Apple iOS Podcast app) - in case of partial content, adds up all requests to check >1mn was downloaded - identifying Uniques is done with a combination of IP Address and User Agent - add AMcharts - add some graphs - add regions to analytics - add ipcat blacklist - enhance useragents performances - add filesize and header size in order to calculate 1mn downloads - update publisher ID3 field - update castopod icon - add disclaimer and warning import form translation - update docs/setup-development.md closes #10
74 lines
1.9 KiB
PHP
74 lines
1.9 KiB
PHP
<?php
|
|
|
|
/**
|
|
* Class AddAnalyticsPodcastsByPlayer
|
|
* Creates analytics_podcasts_by_player table in database
|
|
* @copyright 2020 Podlibre
|
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
|
* @link https://castopod.org/
|
|
*/
|
|
|
|
namespace App\Database\Migrations;
|
|
|
|
use CodeIgniter\Database\Migration;
|
|
|
|
class AddAnalyticsPodcastsByPlayer extends Migration
|
|
{
|
|
public function up()
|
|
{
|
|
$this->forge->addField([
|
|
'podcast_id' => [
|
|
'type' => 'BIGINT',
|
|
'constraint' => 20,
|
|
'unsigned' => true,
|
|
],
|
|
'date' => [
|
|
'type' => 'date',
|
|
],
|
|
'app' => [
|
|
'type' => 'VARCHAR',
|
|
'constraint' => 128,
|
|
],
|
|
'device' => [
|
|
'type' => 'VARCHAR',
|
|
'constraint' => 32,
|
|
],
|
|
'os' => [
|
|
'type' => 'VARCHAR',
|
|
'constraint' => 32,
|
|
],
|
|
'bot' => [
|
|
'type' => 'TINYINT',
|
|
'constraint' => 1,
|
|
'default' => 0,
|
|
],
|
|
'hits' => [
|
|
'type' => 'INT',
|
|
'constraint' => 10,
|
|
'default' => 1,
|
|
],
|
|
]);
|
|
$this->forge->addPrimaryKey([
|
|
'podcast_id',
|
|
'app',
|
|
'device',
|
|
'os',
|
|
'bot',
|
|
'date',
|
|
]);
|
|
$this->forge->addField(
|
|
'`created_at` timestamp NOT NULL DEFAULT current_timestamp()'
|
|
);
|
|
$this->forge->addField(
|
|
'`updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()'
|
|
);
|
|
$this->forge->addForeignKey('podcast_id', 'podcasts', 'id');
|
|
$this->forge->createTable('analytics_podcasts_by_player');
|
|
}
|
|
|
|
public function down()
|
|
{
|
|
$this->forge->dropTable('analytics_podcasts_by_player');
|
|
}
|
|
}
|