If it's the GA standard tracking code you can choose to simply put the GA script in the <head> section of your layout/master template or whatever the template/view where you have your <head> is called in your solution.
If you want the client to be able to insert the script you can create a textarea field somewhere in the Umbraco solution where you then use a partial or macro to fetch the content and render it in the <head> section.
Ok, but how are you rendering content like bodytext etc. currently? Are you using @Umbraco.Field or Razor?
Rendering the content from the textarea is same approach as rendering a normal bodytext etc.
You need to log in to the google analytics account of your client and get the code from there - You log in here https://analytics.google.com/ - Or perhaps ask your client to send you the GA code that should be used.
When you have it then copy it to the texarea in Umbraco and render the content of the field in your view.
Cool, don't be shy to ask further questions in case you get stuck. This is a friendly forum even though some people add some harsh comments from time to time but don't mind the few :)
GA code
How to implement GA code Code plz...
Hi Sagar
If it's the GA standard tracking code you can choose to simply put the GA script in the
<head>
section of your layout/master template or whatever the template/view where you have your<head>
is called in your solution.If you want the client to be able to insert the script you can create a textarea field somewhere in the Umbraco solution where you then use a partial or macro to fetch the content and render it in the
<head>
section.Does this make sense? :)
/Jan
Actually i am new to ga, i need the steps or the code for this implementation. :)
Hi Sagar
Ok, but how are you rendering content like bodytext etc. currently? Are you using @Umbraco.Field or Razor?
Rendering the content from the textarea is same approach as rendering a normal bodytext etc.
You need to log in to the google analytics account of your client and get the code from there - You log in here https://analytics.google.com/ - Or perhaps ask your client to send you the GA code that should be used.
When you have it then copy it to the texarea in Umbraco and render the content of the field in your view.
Does this make any sense? :)
/Jan
yeah thanks Jan i got it :)
Cool, don't be shy to ask further questions in case you get stuck. This is a friendly forum even though some people add some harsh comments from time to time but don't mind the few :)
Have a nice day Sagar and happy coding!
/Jan
If you go here, this will help you out a lot!!!
http://bfy.tw/6eIM
is working on a reply...