PreEmptive Analytics .NET API  1.3
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events
PreEmptive Analytics .NET API Documentation

Overview

This is the reference documentation for the PreEmptive Analytics API for Microsoft .NET.

API Usage

The general usage is like so:

Message Queuing and Transmission

Messages are not immediately sent to the configured endpoint. The API queues messages and sends them when either a certain amount of time has elapsed or a number of messages have accumulated. On platforms where transmission may have performance impact, such as on mobile devices, the transmission of messages can be directly controlled by your program.

Message transmission is not guaranteed and messages may be lost. In cases of forced application shutdown or storage limitations the API may be unable to transmit queued messages or store them for off-line transmission. Messages may also be discarded if they overflow the API’s queue before they can be transmitted.

Off-line Storage

Your application is not required to always have network connectivity. You can configure the API to either always store the messages locally or to store them when contact with the configured endpoint is not possible. The API will automatically transmit these locally stored messages to the server when connectivity has been restored.

Multithreaded Use

The API supports requests from multiple threads. The API quickly handles the incoming requests and trys not to block the calling thread. The transmission of newly generated messages and stored messages takes place on background threads.

Interoperability

The API is designed with interoperability in mind. There are multiple platform specific implementations provided.

Example Usage

Simple .NET Example

Add a reference to PreEmptive.Analytics.Net.dll to your project.

using PreEmptive.Analytics.NET;
...
var paclient = new PAClient("5AA26668-E100-4AA8-8AD4-4F3814A402CC", "8ed00ac7-1427-49a5-8606-fc808d7732ec");
paclient.ApplicationStart();
paclient.FeatureTick("FromTheAPI");
paclient.ApplicationStop();

Special Configuration .NET Example

Add a reference to PreEmptive.Analytics.Common.dll and PreEmptive.Analytics.Net.dll to your project.

using PreEmptive.Analytics.Common;
using PreEmptive.Analytics.NET;
...
var paclient = new PAClient(new Configuration
{
ApplicationID = Guid.Parse("5AA26668-E100-4AA8-8AD4-4F3814A402CC"),
CompanyID = Guid.Parse("8ed00ac7-1427-49a5-8606-fc808d7732ec"),
UseSSL = false,
Endpoint = "mycustomendpoint:9090"
});
paclient.ApplicationStart();
paclient.FeatureTick("FromTheAPI");
paclient.ApplicationStop();

WinRT JavaScript Example

Add a reference to PreEmptive.Analytics.Common.dll and PreEmptive.Analytics.WinRT.winmd to your project. Note: You will also need to include the PreEmptive.Analytics.WindowsStore.dll assembly in the project.

var analytics = PreEmptive.Analytics.WinRT;
var configuration = new analytics.Configuration();
configuration.CompanyID = "21EC2020-CCCC-1069-A2DD-08002B30309D";
configuration.ApplicationID = "21EC2020-AAA1-1069-A2DD-08002B30309D";
var paclient = new analytics.PAClient(configuration);
paclient.applicationStart();
paclient.featureTick("FromTheAPI");
paclient.applicationStop();

WinRT C++ Example

Add a reference to PreEmptive.Analytics.Common.dll and PreEmptive.Analytics.WinRT.winmd to your project. Note: You will also need to include the PreEmptive.Analytics.WindowsStore.dll assembly in the project.

using namespace PreEmptive::Analytics::WinRT;
...
auto configuration = ref new Configuration();
configuration->CompanyID = "21EC2020-CCCC-1069-A2DD-08002B30309D";
configuration->ApplicationID = "21EC2020-AAA1-1069-A2DD-08002B30309D";
auto paclient = ref new PAClient(configuration);
paclient->ApplicationStart();
paclient->FeatureTick("FromTheAPI");
paclient->ApplicationStop();

Further Reading

Your copy of the PreEmptive Analtyics API should have came with a User Guide that can guide you through utilizing all of the available features and message types.