Google Analytics issue

Hi,

I’m trying to verify a site through Google Console. However, google is advising it cannot verify because 'The Google Analytics tracking code on your site looks malformed.'

I notice that when I copy the following GA tracking code into the GA plugin - the plugin updates changes the code.

Copied code is:

Final code after hitting update on the plugin is:



It seems to remove

Can you advise?
Thanks
Paul

Hi Paul,

Please try to add this in the functions.php of your child theme instead:

function my_custom_head_output() {
  ?>
    <!-- Add the Google code here -->
  <?php
}

add_action( 'wp_head', 'my_custom_head_output', 99999 );

Hope this helps.

I’ve used another plugin for now. Please can you confirm if this is a known issue with the GA extension that comes with pro?

Hi there,

I have tested the case and the plugin switches the code to the global gtag which is the new system and future standard of the Google. For more information:

Gtags work just like the old Analytics code with no issue.

Thank you.

Ok thanks…what prompted me to submit a ticket was that Google Console didn;t recognise the code when trying to link it up.

Hi There,

You are always welcome!
There is a bug on Google analytics addon but the recent release yesterday fixed that issue. See it here: https://theme.co/changelog/#google-analytics-2-0-3