---
title: "Installing the Universal Tracker SDK using NuGet and MS Visual Studio"
slug: "installing-the-universal-tracker-sdk-using-nuget-and-ms-visual-studio"
abstract: "How to install the Universal Tracker SDK using NuGet and Microsoft Visual Studio."
---
# Installing the Universal Tracker SDK using NuGet and MS Visual Studio

To install the Universal Tracker SDK using NuGet and Microsoft Visual Studio:

1. Create a project in Visual Studio. You can create a desktop application, mobile application, Silverlight application, and others. This example describes how to create a console application.

    ![visual studio new project dialog](<https://doc.sitecore.com/api/markdown-image/xp/en/developers/92/sitecore-experience-platform/images/visual%20studio%20new%20project%20dialog.png>)

2. In the **Solution Explorer** window, right-click the project node.
3. In the context menu, click **Manage NuGet Packages**.

    ![visual studio mobilsdkdemo program](<https://doc.sitecore.com/api/markdown-image/xp/en/developers/92/sitecore-experience-platform/images/visual%20studio%20mobilsdkdemo%20program.jpg>)

4. In the **Manage NuGet Packages** dialog box, enter the `Sitecore.UniversalTracker.MobileSDK` ID in the search field. The ID is case insensitive.
5. Select the *Sitecore Mobile SDK for Universal Tracker* search result and click **Install**.

    ![nuget package manager](<https://doc.sitecore.com/api/markdown-image/xp/en/developers/92/sitecore-experience-platform/images/nuget%20package%20manager.png>)

6. Read and accept the license agreements for the UT SDK.

    Once the NuGet package has been installed, you can see the updated project references.

    ![solution explorer](<https://doc.sitecore.com/api/markdown-image/xp/en/developers/92/sitecore-experience-platform/images/solution%20explorer.png>)

7. In the Visual Studio **Code Editor**, add the following code to the Main() function of your application:

    ```csharp
    private static void Main(string[] args)
    {
    string instanceUrl = "http://my.site.com";
    string channelId = "27b4e611-a73d-4a95-b20a-811d295bdf65";
    string definitionId = "01f8ffbf-d662-4a87-beee-413307055c48";
    var defaultInteraction = UTEntitiesBuilder.Interaction()
                                               .ChannelId(channelId)
                                               .Initiator(InteractionInitiator.Contact)
                                               .Contact("jsdemo", "demo")
                                               .Build();
                using (var session = SitecoreUTSessionBuilder.SessionWithHost(instanceUrl)
                                                        .DefaultInteraction(defaultInteraction)
                                                        .BuildSession()
    					)
                {
                    var eventRequest = UTRequestBuilder.EventWithDefenitionId(definitionId)
                                                       .Timestamp(DateTime.Now).Build();
                    var eventResponse = session.TrackEventAsync(eventRequest).Result;
                    Console.WriteLine("Track EVENT RESULT: " + eventResponse.StatusCode);
    			}
    }
    ```

8. Add the following namespaces to your project to make the code compile properly:

    ```csharp
    using System;
    using System.IO;
    using System.Threading.Tasks;
    using Sitecore.UniversalTrackerClient.Entities;
    using Sitecore.UniversalTrackerClient.Request.RequestBuilder;
    using Sitecore.UniversalTrackerClient.Session.SessionBuilder;
    ```

Sample output of the application:

![application output universaltrackerdemo](<https://doc.sitecore.com/api/markdown-image/xp/en/developers/92/sitecore-experience-platform/images/application%20output%20universaltrackerdemo.png>)