Enable the web analytics tracking feature
Tracking is a function of Content Delivery (CD) roles that you can enable or disable depending on the role's purpose. For example, tracking serves no purpose on a CD role that exclusively provides digital assets.
You must register activities such as goals, campaigns, outcomes, page events that you want to track. You do this by associating the activities with content items. For example, you can associate a campaign with a specific page so that when a contact visits the page the campaign is recorded in the interactions for that contact.
You can use Content Editor to associate activities to be triggered and tracked automatically, or you can do it programmatically with custom code to gain more flexibility.
To enable tracking programatically:
-
Ensure that your layout contains the MVC helper or the
VisitorIdentification
tag.-
If you are using ASP.NET MVC, use the MVC helper:
RequestResponse@using Sitecore.Mvc.Analytics.Extensions @Html.Sitecore().VisitorIdentification()
-
If you are using ASP.NET Web Forms, use the
VisitorIdentification
tag:RequestResponse<!-- ASP.net> <sc:VisitorIdentification runat='server'/>
-
-
Ensure that tracking is enabled. If you do not have a Sitecore XP license or have chosen to disable the xDB, you can still use some in-session personalization features.
NoteThe package you use to install your Content Delivery role affects whether or not you can enable tracking and use limited personalization when xDB is disabled.