Hello, I am using umbraco v 4.7.0 and am getting very confused about where to put my Google analytics tracking code. If I try and enter it in the HTML of each page when I update the HTML it then wipes it again. If I look at the page source it seems to have a section for Google analytics but not my individual tracking code. Could you help?
If I understand your question correctly, then you already have some basic Google analytics tracking code for tracking the visitors on the site. If you want to add the same script to all pages of a specific type, then you could add the tracking code into the template for the specific type of page.
If you have access to the backoffice of your Umbraco installation then you need to go to the settings section, and the find the template folder, and find the templte for the page type that you want to place your Google analytics tracking code for. By doing it this way it means that every page that uses that template will get the analytics tracking code.
If you need to target individual pages, you need to add a property to your document types, where the user can place the tracking code and pull out the field for the current page. Maybe you need some developer help here, if you not are a developer. But here are some information on how to a fields to the page type to the backend, and pull out data for the specific page.
The field type I would recommened you to use for the tracking code is the textbox multiple
The way that you could get out the data for the current page that you are watching in the browser is by placing this into the template where it should dispay, if you have create a field in the backoffice with the alias of trackingCode
umbraco v 4.7.0 - Google analytics
Hello, I am using umbraco v 4.7.0 and am getting very confused about where to put my Google analytics tracking code. If I try and enter it in the HTML of each page when I update the HTML it then wipes it again. If I look at the page source it seems to have a section for Google analytics but not my individual tracking code. Could you help?
Thanks
Hi Hannah and welcome to our.
If I understand your question correctly, then you already have some basic Google analytics tracking code for tracking the visitors on the site. If you want to add the same script to all pages of a specific type, then you could add the tracking code into the template for the specific type of page.
If you have access to the backoffice of your Umbraco installation then you need to go to the settings section, and the find the template folder, and find the templte for the page type that you want to place your Google analytics tracking code for. By doing it this way it means that every page that uses that template will get the analytics tracking code.
You can find some video toturials about working with templates in Umbraco here: http://umbraco.tv/videos/umbraco-v7/implementor/fundamentals/templating/introduction/ and http://umbraco.tv/videos/umbraco-v7/implementor/fundamentals/templating/setting-up-our-first-template/ as you can see you just can add static markup in the templates, and the same with scripts, so you can just add your individual tracking code.
Here are also some written information on how to work with templates. http://our.umbraco.org/documentation/Using-Umbraco/Creating-Basic-Site/CSS-And-Javascript and http://our.umbraco.org/documentation/Using-Umbraco/Creating-Basic-Site/Creating-Master-Template-Part-1
If you need to target individual pages, you need to add a property to your document types, where the user can place the tracking code and pull out the field for the current page. Maybe you need some developer help here, if you not are a developer. But here are some information on how to a fields to the page type to the backend, and pull out data for the specific page.
The field type I would recommened you to use for the tracking code is the textbox multiple
http://umbraco.tv/videos/umbraco-v7/implementor/fundamentals/document-types/what-is-a-document-type/
http://umbraco.tv/videos/umbraco-v7/implementor/fundamentals/document-types/properties/
The way that you could get out the data for the current page that you are watching in the browser is by placing this into the template where it should dispay, if you have create a field in the backoffice with the alias of trackingCode
Hope this helps, and make sense.
/Dennis
is working on a reply...