Tag events in WinRT

When an interesting event occurs in your WinRT application, tag it using these instructions.

You may want to collect additional data about some events, such as how many lives a player has or the last action a user took before clicking on an advertisement. Collect this additional data with the second form of tagEvent, which takes a dictionary of key/value pairs, or attributes, along with the event name.
  1. Tag a single event with no attributes by adding the following line of code, where “Options Saved” is a string describing the event.
    Localytics.TagEvent("Options Saved")
    
  2. If you want to add attributes, modify the tag as follows. You'll need to create a Dictionary of key/value pairs and store it as a variable.
    Dictionary<string, string> attributes = new Dictionary<string, string>()
    {
        { “key1", “value1"},
        { “key2", “value2"},
        { “key3", “value3"},
    };
    
    Localytics.TagEvent("Options Saved", attributes)
  3. If you want to add information that will track a customer's lifetime value, modify the tag as follows. Read more about using LTV.
    Dictionary<string, string> attributes = new Dictionary<string, string>()
    {
        { “key1", “value1"},
        { “key2", “value2"},
        { “key3", “value3"},
    };
    
    Localytics.TagEvent("Options Saved", attributes, 4995)
  4. Note: This step is only required for manually integrated applications. If you chose automatic integration, events are uploaded when your app is foregrounded or backgrounded.
    Upload accumulated events.
    Localytics.Upload()