Google Analytics only loading in footer

Hi,

I have an odd one. I have the Google Analytics plugin set to load in the head, but it only loads into the footer. Any Thoughts?

The plugin is up-to-date and my logs how the following:

[17-Jul-2019 19:12:20 UTC] PHP Notice: Undefined index: tco_google_analytics_code in /public_html/wp-content/plugins/tco-google-analytics/functions/options.php on line 50

Thank you!

Hello Michael,

Thanks for writing in!

Please make sure that you have properly set up the fields. The Analytics ID must be field.

Kindly double check your settings again.

Yes, all the requisite fields are filled out!

Hi Michael,

This actually a known concern but they’re only PHP Notices and along with PHP Warnings they are not errors. It would of course be nice if all notices and warnings will be eliminated but that won’t be feasible due to the fast improvements in PHP. They only notify and warn developers that this should be addressed for future versions of PHP.

If you’re in a live site, it’s recommended that you turn debugging off or output the errors in an error log mainly for security reasons. You can follow the Example wp-config.php for Debugging here:

https://codex.wordpress.org/Debugging_in_WordPress

Hope this helps.

Yes, thank you. Debugging is off. However, this still does not address why the code would insert into the header and only outputs the footer. We have already tested against any other plugin issues to no avail.

Hello Michael,

We’d love to check your site. Would you mind providing us the url of your site with login credentials, if necessary, so we can take a closer look?

To do this, you can make a post with the following info:
– Link to your site
– WordPress Admin username / password

To know how to create a secure note, please check this out: https://theme.co/apex/forum/t/how-to-get-support/288

Thank you.

Thank you!! I appreciate it!

Hello Michael,

Actual there are two GA code in your site. One from the Google Analytics plugin and the second which is displaying in your footer is because you have inserted a GA code in X > Theme Options > Custom JS section. I went ahead and removed it already.

Please check your site now. Just make sure that you are logged out because it will not display if you are logged in.

Yikes. I had no idea. Thank you! I will look at the internally!!!

Glad we could help.

Cheers!

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