GTM installation

For GTM installation, I’m adding the head snippet via the functions file in my child theme. That works wells.

However, for the other GTM snippet, it should go immediately after the tag. I tried adding the code via functions file to be included x_before_site_begin but it places the code after another opening div. It seems that GTM won’t reconize the placement of the body snippet unless it is immediately after the tag.

To get around this, I’m modifying base.php in my child theme.

My question - is this still the best way to do it, or is there a better method? I’m a little concerned using base.php inside the child theme.

Hello @wbgTHEMECO,

Thanks for asking. :slight_smile:

Please take a look at the solution provided in following ticket and kindly let us know how it goes:

Thanks.

Thanks. Unfortunately, that is what I tried the first time, but the GTM body snippet isn’t immediately after the .

Then my GTM snippet.

That one div flags Google Tag Manager from verifying it.

Also, when I tried to use base.php in my child theme, for some reason the header stops working.

This is on the latest version of X.

Hi There,

Please follow the guide provided here instead.

Thanks,

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