2
votes

My client has a website running on umbraco v4, i need to insert GTM code right after the body of the website.

The website cms is very old, i don't have any option of editing code in it or add any, only creating pages.

so i downloaded the website with the FTP but i cant find any index to edit, is anyone familar with how to add code in this kind of system?

couldn't find anything on the internet of course, and i tried to ask around https://our.umbraco.org but nobody is responding to my questions

2

2 Answers

2
votes

If you've downloaded the whole thing, there should be a /masterpages/ folder containing, well, master pages. One of the master pages should contain the </body> tag and you can edit it using Notepad or whatever :-)

EDIT: In this case it was an MVC based site, meaning the "master pages" were located in the /Views/ folder instead.

0
votes

Summary: Place the code, as recommended, into your .net master pages or views (depending on whether you are using web forms or MVC) & FTP those files back onto the server.

If you can't edit any code then you can't add GTM, in the same way you wouldn't be able to add the Google Analytics javascript without being able to change code.

Detail: I've added GTM on Umbraco version 4 websites so there is not a problem technically. The way Umbraco works is that it interrupts the pipeline to default.aspx & delivers content pages based on the doc type/template/page setup. So there is no index page that can be manipulated.

Now with version 4 you may well be running a web forms system. Each template in this system will be a .net master page & it is within the master pages that you need to poke the GTM code. If you have an inherited master page system then you may only have to implement it on the master page that is on top of all other master pages. If all the master pages are siblings then you'll need to poke in the code into every master page.

If your version 4 system is an MVC build (using MVC Bridge or whatever) then the same comments apply, but it's your views that will need amending.