I have been trying to install Google Tag Manager to my website http://www.sirextiles.com
I have not been successful. It required me to add a certain script to my head tag and also body tag. In ‘Appearance>Editor’ I have made the changes to header.php file. After updating the file, when I checked the site (in incognito after clearing cache and refreshing) I wasn’t able to find the script in the source code(check screenshots Logged in 1, logged in 2). However, when I logged on to my WordPress dashboard and then checked the site (while logged in) I find it in the source code. (check screenshots Logged out 1, logged out 2)
Because of this, my google tag manager has not been implemented successfully. Kindly help me out soon. It’s urgent!
I hope you are well today and thank you for your question.
It seems you are using the cache on your site therefore the changes are not reflecting when you are logged out.
To resolve the issue try clearing the cache or temporary disabling it.
Please note i am talking about server cache and not browser cache.
I use WP Rocket at the moment. I have used “clear cache” option as shown in the screenshot. I don’t know if this is the right server cache option. I could not find any other option in WP rocket that lets me clear server cache. Could you help me identify how to clear server cache? I don’t know how to do it.
Also, Any other changes I make for example creating a new page, post, everything is reflected on the site. It is just this tag manager installation that is giving me problems.
Yes WP rocket is server cache so you can try temporary disabling it.
Alternatively instead of editing theme files, you can try installing it using any of the solutions listed below.