btourman / goal-conversion-export

3 stars 1 forks source link

Automatic installation of tables did not work #1

Open NoUsername opened 10 months ago

NoUsername commented 10 months ago

First: thx for the awesome plugin.

I had an issue that the required tables were not automatically created when the plugin was activated. I could not find any error logs or similar (but I'm also a real matomo noob, so I don't really know where to look for them).

I worked around it by running the following sql manually:

create table matomo_goal_conversion_export (
                  `id_export` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
                  `id_site` INT(11) NOT NULL,
                  `access_token` VARCHAR(100) NOT NULL,
                  `name` VARCHAR(50) NOT NULL,
                  `export_type` VARCHAR(15) NOT NULL,
                  `description` VARCHAR(1000) NOT NULL,
                  `goals` JSON NOT NULL,
                  `day_to_export` INT(11) NOT NULL default 7,
                  `ts_created` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
                  `ts_modified` TIMESTAMP NOT NULL DEFAULT 0,
                  `ts_requested` TIMESTAMP NULL DEFAULT NULL,
                  `deleted` TINYINT(1) NOT NULL DEFAULT '0',
                  `parameters` JSON NULL DEFAULT NULL,
                  PRIMARY KEY (`id_export`),
                  UNIQUE INDEX `access_token` (`access_token`)
                  );

 CREATE table matomo_goal_conversion_log_click_id (
                `click_id` VARCHAR(255) NULL DEFAULT NULL,
                `id_visit` BIGINT(10) UNSIGNED NOT NULL,
                `id_visitor` BINARY(8) NOT NULL,
                `provider` VARCHAR(50) NULL DEFAULT NULL,
                `server_time` DATETIME NOT NULL,
                PRIMARY KEY (`id_visit`),
                INDEX `id_visitor` (`id_visitor`));

luckily it was easy enough to extract that from the php files in the Dao folder.

I was wondering if I did something wrong or if something in the plugin code is broken?

I installed it via the marketplace UI in matomo btw.

btourman commented 10 months ago

Hi,

Could you tell me the version of Matomo you are using ?

It will be easier to test on my instance 😉

NoUsername commented 10 months ago

Hy, sure thing: I'm using: Matomo Version 4.16.0 PHP 8.2.13

I'm running a docker-compose based setup with this matomo container: matomo:fpm-alpine

and this mariadb container: mariadb:10.11

Pretty close to this example setup: https://github.com/matomo-org/docker/blob/master/.examples/nginx/docker-compose.yml

Btw: I also ran into another Issue with the google ads sync: I had to change the timezone of my site to UTC (which affects the parameter=timezone:... line in the exported csv file) otherwise google ads always showed errors - not sure if that is a bug or I did something wrong. Just thought I'd mention it 🤷