A reminder, things you also need when installing Google Analytics plugin for EPiServer and using ASP.Net MVC
There are probably some documentation regarding this on EPiServer World but I had some trouble finding the information needed. Installation of the Add-On for Google analytics is really easy but to make everything work we also need to put some code in your views, not only install the add-on
There are two ways of make Google Analytics track your visitors:
Update:
- Use RequiredClientResources (Recommended)
1: @Html.RequiredClientResources(RenderingTags.Header)
2:
3: @Html.RequiredClientResources(RenderingTags.Footer)
- Or use AnalyticsTrackingScript helper if you are not using above already in your _Layout.cshtml
1: @Html.AnalyticsTrackingScript(Model.CurrentPage)
And that’s it.
Happy tracking
Comments