• Hi, and thanks in advance for taking the time to read my post.

    https://rentalboilers.com

    We have Google Analytics code somewhere on the site that we aren’t using, and it is conflicting with the code that we are using. I believe that the designers of the page were using Analytics for internal purposes. Anyways, I’ve added our code to the footer of the page, which is UA-21782599-1.

    The one I want to get rid of is UA-21807472-1, and it appears to be dynamically generated, which leads me to believe that it is somewhere in the template. I have gone through all of the php files on the right pane in the WP editor, and haven’t been able to find it. If anyone can shed some light on where this code may be located, I would really appreciate it. Again, thanks for your help.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Check whether that code exists in the footer.php file in your theme folder. If not, it may be generated by a plugin or some custom code.

    Thread Starter korngames

    (@korngames)

    Thank you for your response. It definitely isn’t in the footer, that’s where I’ve put the Analytics code that I want to use. There is a plugin for Google Analytics, but it is deactivated. I’ve been digging around everywhere, to no avail. I didn’t create this site, I’ve just inherited the responsibilities. The company that built it no longer exists.

    Ok, if you have a linux server and can access shell, first cd to your wordpress folder and use command

    find . -print0 | xargs -0 grep "UA-21807472-1"

    Which will show you the files that have the string “UA-21807472-1” in it.

    I don’t know similar command for windows, however, you can use free software Notepad++ to find all files in a given folder that have a given string in it.
    If it’s still not there, that code may be in somewhere in the database.

    Thread Starter korngames

    (@korngames)

    I took your advice. I am a Linux fan, but we use Windows at work. I was able to find the code at two places inside an SQL file that is almost 200 megabytes. I’m thinking that this is the entire WP database for the domain. Is it safe to delete the code right out of the database?

    SQL file? What do you mean? you mean a file with an .sql extension? If yes, it may a backup file of ur database and not your current database (unless you don’t use SqLite) and editing it won’t affect your site at all and its useless. What is the DBMS you are using for your website? is it MySQL? If you can access your database tables, search for that value in option_value column of your wp_options table in your database.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Finding Google Analytics Code’ is closed to new replies.