plugin-GoogleAnalyticsImporter icon indicating copy to clipboard operation
plugin-GoogleAnalyticsImporter copied to clipboard

Error during archiving GA imported site

Open prathers opened this issue 4 years ago • 10 comments

Not totally sure, but this might be an issue for the GA importer: During the cron archiving sites in our instance, it throws an error (in short):

Got invalid response from API request: ?module=API&method=API.get&idSite=9&period=week&date=last18&format=php&trigger=archivephp. Response was 'a:2:{s:6:"result";s:5:"error";s:7:"message";s:12021:"Label column not found in the table to add in addDataTable() - in plugin Referrers #0 /home/webstat/core/ArchiveProcessor/Loader.php(133)

Site 9 is an imported GA.

cron.log

Difficult to see where to start tracing..

prathers avatar Mar 21 '20 07:03 prathers

There's some data in GA for that specific day that is causing an empty label to be imported for one of the Referrers reports. This causes archiving to fail. Here are some things you can do to get more information:

  • The error stack trace in the cron.log is being cut off, if you add define('PIWIK_ARCHIVE_NO_TRUNCATE', true); to /path/to/matomo/bootstrap.php you'll be able to get the whole trace which will help in isolating which specific report is having a problem.
  • If you know the day that is specifically causing problems you can look through the matomo and/or GA reports looking for any data that looks like it might be causing processing issues. For example, in the past there used to be values like http://myreferrerwebsite.com iphone in GA for referrer URLs, this caused problems similar to this. If you don't know the day, you can try to look through each day in the week that has problems.

Once the piece of troublesome data is identified, a fix can be created.

diosmosis avatar Mar 23 '20 18:03 diosmosis

Hi, Sry, I'm not sure I understood everything .. Should the define('PIWIK_ARCHIVE_NO_TRUNCATE', true); added to core/bootstrap.php change the output of the cron.log? Because I can't see any difference.

Where can I look through the matomo and/or GA reports?

When I look in the Visits Log, I get the msg The archiving of your reports hasn't been executed recently

prathers avatar Mar 23 '20 21:03 prathers

core/bootstrap.php

Not core/bootstrap.php, but in the root folder next to your matomo.php file.

Where can I look through the matomo and/or GA reports?

The matomo reports are the reports you see in the matomo dashboard and elsewhere in the non-admin pages of matomo. Google Analytics reports are in Google Analytics. Somewhere in the referrer (aka, acquisition) reports there is some data that is causing problem for matomo.

When I look in the Visits Log, I get the msg The archiving of your reports hasn't been executed recently

The importer does not import raw data, there will never be data in the Visits Log for imported sites.

diosmosis avatar Mar 23 '20 22:03 diosmosis

Bootstrap.php: there is no such file in root of our matomo instance..?

prathers avatar Mar 23 '20 22:03 prathers

You can create one, if it's not there it's not loaded. If it is there, it is loaded. Add one w/

<?php

define('PIWIK_ARCHIVE_NO_TRUNCATE', true);

diosmosis avatar Mar 23 '20 22:03 diosmosis

The only thing I can see is a very odd referrer: cqiCd8vo1XPks8Zg9s0TbXkNJ69o2eBOV1T8XuzTW_IjCHkSCFsoPHXjJRmPIwZ7b9GRCMpsRxWAxdvtsXuF_eh_RJHiDyFnNF_qyjMz6Zb5j10NqwWb1uerUP2zmvfL4nxjoeq1_CLViYCv6_JqjMLDjoTvKM0VkoYEVBXKDBSSK5E-9hRjDQxYgfbwdv42bIx4ZgYr2ziy6i0LrSK7zFmFW5_LcmdMeuZXdt7dXuEAWLZuOMfdiHT6_Sb9Cp0ttOZfDPgUTRt2k8mIF4Gkm12FIaGoDoTwudp4xPLiu2zGRQChgtnRx2LmlZHXxTLYfPJvLZrwMePGD0PBFrNJag which seems a bit odd to me.

The cron.log has been truncated all the time: https://github.com/matomo-org/plugin-GoogleAnalyticsImporter/files/4362542/cron.log

prathers avatar Mar 24 '20 07:03 prathers

The cron.log has been truncated all the time: https://github.com/matomo-org/plugin-GoogleAnalyticsImporter/files/4362542/cron.log

Removing these lines will have untruncate them: https://github.com/matomo-org/matomo/blob/3.x-dev/core/CronArchive.php#L1237-L1240

The only thing I can see is a very odd referrer:

That looks strange, did you see it in GA or matomo?

Can you also make sure these lines look the same for the file in your GoogleAnalyticsImporter plugin: https://github.com/matomo-org/plugin-GoogleAnalyticsImporter/blob/3.x-dev/RecordImporter.php#L166-L169 ?

diosmosis avatar Mar 25 '20 00:03 diosmosis

New logfile with no truncation: cron.log

The only thing I can see is a very odd referrer:

That looks strange, did you see it in GA or matomo?

In Matomo

Can you also make sure these lines look the same for the file in your GoogleAnalyticsImporter plugin: https://github.com/matomo-org/plugin-GoogleAnalyticsImporter/blob/3.x-dev/RecordImporter.php#L166-L169 ?

We have the same lines

prathers avatar Mar 25 '20 07:03 prathers

@prathers due to our focus on Matomo 4 we are probably unable to troubleshoot this issue further. If you or anyone else can look into it further, we welcome a pull request on this. Or if anyone else experiences the issue please comment here

mattab avatar Mar 30 '20 02:03 mattab

I fully understand and will not claim any extra service. I bet you guys are busy enough already. I still consider it as a bug in GA importer, but I will see if I can trace it myself, or simply give up on the site I’m trying to import and archive

prathers avatar Apr 04 '20 06:04 prathers