Sitecore 8.2 U4
I am working on tracking the movement of the user through my registration form. As they move from section to section, I am going to add a page to their tracker so I can see that movement in a Sitecore funnel.
I am making an API call to a controller /apis/v1/registration/tracksection/{section}
. In that controller I am calling Tracker.Current?.CurrentPage?.Cancel()
to stop the API url from being tracked by Sitecore. Later in that controller I am calling the code below to insert a page into the tracker. I am basically trying to fake a call to a page the user didn't actually go to. I am doing this so I can track the user's UI experience in a Funnel. A funnel only tracks Sitecore pages, so I have to fake these pages in the tracker.
But the issue is that after I run the code below. The API call goes back into the page history. If I comment out of the code below, the API is removed from page history via the Tracker.Current?.CurrentPage?.Cancel()
code as expected. Any idea how I can remove the API call and still inject the fake pages? Is there a different way I can add a page to the tracker that might work?
var page = Tracker.Current.Session.Interaction.CreatePage();
page.SetItemProperties(Registration.Constants.Ids.ClubInformation.Guid, "en-us", 1);
page.SetUrl(Sitecore.Context.Database.GetItem(Registration.Constants.Ids.ClubInformation).Url());