Substitute for Activity

Srikanth Sharma asked on August 4, 2017 00:20

We're currently migrating to version 10 and blocked at the below error. Can you please suggest an alternative for the Activity

'CMS.WebAnalytics.Activity' is obsolete: 'Inherit from CustomActivityInitializerBase class or implement IActivityInitializer

  Activity internalSearch = new ActivityInternalSearch(searchtext.Text, DocumentContext.CurrentDocument, AnalyticsContext.ActivityEnvironmentVariables);
        internalSearch.Log();

Correct Answer

Mariia Hrytsai answered on August 4, 2017 10:45

In Kentico 10 you should use

CMS.WebAnalytics.PagesActivityLogger pagesActivities = new CMS.WebAnalytics.PagesActivityLogger();
pagesActivities.LogInternalSearch(searchtext.Text, DocumentContext.CurrentDocument);
3 votesVote for this answer Unmark Correct answer

   Please, sign in to be able to submit a new answer.