WordPress.org

Ready to get started?Download WordPress

Forums

Google Analytics Dashboard for WP
[resolved] Real-Time always shows Zero (8 posts)

  1. Robert
    Member
    Posted 7 months ago #

    Installed plugin v4.2.3 yesterday, authorized using plugin Google API for a single WordPress site. Everything works greats except the Real-Time report displays zero for all metrics:

    REFERRAL: 0
    ORGANIC: 0
    SOCIAL: 0
    DIRECT: 0
    NEW: 0
    RETURNING: 0

    By contrast, the direct Google Analytics -> Real-Time -> Overview (/www.google.com/analytics/web/#realtime/rt-overview) report displays 13 users. I do have an Account, Property and View defined in Google Analytics. I have not upgraded the GA .js tracking code to new "Universal Analystics".

    I have an established and well-visited site, so it's not an issue of no active visitors.

    Tried clearing the plugin, WP Engine and CloudFlare caches with no luck. Again, all other Today, Yesterday, Last 30 and 90 day reports are accurate and very nice.

    I do not have any other Google or active users plugins.

    Recommendations?

    Thanks

    http://wordpress.org/plugins/google-analytics-dashboard-for-wp/

  2. Alin Marcu
    Member
    Plugin Author

    Posted 7 months ago #

    In Google Chrome, press CTRL+SHIFT+I and select Console, tell me if you see any red errors.

    Be careful when posting it here, remove any secret refresh tokens from URL.

  3. Robert
    Member
    Posted 7 months ago #

    The Google Chrome Chrome console displays a warning and an error:

    event.returnValue is deprecated. Please use the standard event.preventDefault() instead.

    Failed to load resource: the server responded with a status of 403 (Forbidden) https://mysite.com/wp-content/plugins/google-analytics-dashboard…<token value>&key=<key value>

    Seems the problem is the 403 Forbidden error. My site is hosted by WPEngine.com which disables certain PHP functions for security. I'm also running the Sucuri Premium WordPress plugin. Perhaps the hosting environment or Sucuri is blocking a call?

    Thanks for working on Sunday!

  4. Alin Marcu
    Member
    Plugin Author

    Posted 7 months ago #

    Yes, that's the reason, probably the direct access to a PHP file is restricted for wp-content by a security plugin.

  5. Robert
    Member
    Posted 7 months ago #

    You are correct. I found the issue. The Sucuri plugin has a 1-click hardening feature that restricts access to /wp-content to prevent direct PHP script execution via .htaccess in that directory.

    This caused the GET on superproxy.php to fail:

    GET https://mysite.com/wp-content/plugins/google-analytics-dashboard-for-wp/realtime/superproxy.php

    with the error:

    Forbidden
    You don't have permission to access /wp-content/plugins/google-analytics-dashboard-for-wp/realtime/superproxy.php on this server.

    I enabled access to wp-content via the Sucuri "Revert Hardening" button (i.e. delete the .htaccess file) and Real-Time Reports now work fine.

    I'll refine the .htaccess rules to allow access only to superproxy.php.

    Thanks!

  6. Robert
    Member
    Posted 7 months ago #

    Topic is resolved.

  7. Alin Marcu
    Member
    Plugin Author

    Posted 7 months ago #

    That's nice, thanks for the feedback!

  8. Robert
    Member
    Posted 7 months ago #

    I modified the .htaccess in /wp-content from:

    <Files *.php>
    deny from all
    </Files>

    to this:

    <Files *.php>
    deny from all
    </Files>
    <Files "superproxy.php">
    Order Allow,Deny
    Allow from all
    </Files>

    Which allows access to only superproxy.php and while preventing access to all other PHP files for security.

    Real-Time Reports are working fine.

    Thanks!

Reply

You must log in to post.

About this Plugin

About this Topic