Random JS was inserted at the very bottom of my site after adding the Google Tag Manager code.

[ad_1]

**tl:dr: random js being inserted in the footer from GTM tag**

**Site**: [https://gero.cuchicago.edu/])

Hello, not sure if this is the place for this, but I am a bit at my wit’s end here, so I hope someone can assist.

We have multiple sites, all using the Avada theme, and we have not seen this issue on those sites. I came across this code at the bottom of the site:

**//Add script before add\_action(‘wp\_footer’, ‘my\_custom\_footer\_js’); function my\_custom\_footer\_js() { echo ‘**

**’; }**

I went plugin by the plugin and figured out it was the insert headers and footers plugin, so I removed that and then re-added the GTM code to the Avada native code fields feature. But the issue persisted, so I tried other plugins that don’t require the GTM script, just the GTM container ID. And it still persisted, so I started looking in the header and footer php files for anything odd or a line of code that’s not closed and cannot find anything.

Has anyone seen this issue before and knows how to resolve it?!

[ad_2]

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer