Title: Google Analytics cache do not work on HTTPS
Last modified: October 13, 2018

---

# Google Analytics cache do not work on HTTPS

 *  [aamir2007](https://wordpress.org/support/users/aamir2007/)
 * (@aamir2007)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/google-analytics-cache-do-not-work-on-https/)
 * I like the plugin and its features however google analytics cache does not work
   on sit with https protocol as it is loading cached analytics file over http protocol
   that is blocked by the browser hence results in failure.
 * Please look into this matter asap.
 * Also I would like to suggest an option for lazy load images to be added into 
   the plugin under performance section.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fgoogle-analytics-cache-do-not-work-on-https%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  [webcraftic](https://wordpress.org/support/users/webcraftic/)
 * (@webcraftic)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/google-analytics-cache-do-not-work-on-https/#post-10777022)
 * Hi,
 * I think your wordpress simply cannot determine that you are using SSL. Our plugin
   does not have hard-coded links, the protocol is taken from the WordPress core
   schemes.
 * There is one trick to make your WordPress always define ssl, just add this code
   to your wp-config.php:
 *     ```
       /*
       in some setups HTTP_X_FORWARDED_PROTO might contain 
       a comma-separated list e.g. http,https
       so check for https existence
       */
       if (strpos($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') !== false) {
              $_SERVER['HTTPS']='on';
       }
       ```
   
 * This should solve the problem.
 * We are now completing a big update, I think in the next update, and we will add
   additional tools, including lazy loading of images.
 * Best regards, Alex

Viewing 1 replies (of 1 total)

The topic ‘Google Analytics cache do not work on HTTPS’ is closed to new replies.

 * ![](https://ps.w.org/clearfy/assets/icon-256x256.gif?rev=2392119)
 * [Clearfy Cache – WordPress optimization plugin, Minify HTML, CSS & JS, Defer](https://wordpress.org/plugins/clearfy/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/clearfy/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/clearfy/)
 * [Active Topics](https://wordpress.org/support/plugin/clearfy/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/clearfy/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/clearfy/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [webcraftic](https://wordpress.org/support/users/webcraftic/)
 * Last activity: [7 years, 8 months ago](https://wordpress.org/support/topic/google-analytics-cache-do-not-work-on-https/#post-10777022)
 * Status: not resolved