Google Tag Manager Preview Mode not working? Here’s the fix

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
sometimes when you work with google tag manager the preview mode just doesn't work and in this video i will show you how to fix it [Music] hey my name is julius and welcome to analytics mania youtube channel where you can learn google tag manager and google analytics and if you want to stay up to date with google tech manager consider subscribing google tag manager's preview mode is a very useful feature that allows you to test your setup before publishing it however sometimes it just doesn't connect to your website and in other cases it does connect but it does not work as you would expect in this video i will share the most common issues and how to fix them if these tips don't work for you at the end of this video i will tell you what to do next alright so let's take a look the first possible reason why google tag matches preview mode doesn't work for you is that maybe google tag manages container snippet which is right here maybe it is not added to the source code of the website at all or maybe it is added but it is broken there are several ways how you can check whether google tag measures code is on the website and whether google tag manager loads on a site so if we go to the website where you're working on and then you click on three dots right here by the way i'm using google chrome then choose more tools developer tools and then go to the network tab here you should enter in the search field gtm.js so in your case it will be empty enter gtm.js and then refresh the page once again if you see gtm.js file right here and its status is 200 it means that google tag manager is installed properly and preview mode is not working for you because of some other reason however you might be facing another quite popular issue because well maybe you open the source of the website and you see your google doc magic container snippet added right here but if you open the developer tools and then look for gtm.js and reload well in this case you won't see anything now why is that and one of the possible reasons is that when you copied the code from the google tag manager interface and you forwarded that code to your developer maybe you did that by pasting the code in the google docs or microsoft word or in some other rich text editor in that case those editors actually quite often change the quotation marks and if in this case if you zoom in you will see that instead of regular simple quotation marks that are right here we see in the code these quotation marks or maybe some other quotation marks that look differently compared to these ones so even though google tag managed container snippet is added these quotation marks break the code and this never works that's why you have to make sure that the container snippet which is added to the source code of the website is exactly the same without any modifications and it is the same as this one well technically there can be some exceptions where the code might look different because maybe you're working with different google tag manager environments but right now let's not focus on those exceptions and just remember that you have to make sure that this code must be exactly as it is right here then another reason might be that you are working on different browsers or even different windows when it comes to regular browsing and incognito browsing so for example here if i enable the preview mode in my google tag manager container by entering the address right here clicking connect and then i'm redirected to that website my debugging has to continue on this browser and for example i want to debug the same website on incognito mode while my preview mode is enabled on a regular browser window actions that i do in incognito mode will not be visible in the preview mode because incognito mode is kind of isolated and a completely different window compared to the regular window of a browser so if for example you want to debug something in incognito mode you have to log into your google doc manager account in this window and then initiate the debug mode from here or you can go to your existing preview mode in your regular browser window then click right here share then make sure that this option is selected that includes your google doc managers container id as well then copy this link and open in the incognito window it will work then i don't have the exact explanation for this part but it sometimes just works so if the preview mode cannot connect to your websites window then just close both of these tabs close the website window actually can close all of them and then close the preview modes tab as well and then launch the preview mode once again in some cases this helps so you should click that preview button right here then enter the url of the page where you want to debug and click connect now let's move on to the next tip sometimes other browser extensions might interfere with google tag manager's preview mode for example various extensions that are designed to increase the privacy of the user might cause problems for google tag manager for example ghostery adblock u-block origin or other extensions that serve the similar purpose they might cause problems when it comes to google maps preview mode so if you have them then you should either temporarily disable them or maybe you can add google tag managers preview mode which is tag assist.google.com and also google tag manager.com maybe you can add them to whitelist of that extension also in some cases even plugins that are not related to privacy enhancements they also might cause problems so in that case what you can do that you can try to enable the preview mode of google doc manager and incognito because usually in that mode you don't have many extensions enabled and if preview mode actually works in incognito it means that some of your extensions for example in my case one of the google chrome extensions they are causing problems and it's difficult to identify quickly which exact extension does that so then you should just disable them one by one and then after you disable one try to refresh or enable the pre-mode once again and at some point if the preview mode starts working it means that this particular extension was causing the problem then another tip is to try tweaking other settings for example when you try to enable the preview mode you will see a pop-up that will ask you to enter the address of the website here you will also see this checkbox try to disable that checkbox and see if it helps another option could be to install this extension and i will add the link to this extension below the video if you already have this extension then try to uninstall it and see if it helps also there is a chance that you already have this extension which is tag assistant legacy so if you have it try to uninstall it maybe it is causing the problem if you don't have it maybe you can try to install it and see if it helps but if you're watching this video far in the future there is a chance that this extension will not be available anymore because as of the moment of recording this video this extension is already legacy i will post a link to tag assistant legacy below the video then another reason that might be causing the problem is content security policy in a nutshell content security policy is like a set of rules that your developers can implement on a website in order to increase security and this policy limits certain capabilities that can be done with javascript however google tag manager is also using some of those capabilities in order to inject scripts so if the content security policy is too strict on your website and it causes problems for google tech manager you will then see this kind of error in the developer tools of your browser or something similar the most important part here is that the error must say something about content security policy now the only solution here is to cooperate with the developer of that website and ask to update certain rules of the policy in order to allow google to magic to work simo ahava has published a blog post about this topic and if you want to learn more i will post a link to it below the video however if none of these tips helped you i have a blog post with a much longer list of possible reasons some of them are quiet edge cases but maybe they apply to your situation i try to keep this blog post updated and you will find the link to it below the video and if after all of this you are still facing problem then post a comment below the video with the description of your issue and then i will try to help i hope that this video helped you fix your problem with google tag manager's preview mode however if this video did not help you take a look at the blog post where i share more solutions you will find the link below the video if you found this video useful hit the thumbs up button below the video because it helps me continue working on this channel also if you want to learn more about google tag manager or google analytics 4 consider subscribing to this channel my name is julius this is analytics mania and i'll see you in the next video [Music] you
Info
Channel: Analytics Mania - Google Tag Manager & Analytics
Views: 5,082
Rating: undefined out of 5
Keywords: google tag manager, google tag manager preview mode, gtm preview mode, google tag manager debug mode, google tag manager preview mode not working, google tag manager preview and debug mode, tag assistant, test google tag manager, preview mode, preview mode google tag manager, google tag manager tag assistant, new tag manager preview mode, new tag assistant, debugging google tag manager, gtm debug, gtm tag assistant
Id: aEWZv3Jofg8
Channel Id: undefined
Length: 8min 51sec (531 seconds)
Published: Tue Jul 27 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.