Google Analytics code not working on Wordpress site - wordpress

We have a Wordpress site that has been running GA code fine for years. We noticed recently it had stopped reporting and that GA reports the code is not installed. The code is clearly there in the page source - I have tried sticking it directly into the code in the head and in the footer, I have tried using the theme to insert it and thirdparty plug-ins - nothing works.
I have tried changing the theme to the standard WP theme, I have tried turning off plug-ins one at a time (might try turning all off at once tonight!). I have tried removing the .htaccess file.
It feels like something is blocking it but can't figure out what.
Looking at the date of when it stopped working I think it is around the time we upgraded the PHP version of the server but not sure how this would have affected it and there are other Wordpress installs on the same server that are still collecting GA data perfectly happily!
Any advice welcome this is driving me insane now! Site can be viewed here: goo.gl/UO6deJ - Sorry if this has already been covered but everything else I read seemed to be related to plugins not functioning as they should.

As #Fazz mentioned, you have two instances of the same code which would duplicate all your data and skew your results. Also, you can check your Real-Time reports to see if you are tracking your own visits simultaneously. If you can see hits in your RT reports, then likely your tracking code is good. You can also install Google Tag Assistant to help diagnose any other issues with your tracking code.
Can you check to see if you were migrated from classic GA to UA? Usually you should wait 48 hours from initial installation before seeing data in your standard reports (but you should still see data in RT).

Related

My website is showing an error related to googlecm.hit.gemius.pl in console

I have a WordPress website, and I use Adsense. However, for a couple of days, I have noticed these errors in the console, and I don't know what they mean.
All of them are related to this URL: https://googlecm.hit.gemius.pl
The errors are saying:
Failed to load resource: net::ERR_ADDRESS_INVALID
GET googlecm.hit.gemius.pl/googleredir?rid=... net::ERR_ADDRESS_INVALID
I don't know what it is, please clarify this to me.
I was able to figure this out. It was not the plugin, but rather an Ad Network on Google Adsense. All I had to do was go into the Google Adsense >> Blocking Controls >> Content >> Ad Networks. Then type in Gemius and disable all ads from their network. The problem goes away and you get to work with Adsense again.
I don't have the best answer, but ... I noticed my site is doing this too. It's a pretty simple site, with just a few tools some people use. If I disable Google's ads, the error goes away. If I re-enable them, they come back. I double checked ad content, and they're all legitimate.
The requests aren't being generated by my pages. They are only generated by Google's ads.
My site is hand coded, not WP or another CMS, so it can't be a hack or anything. I literally read every line of code related to that page while trying to diagnose it. It wasn't hard, because there aren't many lines of code. :)
So, to make the error go away, you'll need to turn off Google's ads for a while. It really isn't necessary though.
The good news is, that error means nothing was sent to the gemius page. It is simply unreachable right now, for whatever reason. I guess Google will fix it eventually. I don't care enough to open a trouble ticket with them. I'm just considering it a curiosity and annoyance on my otherwise error free pages.
screenshot with googlecm.hit.gemius errors
I believe this is related to the plugin Google Ad Inserter. Took me a while to figure out and I'm still trying to clean it up. After removing the plugin a lot of the redirect errors went away and Google was able to index my URL. After going into Chrome developer though I noticed that there was still some redirect errors happening on some resources left behind by Ad Inserter. Once I figure out how to get rid of them I'll post an update. Had a huge impact on my blog though. Almost lost 30% of my page views for the past couple days...

Unable to remove page from Google Amp cache

I'm having trouble using Google's API to update amp pages from a site I'm working on. The site is a Wordpress based site using WP Amp to generate amp pages, it appends /amp to any enabled pages.
I've read the documentation here and it seems like it should be a simple GET request using this structure:
https://cdn.ampproject.org/update-ping/c/s/www.example.com/example-category/example-page/amp
..which gives me a 204 No Content reply (to be expected Google's docs say). However, when retesting via my phone (with cache cleared etc) it is showing the same old amp page not the updated one.
Surely I'm missing something obvious, look forward to finding out what it is.
Figured this out finally after leaving it for a while and coming back to it.
The URL format for updating Google's cache is:
https://www-example-com.cdn.ampproject.org/c/s/www.example.com/example-category/example-page/amp
Google states that to update you need to have the /update-ping/ prefixing the /c/s switches but that never worked for me. After much trial and effort using the above format works for me every time.
If you run it in your browser expect to see the old version on first page load but if you refresh after that the updated amp page should show.

Wordpress not reflecting phpMyAdmin database changes unless I log in

this is I think a really unusual case. A little backstory, I outsourced a PSD to WP project a few months ago, but not currently working with the developer anymore as he stopped replying to my support questions. I'm trying to solve this on my own before I give this to the client, as I have no more budget to hire another developer.
I have two problems, first is I couldn't access the WP dashboard even though my login is an admin account. Been trying to solve this through numerous google searches and blog posts but to no avail, I couldn't fix it.
Here goes my main problem: So I finally found a way how to update the content on the site using the phpMyAdmin backend database. (good thing I know HTML CSS)
I managed to update the content, but when I tested the site using incognito window and other profiles / browsers, the changes from phpMyAdmin does not reflect on the site. I tried logging in, and weirdly, the changes are there. I log out, changes are there.
I just find it really weird and a hassle that I have to log in to see those changes. It's a client facing site, and the changes are really important so I hope someone has experienced this before and can help me out. Thanks in advance.

How is Google Analytics providing data for my site without the JS code?

I signed up for Google Analytics a couple months ago, but have yet to actually set up the JS snippet on my site.
Today I logged into the dashboard and I see tons of tracking data already in there.
I'm trying to figure out how Google is gathering user data on my site when I haven't even hooked up the code yet.
Also, I see a handful of hits to completely random paths on my domain (mostly foreign). Stuff like www.mysite.com/www.somepornsite.com and I'm just curious why a bot would even bother trying to hit a full domain as a subpath. Or even why my site's getting hit at all (it's completely behind HTTPAuth at the moment), but I suppose that's inevitable.
Thanks for any insight.
I had the same problem a couple of months ago, it turned oud that a bot got my script and did malicious things with it. I got my self a new Analytics code and it did the trick for me.
This will probably also work for you although it it weird that they got your script without even having it published yet.

Why is Google Analytics In-Page Analytics telling me that the tracking code isn't installed when it clearly is?

I see this problem pop up in a lot of places and asking on Google's product support forums was no help at all, so I turn to you guys. My client has asked me to look into this problem with their In-Page Analytics reporting which turns up the errors:
Your site doesn't load ga.js from Google. If you host the Google
tracking code on your own servers, it isn't updated automatically and
can miss important changes.
We didn't find a tracking snippet on your site. In-Page Analytics
cannot load. Please make sure you have tracking installed correctly.
If your snippet is included in a separate JavaScript file, you'll
have to manually check it is being loaded correctly.
Both of these statements are false. To ensure that it wasn't my original setup that was the problem I installed Yoast's GA plugin (it's a wordpress site) and I still get this error. I've also confirmed that the tracking ID is correct. All other metrics are being reported in GA. This in-page section, however, is the problem.
This is the website, by the way. Any help you have to offer would be greatly appreciated.
http://stoppredatorygambling.org/
How long has it been since the first hit to the property/view? In my experience it takes anywhere from several hours to up to 2 days for that message to go away.

Resources