WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: W3 Total Cache] w3 cache and google analytics (4 posts)

  1. liquidarea
    Member
    Posted 4 years ago #

    Hello,
    I've realized, controlling my google analytics that the range of users visiting my website since I've installed w3 s.c. is horribly falled down (from the registered 3/4000 to 800 unique visits). This is just an illusion, perhaps created from the cached footer (is it?) where I've placed the analytic code: can you suggest me a way to avoid this false result? Is it possible that this happens (as I'm not sure, but since I've started usinf w3 versus other plugin caches) due the use of w3 super cache (I've installed the apc module)?

    Thanks for the response

  2. Frederick Townes
    Member
    Posted 4 years ago #

    I'm sorry, I didn't follow that. No APC is not related.

    For the most accurate stats with the non-asynchronous Google analytics tracking code, would be in the <head> of the page, for performance reasons, Google themselves recommend locating it above the </body> tag.

    So in lieu of both of those, I recommend the asynchronous technique, and positioning it after the <body> tag. Unless there are some HTML minification errors in your pages, W3TC should have NO effect on your analytics or javascript in general.

    If you're trying to minify your Google analytics tracking code, DO NOT, nor should any other statistics/analytics/ad code be minified.

  3. liquidarea
    Member
    Posted 4 years ago #

    Ok, Fredericktownes.
    Message received ;-) What I did is move the google script from the footer (no <body> tag was there, if I've checked well) to header.php theme's file, immediately after the first <body> tag.
    Did I understand well (forgive me for my bad english)?
    It's the best cache plugin, btw -

  4. Frederick Townes
    Member
    Posted 4 years ago #

    Yes.

Topic Closed

This topic has been closed to new replies.

About this Topic