Sitecore Tracker.Current is not initialized
Asked Answered
B

3

9

I'm having this issue related with Tracker.

[InvalidOperationException: Tracker.Current is not initialized]
   Sitecore.Analytics.Pipelines.StartAnalytics.StartTracking.Process(PipelineArgs args) +304
   (Object , Object[] ) +74
   Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +484
   Sitecore.Analytics.Pipelines.StartAnalytics.StartAnalyticsPipeline.Run() +293
   Sitecore.Mvc.Analytics.Pipelines.MvcEvents.RequestBegin.StartTracking.Process(RequestBeginArgs args) +139
   (Object , Object[] ) +74
   Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +484
   Sitecore.Mvc.Pipelines.PipelineService.RunPipeline(String pipelineName, TArgs args) +184
   Sitecore.Mvc.Routing.RouteHttpHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData) +74
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +923
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +157

In the web.config I've the

enableTracking="true"

If I set to false it works but there's no Tracking

Barham answered 21/10, 2016 at 11:12 Comment(6)
Which version of Sitecore do you use? do you have both Xdb.Enabled and Xdb.Tracking.Enabled settings set to true (check /sitecore/admin/showconfig.aspx)?. Does your license supports xDB?Nikaniki
Where are you calling the code - is it in an MVC Controller or code that was called via an MVC controller?Seaway
Are you using mvc or webforms? Are you requesting a Sitecore page or some custom page? Sitecore will normally instantiate / initialize the tracker when u call a Sitecore page, but if you are viewing a non Sitecore mvc routed page u might be missing the Sitecore pipelines that normally run. We need more information to help.Geraldina
Thanks for the answer but I was looking at the problem and it was related with my custom ContactFacets.config that was not correct. Unfortunately the error warning is not so much conclusive.Barham
@Younes, I have had same problem, I was using latest version of sitecore (Sitecore 8.2 rev. 170728 (exe)), when I created new custom home page item and created new layout in vs2017, then published them, to preview it, the error message is show as above.Belligerent
Did you run Mongo instance? Did you add @Html.Sitecore().VisitorIdentification() in <head> of your layout?Congeries
C
7

There are multiple factors that can contribute to the issue you are experiencing. To simplify and summarize comments given previously, you need to be sure that:

  1. MongoDB is running
  2. Your Connection Strings properly set
  3. Sitecore License has xDB added
  4. Xdb.Enabled and Xdb.Tracking.Enabled are both set to "true"
  5. Analytics.ClusterName in Sitecore.Analytics.Tracking.config is a proper hostname
  6. Verify you have VisitorIdentification tag added (to weed out robots)
Contaminate answered 3/10, 2017 at 19:43 Comment(1)
And another: you aren't trying to access the tracker before its been initialized e.g. in httpRequestBegin pipeline, the tracker hasn't been startedSpindling
I
3

The first thing we need to check is to make sure Mongo DB is installed and Mongo DB service is started.This fixed the issue on my machine.

Ineffaceable answered 23/1, 2018 at 16:17 Comment(1)
Yes, everything is running without any problem.Barham
O
0

Most recently, I had my Mongo DB running in a Docker Container and Docker wasn't running and so, Mongo DB wasn't running either... when the container was started, the issue was resolved.... Just a variation of the fact that a running MongoDB solves the issue!

Ophelia answered 21/9, 2020 at 4:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.