Title: Google Analytics not working
Last modified: October 30, 2019

---

# Google Analytics not working

 *  Resolved [4csmedia](https://wordpress.org/support/users/4csmedia/)
 * (@4csmedia)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/google-analytics-not-working-19/)
 * Hello Albert,
    Since last week Wednesday Google Analytics stopped working, I’m
   using Google Tag Manager and Tag Manager was loading, but the analytics tag didn’t.
   Also I got a few 500 errors, [https://imgur.com/5vB5WQH](https://imgur.com/5vB5WQH)
 * I reverted back to PhastPress version 1.21 and now it seems t be working all 
   right again.
 * So it seems something has changed on the last version that doesn’t work very 
   well for this site.
 * I did check with the hosting company, but mod_security extensie is not installed.
 * Kindest regards,
    Robert
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fgoogle-analytics-not-working-19%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Author [Albert Peschar](https://wordpress.org/support/users/kiboit/)
 * (@kiboit)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/google-analytics-not-working-19/#post-12117026)
 * Hi Robert,
 * Thanks for trying out PhastPress! Sorry for my late reply, it seems I didn’t 
   get the notification I usually get for new support questions.
 * If you’re getting 500 errors, there should be errors in your server error log,
   or in wp-content/debug.log, after [enabling WP_DEBUG and WP_DEBUG_LOG](https://wordpress.org/support/article/debugging-in-wordpress/).
 * Could you update to the latest version again, check the logs after reloading 
   the page a few times, and send me the errors that occur?
 *  Thread Starter [4csmedia](https://wordpress.org/support/users/4csmedia/)
 * (@4csmedia)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/google-analytics-not-working-19/#post-12117425)
 * Hello Albert,
    Thank you for your reply and I managed to get it to work while
   trying to get debug files.
 * When I enabled debug, I saw fatal errors pop-up in my server log files:
    Backend
   fatal error: PHP Fatal error: require_once(): Failed opening required ‘ABSPATHwp-
   settings.php’
 * I managed to solve this by adding the following code to wp-config file:
 *     ```
       /** Absolute path to the WordPress directory. */
       if ( !defined('ABSPATH') )
               define('ABSPATH', dirname(__FILE__) . '/');
   
       /** Sets up WordPress vars and included files. */
       require_once(ABSPATH . 'wp-settings.php');
       ```
   
 * Which seems to do the trick, apparently you use the ABSPATH variable too?
 *  [imatei1985](https://wordpress.org/support/users/imatei1985/)
 * (@imatei1985)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/google-analytics-not-working-19/#post-12319142)
 * Hello Albert,
 * The solution sugested by [@4csmedia](https://wordpress.org/support/users/4csmedia/)
   did not workrd for me.
 * The only solution was to disable: Minify scripts and improve caching
 * Is there other solution, please?
 *  Plugin Author [Albert Peschar](https://wordpress.org/support/users/kiboit/)
 * (@kiboit)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/google-analytics-not-working-19/#post-12319430)
 * Hi [@imatei1985](https://wordpress.org/support/users/imatei1985/),
 * Are you using the latest version, PhastPress 1.25?
 * Could you share the URL of your site with me, so that I can have a look? Please
   enable the “Minify scripts and improve caching” temporarily, so that I can see
   what the problem is.
 * If you’d rather not publish the URL on the internet, please create a new topic
   and enter the URL into the “the page I need help with field”, so only logged-
   in users can see it.
 * –Albert
 *  [imatei1985](https://wordpress.org/support/users/imatei1985/)
 * (@imatei1985)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/google-analytics-not-working-19/#post-12320238)
 * I am using 1.25 version.
    My url is: [https://10pariuri.ro/](https://10pariuri.ro/)
   I enabled Minify scripts and improve caching and I deleted cache.
 *  Plugin Author [Albert Peschar](https://wordpress.org/support/users/kiboit/)
 * (@kiboit)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/google-analytics-not-working-19/#post-12322812)
 * Hi,
 * [@4csmedia](https://wordpress.org/support/users/4csmedia/): The `ABSPATH` variable
   is usually defined in `wp-config.php`, but I didn’t know it isn’t always there.
   In PhastPress 1.27 this is now no longer required, as PhastPress uses `wp-load.
   php` instead, which always defines `ABSPATH`. Thank you for your bug report and
   detailed information about the fix.
 * [@imatei1985](https://wordpress.org/support/users/imatei1985/):
 * There is a problem on your server causing output from PHP to be compressed twice.
   For example, this causes problems on [wp-emoji-release.min.js](https://10pariuri.ro/wp-content/plugins/phastpress/phast.php?service=scripts&src=https%3A%2F%2F10pariuri.ro%2Fwp-includes%2Fjs%2Fwp-emoji-release.min.js&cacheMarker=219304).
   I don’t know whether this is due to another plugin or your web server configuration.
   Do you have a `.htaccess` file? And if so, could you share it with me via [gist.github.com pastebin](https://gist.github.com/)?
 * Additionally, I see you are using some other plugin to minify scripts. It moves
   them to `/min/abcd.js` and breaks PhastPress. Could you please disable any other
   optimization plugins? There is a conflict with PhastPress, and generally, when
   you use PhastPress, no other optimization plugins are needed.
 * –Albert

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Google Analytics not working’ is closed to new replies.

 * ![](https://ps.w.org/phastpress/assets/icon-256x256.png?rev=1873505)
 * [PhastPress](https://wordpress.org/plugins/phastpress/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/phastpress/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/phastpress/)
 * [Active Topics](https://wordpress.org/support/plugin/phastpress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/phastpress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/phastpress/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [Albert Peschar](https://wordpress.org/support/users/kiboit/)
 * Last activity: [6 years, 3 months ago](https://wordpress.org/support/topic/google-analytics-not-working-19/#post-12322812)
 * Status: resolved