We had a case where one of our sites just refused to sync with Google Analytics even though everything was installed correctly. We even reinstalled the analytics plugin, Analytify, multiple times and reauthenticated with Google Analytics successfully. However the site traffic remained at zero even though Google Search Console showed that traffic was indeed being driven to the site.
So what went wrong?
Well it turns out that this was a side effect of duplicating a website. This website was part of a larger network and had a similar website layout and content structure – the only difference was the actual content. So it made sense to duplicate the site and just change the contents.
Unfortunately the analytics plugin was not compatible with this behaviour and even though we reinstalled and reauthenticated multiple times, the front end source code still displayed the old website’s tracking code.
If your problem is similar to the behaviour listed above, perhaps the below fix will help you.
Fixing this problem requires directly making changes to the database. It’s quite simple, really:
- Login to cPanel, Plesk, or whatever control panel you’re using, and access the database, typically via PHPmyadmin or a similar database access software.
- Locate the database your website is connected to, and hit Search
- Search for your *OLD* GA tracking code in all tables. You should see a result in wp_options under the column option_name “analytify_ua_code” or similar (if you’re using a different analytics software)
- Change the tracking code to your new code
- Test by clearing your website’s cache and reloading the website. Check the source code with Ctrl+U and Ctrl+F, it should reflect the new code now.
Hope this helps!