Can't find a second google analytics code that's causing conflicts - php

I have a strange situation: I have a Wordpress site which includes an area to paste analytics code. I've done so. However, we're getting messages from google saying there is a tracking code mismatch. After calling Google we viewed the page source of the site and the SECOND analytics code is indeed there. It's preventing the REAL analytics code from firing. I just want to remove it.
However, there is only one place to put the tracking code in my site and that's where I've put the valid tracking code. I use Dreamweaver for my FTP stuff and have done a site-wide search for this extra analytics code and NOTHING shows up.
I've checked header.php, footer.php, index.php separately. The only thing I see is PHP code saying place analytics code here (i.e. from the theme options).
Where the hell is this second script and how can I find and delete it? Thanks for any help. I'm pulling my hair out about this.

Is the second/invalid analytics code appearing right above or below the first? Or is it in an entirely different area in the source code?
It may be a bug with the Wordpress theme you're using, or you might have a plugin enabled that has some predefined settings for inserting Analytics code. It might even be a widget. You could try disabling your theme/plugins to troubleshoot.
Temporary solution would be to remove the code from the Wordpress backend and add it into header.php or footer.php manually.

Related

Wordpress site broken, editor not working properly or at all

im working on adding and modifying the content of a website, but im having multiple issues with the very basic functioning of the editor. Please keep in mind i didnt build this site myself, so i might not be aware of many things that may be obvious to you.
If left unmodified, to the user, the site shows no issues whastoever, it is I as the administrator who experiencies all these issues.
I will describe/ show the issue and give a list of the things i have tried already.
While looking at Cpanel's PHP admin app, and the htaccess file, i see the php version is 7.4. However, while using wordpress, the site health status tool warns me that im using php version 7.1.33
Im not getting the admin bar when looking at the website, it just shows a white bar with nothing else.
3.If i go to the backend editor and try to customize the template im using (called Jupiter 5) i get very few options in the side bar, it doesnt show things like header options for example. And i have no floating editor options on the site itself, i get no tools, nothing.
See image
When i go inside wordpress to "pages" and try to edit a page, the editor box shows the content with the code included or shows nothing while using the "visual composer" mode. This is how it looks
When i try changing the template, the content appears like this. A huge mess, though some editor controls show up in this case
6.I tried using plugin detective but when i launch it, and it asks for my credentials, i hit login yet it does nothing.
I tried disabling all plugins, only header and bottom show up kinda normally, the body becomes text with code like the image of point 5. I still dont get the admin bar on site.
If I, after disabling all plugins go to pages, then select any page and click "edit", the adress of the site shows im on the edit page, but the page itself is completely blank, i dont even get the wordpress bar at the left.
If I disable all plugins, then activate only a plugin called WPBakery, the body of the site stops showing text with code and actually shows most visual elements, no edit options though, except for a small text at the bottom. A weird thing about this plugin is that despite of its name, when activated, it shows up as "Visual Composer" instead of WPBakery.
So far, besides disabling plugins and testing, i have only tried Updating Wordpress, the only thing that changes is that the admin bar finally shows, but the "customization" mode remains exactly the same, useless.
Classic editor is already installed btw.
I hope someone can help me, thanks.

Hiding the piwik top menu

I am using piwik analytics but i want to hide the top bar of the piwik when i view that in an iframe
http://prntscr.com/i5n3dy
how can do it, i tried looking into the code but it is using framework which i am not aware of and anything which i can write in the config file so it should not display in the iframe itself.
I went through the code documentation but could not find such information and even checked the github but to no avail, i found somewhere we can use use keycombination to z to hide it, but that is temporary solution.
Thanks.
If you only wan't to show the dashboard, widgets would solve your issue.
When you use the following URL (try it out), it will only show the dashboard without the top navbar and the sidebar.
https://demo.matomo.org/index.php?module=Widgetize&action=iframe&moduleToWidgetize=Dashboard&actionToWidgetize=index&idSite=3&period=week&date=yesterday
Otherwise you may wan't to look into theming to apply custom CSS.

How to remove ad script from wordpress theme?

Every time I open my wordpress site, it has automatically generate pop ads of tradeadexchange.com . I have tried many possible solutions but none of them worked.
In head tag, this script is automatically injected.
Below calls are created. In chrome console>Network>
How should I remove this script tag in my code in wordpress. Site link -http://www.radhefurnishing.com
I think this is not an issue of wordpress there may be some extension in browser will cause this issue first of all try to check in different browser and different machine.
If that is still there then let me know i will help you using some coding stuff.

Google toolbar truncating site

Hi I've got a site I'm working on it's just a html site with Wordpress integrated to allow a few dynamic features for the client. For some reason IE with Google Toolbar enabled truncates the information and strips the css. In other words it's like it does read anything until it get half way down the page. When you refresh a few times it will change what it does and doesn't display. If I remove the wordpress code fragment at the top(see below) it works, but of course all the dynamic content goes away. The weird thing is that if it's WP generated page it works just fine.
<?php
require('./cms/wp-blog-header.php');
?>
I'm a little lost on this. I'm not doing anything I haven't done several times before with fine results and I can't find anything about it online. Any help would be great, thanks.

Google Analytics - Can I put script in footer?

I want to add google analytics to our website and have read some conflicting info about where to put the script tag.
Google says to put it before the closing </ head> tag: http://code.google.com/apis/analytics/docs/tracking/asyncTracking.html
The way our site is designed, this would mean making an edit to every page. It's not that big of a deal if I need to do this, however, our site also uses header and footer include files.
These header & footer files have html code in them and fall just inside the <body> and </body> tags once the page is loaded.
It would be so much easier to just add the script to the header or the footer file. I'd just paste it in there once and it would be serving up the code on every page.
My question is: Can I do this? Can I move the script snippet inside footer include file even though it's not before the </head> tag as google suggests?
Am I asking for problems if i do it this way?
Thanks!!
You can.
The only difference is that if you put in the "footer" (i.e. just before the </body> tag), the browser will first load the DOM (i.e. everything up to the script tag) and then start to load the script. If you put it in the header, it will try to load the script either before it loads the rest of the DOM or while it is loading it (depending on the browser).
You might feel a difference only if you have a huge page with a lot of elements, but the only difference really would be that the script would be loaded later, so if someone aborts a load of the page, the script might not get executed.
Thus, Google recommends to place it in the <head> and if you can, you should, however you also can put it somewhere else if that makes life easier.
I would recommend saving the analytics code in a file and including it in your footer or header - Example: . I've recently run into some issues with Firefox and IE regarding the page load and analytics. It loads the page to the point where the analytics code is present and then the page hangs indefinitely. I can refresh the page and it loads fine, but for some reason it's happening and there's very little info out there regarding solutions. So, in my case I've included the code in the Footer or of the page at the bottom. This way, in regards to your site visitors, they'll likely not even notice because the rest of your page will load and once they click on a link it shouldn't hang again.
I'd say you can - but easier than that. Just place it in the footer and check if the Live-tracking finds visitors if it does you have the answer.
It's possible and is in fact the way many plugins do it (especially most WordPress plugins I've seen). In fact, putting all your JS at the end of the html (just before < /body>) is recommended if those are not required during the load of the page.
I have seen people put it pretty much anywhere on the page. You can put script tags anywhere on the page; many prefer to keep them in the <head> tag, while others put them at the bottom to avoid using document.ready. The point is that putting scripts there still works. Therefore, I see no problem in putting it at the bottom of the page.
Yes, I believe that it would work - it's not recommended though.
f you have a header and footer file, why not just append your Analytics code to it? Unless every page has unique footer/header page, of course. Then I'd recommend you to take a look at MVC.
Observations have already been made here regarding the scripts placement which can be taken on a site by site basis. We run Google Analytics using Google Tag Manager and use the header code placement in the footer and have no problems with that. Google is currently rolling out Core Web Vitals which places website performance as a must have, and so optimising code delivery is really important. Just wanted to add this here as it was pertinant.

Categories