I have an Ubuntu server hosting several websites, some Wordpress some just plain HTML, but every single page has the exact same Google Analytics script on it when I view the source in a web browser. I cannot figure out how this is being added to every single site, since some of them are just one HTML page. If you view the source and look at the bottom (just before the ending body tag) you'll see the script.

Here are two of the sites: https://landlinenews.com/ http://enertiadataentry.com/

Is there somewhere, maybe an Apache configuration file, that might have been modified that is adding this?

  • 1
    Are you working from a template with the tracking code in it? Running some third party plugin, module that adds it? – Colt Jun 29 '16 at 15:00
  • You could have something like a Server Side Include, but you still would have to have put something on the page to make the include. – Colt Jun 29 '16 at 15:08

Most likely you're using the PageSpeed apache module that is configured to insert your Google Analytics ID with the ModPagespeedAnalyticsID directive or something similar.


If even static HTML files are doing this, then you probably should be looking at Apache. Check first for .htacess files. Maybe try renaming all of them at once if there are any. Then, if you still have a problem, check the Apache configuration, or perhaps look for modules, like mod_pagespeed. It really wouldn't be possible to say without troubleshooting on the server itself, but it sounds like there is a very strong chance that the issue is in Apache.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.