Google Analytics Issue with Meta Tag

This is infuriating. Where the hell do I put the meta tag to verify my site? I’ve installed all various tag plugins, including your own that says ‘Simply drop in your Google Analytics code snippet, select where you’d like it to be output, and you’re good to go! Google Analytics made easy.’

Drop it in where!?

Have fixed this now so please remove

Glad to hear that. Have a great day! :slight_smile:

Turns out I haven’t fixed it and I’m having a real time of it trying to add analytics to my site. It was working OK and tracking users but then it asked me to reverify my account, not sure why but since then it’s stopped tracking my data. I’ve just scrapped my analytics account and now starting again. I’ve added my tracking code to google tag manager OK but can’t add the universal tag to the site.

I looked at your own analytics plugin and it says ‘just drop in your code and you’re good to go’ or words to that affect, great, drop it in where though? I’ve looked at a couple of tag manager plugins and they give me no place to type in my tracking code either.

I had a look at this website and it seems pretty clear:

However, when I go to the header.php in X them I’m presented with this:

https://screenshotscdn.firefoxusercontent.com/images/4b9b7a2f-2789-4ff1-8357-00bd8c668e60.png

I don’t see a /header tag to enter the code before like the site says. Wherever I try to enter the code I just get:

‘Unable to communicate back with site to check for fatal errors, so the PHP change was reverted. You will need to upload your PHP file change by some other means, such as by using SFTP.’

So I’m completely at a loss. What should be a really simple task has turned into a pain in the arse. Can anyone help please? A step by step guide would be nice, thanks.

Hi David,

It’s a generic instruction for most of the site, the correct one should be adding this, the instruction just assumes you’re using the same theme as they show on that URL. The best and safest way is adding it through Wordpress hook. Example, you can add this to child theme’s functions.php ( https://theme.co/apex/forum/t/setup-how-to-setup-child-themes/57 )

add_action('wp_head', 'google_verification_meta', -9999);

function google_verification_meta () { ?>

<!--replace this line with the embed code provided on GA's instruction-->

<?php }

Then just replace that line with your own embed code. But make sure the child theme is active, else, the code will not take effect.

And the instruction you provided from that URL is for NO PLUGIN for the tracking code. With the plugin, you’ll just or may only need your GA UID instead of adding the code, the plugin usually adds it automatically that’s why you’ll not see any place where you can drop the code. Try our GA plugin and just add your GA UID.

Thanks!

Hello, yes I was aware it was for no plugin I tried to add it to the header.php directly.

Is your screen shot from Themeco’s own Google analytics plugin? If so I can’t see how to enter that settings page as it only gives me the options of deactivating or to visit the plugin site. So I’m still none the wiser.

Hi David,

In that case, please provide your site’s URL and admin login credentials in the secure note and we’ll check what you’re getting.

And I was referring and comparing the instruction and your question’s why there is no droppable area for the code. Sorry for the confusion.

Thanks!

Well before I do that I can just show you the screenshot. This is what I get on my plugin.php page:

https://screenshotscdn.firefoxusercontent.com/images/d540b3eb-9aeb-4d77-b8f2-9f51e269abde.png

Should there be something different there?

Hi David,

It’s the correct plugin, and like the above screenshot. You just need to place the Google Analytics ID, no need to drop any code. And the meta tag is for verication purpose like if google verification wants to you add something <meta >

Though, since I can’t further check it then I’m not sure what went wrong on your setup.

Thanks!

I’m obviously not being clear. Where exactly do I place the Google Analytics ID? Your screenshot says ‘it should go in the head section’ where is the head section? I mentioned I tried to paste it in the head.php but got an error code. I keep hearing over and over ‘just paste the code in’ but no one actually tells you where to paste the damn thing!

Seems I’ve fixed it… For now. I used the WP Global Site Tag plugin.

We are just glad that you have figured it out a way to correct the said issue.
Thanks for letting us know!

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