1

I try to track the top searched keywords to my website using the Sitecore analytics, I read that first I need to register the search page event, So I wrote this :

if(Tracker.Current == null)
        {
            var result1 = Tracker.Enabled;
            Tracker.StartTracking();
        }

        var searchEvent = Tracker.MarketingDefinitions.PageEvents[AnalyticsIds.SearchEvent.Guid];

        var result = Sitecore.Analytics.Tracker.Current.CurrentPage.Register(new PageEventData(searchEvent.Alias, searchEvent.Id)
        {
            Data = "Test Keyword 2"
        });

but still the internal search shows no data to display, I enabled the tracker and still the same problem, I'm using Sitecore 9

  • I believe for the internal search you need to set the Text property (at least that was the case in Sitecore 8) – Trayek Jul 27 '18 at 16:05
  • @Trayek Can you please give me more details, as sitecore 9 uses new methods – Mohamed Yaseen Jul 29 '18 at 7:48
  • var result = Sitecore.Analytics.Tracker.Current.CurrentPage.Register(new PageEventData(searchEvent.Alias, searchEvent.Id) { Text = "Test Keyword 2" }); – Trayek Jul 30 '18 at 8:51
  • I did this and it works, the internal search show words but it's not updated, I think it's delayed or works at specific intervals – Mohamed Yaseen Jul 30 '18 at 11:23

Your Answer

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

Browse other questions tagged or ask your own question.