• Resolved bill6591

    (@bill6591)


    I love the idea of this plugin, but I’m having a hard time getting it to work.

    The file local-ga.js is created and is populated (so no cron problem). The server settings give JS a one-year expiration, so no problem there. GTmetrix shows it loading, though it doesn’t show up in the page source code after loading, unless it would show up with a different name. The truly weird part, though is that analytics.js also loads–so I still get dinged for not adding expires headers.

    Clearly, I’m doing something wrong, but I can’t figure out what. Any help would be greatly appreciated.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author DaanvandenBergh

    (@daanvandenbergh)

    If analytics.js is still loading, that means another plugin or your theme loads the original snippet from Google. Remove it.

    The reason it doesn’t show up in source, is probably because you’re logged in. CAOS doesn’t track administrators by default (this setting can be disabled from the settings screen) Try opening it in a private/incognito browser window and you’ll see the s snippet is there.

    Thread Starter bill6591

    (@bill6591)

    Thanks for the prompt reply.

    I don’t have any Google analytics plugins installed. I assume those would be the only likely culprits. I checked all the others and didn’t find any functions connected to Google analytics.

    The theme does have a box into which the Google analytics script gets pasted. I tried deleting the script from there, and analytics.js does indeed disappear from the GTmetrics report–but so does local-ga.js. I assume that means I’m getting no analytics tracking at all. There are some other weird effects that I think are connected to caching or CDN usage that might straighten out if I purged all the caches.

    I assume the theme is in fact invoking analytics.js, but preventing it from doing that seems to cause more problems than it solves. I’m not going to be changing Themes at the moment, so if that’s really the case, I’ll just live with analytics issue. If I’m missing something, please let me know.

    Plugin Author DaanvandenBergh

    (@daanvandenbergh)

    These are two seperate issues, so removing the analytics-snippet from the theme’s box, can’t possibly remove local-ga.js from the source. Again, you’re probably logged in as administrator while trying to view the source. Then local-ga.js isn’t loaded, because by default, CAOS doesn’t track logged in administrators. Try disabling this option from the options area and look again, you’ll see local-ga.js is loaded.

    Thread Starter bill6591

    (@bill6591)

    Of course, you were right, though the issue wasn’t quite what you thought. I was looking at the GTmetrix test, not the page source, but I was retesting too soon, and so the page had loading issues. Once I cleared all the caches, gave them time to rebuild, and then ran the test, the page loaded correctly, and local-ga.js appeared as expected.

    Thanks for all the very quick suggestions.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘analytics.js still loads’ is closed to new replies.