Our documentation is changing, please click here to enjoy it!

Skip to end of metadata
Go to start of metadata

Events

To use the additional parameters of the custom events for targeting purposes, they must formatted as a valid json string. Use a timestamp to represent a date.

If you want to track a specific event :


Where 1000 is the eventId.

Custom Events

It is possible to build custom events and track them via the following method : Accengage.TrackCustomEvent(long type, dictionary<string, object> parameters);

CustomEvent type is supposed to be a number strictly higher than 1000 (long-typed).

CustomEvent parameters are designed to be a dictionary composed of key/value couples.

Keys are strings regardless of whether you are on iOS or Android

On the other hand, values type change depending on whether you are on iOS or Android platform.

    In Android we are expecting to pass value in the following types :

    • Boolean
    • Int32
    • Int64
    • float
    • Double
    • Java.Util.Date
    • String

    If you try to pass other kind of data, it will be treated as a String

    In iOS we are expecting to pass value in the following types from the Foundation Framework :

    • NSDate
    • NSNumber
    • NSString
    • bool

    If you try to pass other kind of data, it will be ignored.



    Analytics

    You can track specific events like “Add to Cart”, “Purchase” and “Lead”. Here is how to use each of these events.

    Lead 

    Add to Cart

    First of all you will need to create an Item using the AccengageItem class.

    Currency should be a valid 3 letters ISO4217 currency (EUR,USD,..) and the 2 last arguments are price and quantity

    Now you just have to add it to the Cart.

    Purchase

    Update Device Info

    You can create a device profile for each device in order to qualify the profile (for example, registering whether the user is opt in for or out of some categories of notifications).

    A device profile is a set of key/value that are uploaded to Accengage server. In order to update information about a device profile, add the following lines to your code:

    Where listUdi is a List<KeyValuePair<string, string>> containign all the informations to update.

    New API to Update Device Information

    You have the ability to use update device information using the following method : public static void UpdateDeviceInformation(string action, string key, object value);

    Action are string-typed. Possible values are “set”, “delete”, “increment” and “decrement”. Using other values would be ineffective.

      In Android we are expecting to pass value in the following types :

      • Boolean
      • Int32
      • Int64
      • Double
      • Java.Util.Date
      • String

      If you try to pass other kind of data, it will be treated as a String

      You can only operate “increment” or “decrement” actions on suitable value Double in Android

      In iOS we are expecting to pass value in the following types from the Foundation Framework :

      • NSDate
      • NSNumber
      • NSString
      • bool

      If you try to pass other kind of data, it would be ignored.

      You can only operate “increment” or “decrement” actions on suitable value NSNumber in iOS

      Subscription Tag

      Subscription tag is a new API used to mark user interest for a particular topic : public static void SetDeviceTag(string category , string identifier, Dictionary<string, object> parameters)

        In Android we are expecting to pass value in the following types :

        • Boolean
        • Int32
        • Int64
        • Java.Util.Date
        • String

        If you try to pass other kind of data, it will be treated as a String

        In iOS we are expecting to pass value in the following types from the Foundation Framework :

        • NSDate
        • NSNumber
        • NSString
        • bool

         

         A device tag can contain up to 5 parameters and all parameter key should be different.

        As mentionned with the name of the method, setDeviceTag is an update of the Subscription Tag, it will override then the previous information.

        You can set an expiration date for your Subscription Tag by adding the parameter "exp" to the Device Tag where the value is a timestamp for the expiration date :

        You can unsubscribe a user to a particular topic with the following code :

        Important
        Please note that this feature is only available through Accengage's API

        Views

        You can identify each views of your application that the SDK can refer to using.

        where MyView is the name of your view.

        iOS

        This method must take place in the viewDidAppear and is to be used with TrackScreenDismiss in the viewDidDisappear. Look the Documentation.

        • No labels