WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: Google Analytics for WordPress] WP Google Analytics and WP Super Cache (5 posts)

  1. willard97
    Member
    Posted 4 years ago #

    I recently installed WP Super Cache plugin. Super Cache appears to somehow disable the Javascript functionality of the WP Google Analytics plugin when writing the pages as static HTML. My GA is not showing any data in my account since I installed WP Super Cache, although my GA code is appearing in the footer and my GA account is reporting that it's "receiving data".

    Is there an easy fix to allow both of these plugins to work simultaneously without too much fuss? The GA plugin was working like a charm prior to the Super Cache plugin.

    I found a link to instructions on how to "Make Any Plugin Work with WP Supercache" but I'm not a seasoned enough coder to pull these instructions off without breaking something.
    http://omninoggin.com/wordpress-posts/make-any-plugin-work-with-wp-super-cache/

    Any suggestions on how to make these 2 plugins work together without reinventing the wheel?

  2. willard97
    Member
    Posted 4 years ago #

    I yanked Yoast's GA plugin and installed GA in the footer.php manually and I'm still not seeing any stats in GA admin.

    WP Super Cache has to be creating some problem that's preventing GA from tracking properly.

    Anybody have any ideas?

  3. TheVirtualPreacher
    Member
    Posted 4 years ago #

    Look at these two lines:
    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js'
    type='text/javascript'%3E%3C/script%3E"));

    They are not supposed to be split like that in the page source.

  4. Joost de Valk
    Member
    Posted 4 years ago #

    I've worked my GA plugin in combination with WP Super Cache for ages without issue, and am now using it with W3 Total Cache without issue as well.

  5. Zemalf
    Member
    Posted 4 years ago #

    Slightly off-topic, but I just ran into similar problem (but with W3 Total Cache) and had to disable HTML minification to get everything working. Topic is here: http://wordpress.org/support/topic/346393

    If my assumption is correct, the problem comes if caching/minifying touches the markup, which might cause // comments (e.g. "Cookied already") comment out the whole line of the script.

Topic Closed

This topic has been closed to new replies.

About this Topic