Google Analytics Importer not working for the data part

Hi there,

I just tested the Google Analytics Importer plugin, it imports properly the configuration:

  • property configuration.
  • goals
  • custom variables/dimensions

but when it comes to the import of data the script block. For example when running:
./console googleanalyticsimporter:import-reports --property=UA-54516992-1 --view=92320289 --dates=2019-08-20,2019-08-21
it corresponds to the demo store of Google
it stopped at:
INFO [2019-08-24 11:59:33] 25184 Importing data for GA View 92320289 for date 2019-08-20…
Running archiving for newly imported data…INFO [2019-08-24 12:10:43] 25184 Import for site ID = 38 has not imported any data yet, skipping archive job.
**[Exception] **
**Failed to reach GA after 500 attempts. Restart the import later. **
googleanalyticsimporter:import-reports [–property="…"] [–account="…"] [–view="…"] [–dates="…"] [–idsite="…"] [–cvar-count="…"]
however as previously mentioned the configuration is fine, but no data imported.

I tried as well to import the data of one of my personal website and got the following message:
Running archiving for newly imported data…INFO [2019-08-24 10:31:52] 20450 Import for site ID = 37 has not imported any data yet, skipping archive job.
ERROR [2019-08-24 10:31:52] 20450 Uncaught exception: Error: Cannot access protected property Piwik\Plugins\VisitorInterest\Archiver::$pageGap in /var/www/html/matomo/piwik/plugins/GoogleAnalyticsImporter/Importers/VisitorInterest/RecordImporter.php:28

Stack trace:
#0 /var/www/html/matomo/piwik/plugins/GoogleAnalyticsImporter/Importer.php(333): Piwik\Plugins\GoogleAnalyticsImporter\Importers\VisitorInterest\RecordImporter->importRecords(Object(Piwik\Date))
#1 /var/www/html/matomo/piwik/plugins/GoogleAnalyticsImporter/Importer.php(294): Piwik\Plugins\GoogleAnalyticsImporter\Importer->importDay(Object(Piwik\Site), Object(Piwik\Date), Array, ‘’)

Any ideas of what could be wrong? I am importing the data within my local server http://localhost.

Looks like there are some changes to core that weren’t released, there should be a new beta. I’ll ask Matt to release one.

Nevermind, Lukas beat me to it.

1 Like

@diosmosis
Just noticed it at the same time as you :slight_smile:

In the meantime, this change needs to be applied to fix the error:

diff --git a/plugins/VisitorInterest/Archiver.php b/plugins/VisitorInterest/Archiver.php
index 09a77e2e44..2aa6d69085 100644
--- a/plugins/VisitorInterest/Archiver.php
+++ b/plugins/VisitorInterest/Archiver.php
@@ -21,7 +21,7 @@ class Archiver extends \Piwik\Plugin\Archiver
     const VISITS_COUNT_RECORD_NAME = 'VisitorInterest_visitsByVisitCount';
     const DAYS_SINCE_LAST_RECORD_NAME = 'VisitorInterest_daysSinceLastVisit';
 
-    protected static $timeGap = array(
+    public static $timeGap = array(
         array(0, 10, 's'),
         array(11, 30, 's'),
         array(31, 60, 's'),
@@ -33,7 +33,7 @@ class Archiver extends \Piwik\Plugin\Archiver
         array(15, 30),
         array(30)
     );
-    protected static $pageGap = array(
+    public static $pageGap = array(
         array(1, 1),
         array(2, 2),
         array(3, 3),

Sorry about that!
a new beta has now just been released, which should fix the issue?

Thank you. It works now, but no idea why for some properties it does not work for me, for others it does.

@ChardonneauR for the properties it doesn’t work for, is there any error output you can see? And what specifically goes wrong?

i am also facing this issue in my blog last week