Support » Plugin: Google Analyticator » Not working with latest WP

Viewing 15 replies - 1 through 15 (of 19 total)
  • It’s not working with 4.7.5 either. We have about 70+ websites and 90% are running 4.8 and the rest 4.7.5 and it’s not working in either version. I’ve deauthorised & reset the plugin on a few sites but it doesn’t fix it.

    Maybe something has changed with the Google API?

    Hope it’s fixed soon as I don’t feel like changing to a different plugin.



    I am in the same boat as @dcnz. I have deauthorised & reset the plugin on a few sites but it doesn’t fix it. Please advise when this is fixed.

    It does not work any more with WordPress 4.8, please fix it. See here:

    • This reply was modified 3 years, 7 months ago by rodrigohenrik.

    It is not working on my site either. Even with resetting and updating still nothing loads on dashboard.

    Not sure how long this has been going on, but it seems not fixed yet as far as my experience.

    Has anybody had this issue that is fixed?

    I’m getting the following error.

    Error calling GET (400) Unknown metric(s): ga:timeOnSite For details see

    I have reset, reauthorized, etc. Of interest, I have 2 different server programs, on one server, it works normally, on the other I get the code above.

    Hope this helps you fix the problem.

    Thank you for a great plugin!

    Not working for me either – WordPress 4.8

    Problem has nothing to do with your WP version, it was a core change in the GA API. The ga:timeOnSite metric was depricated back in April.

    Metric – ga:timeOnSite – Use ga:sessionDuration instead.
    GA Core Change Log

    In order to fix the chart on the dashboard you’ll need to edit the plug-in.

    It’s line 454 in google-analytics-summary-widget.php, just replace ga:timeOnSite with ga:sessionDuration and it will work again.

    should look like this…
    $stats = $this->api->getMetrics('ga:visits,ga:bounces,ga:entrances,ga:pageviews,ga:sessionDuration,ga:newVisits', $this->date_before, $this->date_yesterday);

    Gamelust solution works!

    • This reply was modified 3 years, 7 months ago by MarkWalter.

    great, works πŸ™‚

    @gamelust , you are a miracle-worker. Thank you!

    Same issue for me as seen in above screenshots: dashboard widget spins indefinitely but displays no graph. Browser console shows a 500 error for admin-ajax.php. That error only reproduces on the admin dashboard where the widget is attempting to load (and does not reproduce when the plugin is deactivated). The actual tracking code is rendering correctly in the markup, however.

    • This reply was modified 3 years, 7 months ago by DavidB722.

    @noahkagan Suspicion confirmed. Had reset, cleared cache, reinstalled.

    Time for a new one I guess.

    @noahkagan Will you be making an update soon please?

    • This reply was modified 3 years, 7 months ago by Jandal.

    Also running into this issue with the deprecated metric.

    @grimmdude Is there an ETA for a fix?

    @raymondcao gamelust post above has a fix that will make the dashboard widget show again. I have applied it to a couple of installs and it works. But would like an updated version πŸ˜‰

    Okay, this seems to be the ticket to follow, seeing as it has a fix present. Definitely having the same problem. Also found at least two other threads by people with the same problem.

    Can confirm it’s not 4.8, my 4.7.5 site has same problem.

    NOTE: This shouldn’t affect the COLLECTION of data in GA, just the DISPLAY of the data in WP admin dashboard. If you are happy to just visit Google Analytics itself to view your data, you can happily skip the hassle of updating the plugin with the hack above/below.

    Here’s my version of the code fix in case it helps anyone find the right spot in google-analytics-summary-widget.php / GoogleAnalyticsSummary->getSiteUsage():

    	# Get the metrics needed to build the usage table
    	 * HACK! Replace ga:timeOnSite with ga:sessionDuration to fix API 
    	 * @SEE:
    //	$stats     = $this->api->getMetrics('ga:visits,ga:bounces,ga:entrances,ga:pageviews,ga:timeOnSite,ga:newVisits',  $this->date_before, $this->date_yesterday);
    	$stats     = $this->api->getMetrics('ga:visits,ga:bounces,ga:entrances,ga:pageviews,ga:sessionDuration,ga:newVisits',  $this->date_before, $this->date_yesterday);

    Fixing the line starting with $stats = ... makes the box work again.

    It’s worth noting that this still leaves the actual <b>Avg. time on site</b> statistic broken inside the box. For a full fix you also need to edit the <td> that displays the info.

    The line you need to edit is in the same method as the fix above (GoogleAnalyticsSummary->getSiteUsage()) It looks like this to start (note it has ga:timeOnSite):

    <td><strong><?php echo $this->sec2Time($stats->totalsForAllResults['ga:timeOnSite'] / $stats->totalsForAllResults['ga:visits']); ?></strong></td>

    Fix is the same as above, replace ‘ga:timeOnSite’ with ‘ga:sessionDuration’:

    <td><strong><?php echo $this->sec2Time($stats->totalsForAllResults['ga:sessionDuration'] / $stats->totalsForAllResults['ga:visits']); ?></strong></td>

    DEVS PLEASE FIX THIS ASAP! Obviously it’s freaking people out and dramatically reducing the value this plugin offers πŸ™

Viewing 15 replies - 1 through 15 (of 19 total)
  • The topic ‘Not working with latest WP’ is closed to new replies.