5

Something really weird. I have a custom Submit action for my forms that works great. But when I try and access the Sitecore.Analytics.Tracker, it is null. But only when in Ajax mode. When Ajax is turned off and normal POST actions are performed it works fine.

No errors in the log and all Sitecore related properties seem fine; Like site, context, DB, page, etc... Its like it is just turned off in Ajax mode.

public class SendMailAction : SubmitActionBase<SendMailActionData>
{

}

Anyone experienced this?

Update

I tried to use AnalyticsActionBase from Sitecore.ExperienceForms.SubmitActions, but it only exposes adding Goals, Campaigns and Outcomes. Not the tracker itself.

3

I also faced same issue so I have applied below code and it resolved my issue:

if (Tracker.Current == null && Tracker.Enabled) { 
Tracker.StartTracking(); 
}
  • Thanks. I could not find another way to do it. – Chris Auer Jul 23 at 14:59
  • I'll report this as a bug and see what comes of it – Chris Auer Jul 23 at 17:21
  • I also found that this is a bug. Please share if you will find any other solution – Swati Gupta Jul 23 at 17:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.