Search code examples
webformsgoogle-tag-manager

Should Google Tag Manager code be inserted in an ASP.NET Site.Master?


We are implementing Google Tag Manager in our web site. The site is an ASP.NET Web Forms site. It seems to me that the optimal way to implement this is to insert the Google code in Site.Master.aspx - is this correct, or is there a better way?

Thanks!


Solution

  • For our webforms site, we put our tag manager code in the master page, both in order to ensure that the code is in the right place (at the very beginning of the body tag) and also to easily get it loaded onto every page. Unless you have some unusual circumstance I think that seems most logical to me.