Executing a request

Version:

All requests are executed asynchronously by the ISitecoreUTSession interface instance. The Universal Tracker SDK contains the corresponding class, but it should not be instantiated directly.

ISitecoreUTSession provides methods that process the appropriate events objects. For example:

UTResponse response = await session.ReadItemAsync(request);  

If you cannot use the async keyword with your method, use the Task.WaitAll() method instead:

var trackEventTask = session.TrackEventAsync(request);
Task.WaitAll(trackEventTask);
UTResponse response = trackEventTask.Result;

To track different types of events, use the following session methods:

  • TrackEventAsync

  • TrackGoalAsync

  • TrackCampaignEventAsync

  • TrackDownloadEventAsync

  • TrackPageViewEventAsync

  • TrackSearchEventAsync

  • TrackOutcomeEventAsync

  • TrackLocationEventAsync

  • TrackErrorEventAsync

  • TrackInteractionAsync

If you have suggestions for improving this article, let us know!