Google tracking code displaying on site

Hello! I published a website yesterday and noticed that the tracking code is displaying at the top of the website. I deactivated the Google Analytics plugin, but the code is still showing. Suggestions?

Hi there,

I tried to login using the details you have provided but it doesn’t seem to work.

Kindly check your functions.php file and see if you have added the code correctly.

If you were trying to load the file from the functions.php file of the child theme, please try this code:

function load_code() {
    ?>

        <!-- The code goes here -->

    <?php
}

add_action('x_before_site_begin', 'load_code');

Let us know how it goes.

Hi Jade. Thank you for your assistance! I checked the login and it is working. Sorry for the issue! I didn’t add the code to the functions.php file; I added it using the Google Analytics plugin provided with the theme. Let me know if you’re still having trouble logging in.

Hi again,

I checked your setup and it seems like your site is relying on heavy cache. Please clear your plugin’s cache first, check with your host and clear the server’s cache. If you’re using CDN make sure to clean it’s cache as well.

Let us know how this goes!.

Ah! I didn’t think to go beyond clearing only my browser cache. I installed a plugin and purged the cache, then turned off caching through my web host. About 10 minutes later, the code disappeared! This explains why it took hours for my website to appear after I published it yesterday. :roll_eyes: Thanks so much, Nabeel!

Glad to hear it!

Cheers!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.