Getting started

Jump to: navigation, search

Step 1: Basic setup in 5 minutes

You can gain deep insight into your customer's behaviour very quickly and with little effort using HoneyTracks analytics service.

[edit]

Config config = new Config();
config.ApiKey = "YOUR_API_KEY";
config.Language = "USERS_LANGUAGE";
config.Space = "Default";
config.UniqueCustomerIdentifier = "USERS_UNIQUE_ID";
 
Tracking ht = Tracking.Create(config);
ht.TrackLogin();
ht.Commit();

Warning:

Our C# SDK is made for mobile games and is not threadsafe.

Currently the C#-SDK has to create an own instance for each single user and the events itself have to be committed with ht.Commit() at least after a request was executed successful (web applications) or after each event block (mobile applications).

 HoneyTracks_Tracker_Library::Factory(array( 
 'ApiKey' => 'YOUR_API_KEY',
 'SecretKey' => 'YOUR_SECRET_KEY', 
 'Language' => 'USERS_LANGUAGE', 
 'Space' => 'Default', 
 'UniqueCustomerIdentifier' => 'USERS_UNIQUE_ID'))->TrackLogin();

Important: Please ensure that you send all data UTF-8 encoded, otherwise our tracking servers may reject or ignore your data.


To avoid connectivity issues between your servers and the HoneyTracks tracking servers we offer for the PHP-SDK a backup path for storing the events locally if it was not possible to send the events to the tracking servers:

HoneyTracks_Tracker_Library::Factory()->setFailedTransportStoragePath("/var/spool/HoneyTracks/");

Important: Please ensure that the path is writable and that you implement a cron job which is executed every minute and executes the following script HoneyTracks_FailedPackagesSender.php.

For privacy reasons our PHP SDK offers also specific methods to avoid sending tracking events to our servers:

SDK Privacy methods

TrackingConfig config = new TrackingConfig();
config.setApiKey("YOUR_API_KEY");
config.setSecretKey("USERS_LANGUAGE");
config.setSpace("Default");
config.setLanguage("USERS_LANGUAGE");
config.setEnabled(true);
 
HoneyTracking ht = TrackingFactory.createFor("USER_UNIQUE_ID", "USER_IP_ADDRESS", config);
ht.trackLogin();
 
TrackingEvents events = ht.getEvents();
TrackingTransport.of(config).commit(events);

To ensure that our high availability process is working well for you set your Java virtual machine DNS caching to a maximum TTL of 300 seconds (networkaddress.cache.ttl=300).

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 <html>
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
     <title>HoneyTracks javascript library example</title>
     <script type="text/javascript">
       var _HoneyTracksSDKConfig = _HoneyTracksSDKConfig || {
       _ApiKey: 'YOUR_API_KEY',
       _ApiConnectorUrl:  (document.location.protocol == 'https:'?'https://tracker':'http://tracker') + '.honeytracks.com/?ApiKey=%1$s',
       Language: 'USERS_LANGUAGE',
       Space: 'Default',
       UniqueCustomerIdentifier: 'USER_UNIQUE_ID'
       }, _HoneyTracksTracking = [];
     </script>
   </head>
 
   <body>
     <script type="text/javascript">
       _HoneyTracksTracking.push(function () {
         HoneyTracks_Tracker_Library.TrackLogin();
       });
     </script>
 
     <!-- At the end of the document -->
     <script type="text/javascript">
       (function () {
         var htt = document.createElement('script');
         htt.type = 'text/javascript';htt.async = true;
         htt.src = (document.location.protocol == 'https:'?'https://tracker':'http://tracker') 
                 + '.honeytracks.com/Api/Javascript/v1.4/HoneyTracks_Tracker_Library.js';
         var s = document.getElementsByTagName('script')[0];
         s.parentNode.insertBefore(htt, s);
       })();
     </script>
   </body>
 </html>

import com.honeyTracks.HoneyTracks;
 
 var honeyTracks:HoneyTracks.getInstance();
 var parameters:Object={
     ApiKey:"YOUR_API_KEY", 
     Language:"USERS_LANGUAGE", 
     Space:"default", 
     Version:"1.0", 
     UniqueCustomerIdentifier:"USER_UNIQUE_ID" 
 };
 honeyTracks.setUp(parameters);
 
 //Tracking methods 
 honeyTracks.trackLogin();

iOS 5

    #import "HTITracker.h"
 
    @synthesize tracker;
 
    - (void)applicationDidFinishLaunching:(UIApplication *)application 
    {
        HTIConfig *config = [[HTIConfig alloc] init];
        config.ApiKey = @"YOUR_API_KEY";
        config.SecretKey = @"YOUR_SECRET_KEY";
        config.Language = @"USERS_LANGUAGE";
        config.Space = @"Default";
        config.Version = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"];
        config.UniqueCustomerIdentifier = @"USERS_UNIQUE_ID";
 
        tracker = [HTITracker trackerWithConfig:config];
        [tracker login];
        /**
          * events are automatically committed to tracking servers as soon as there
          * are more than 9 enqueued, to force immediately commit use [tracker commit];
          * keep in mind that enqueuing events will save network and battery capacities.
          **/
        [tracker commit];
    }

For all other programming languages for which we don't offer an own SDK you are able to use simple HTTP-POST-Requests:

POST /?ApiKey=YOUR_API_KEY HTTP/1.1
Host: tracker.honeytracks.com
 
Packets[0][ApiKey]=YOUR_API_KEY&Packets[0][Language]=USERS_LANGUAGE&Packets[0][ClientIP]=USERS_IP_ADDRESS&
Packets[0][Space]=Default&Packets[0][UniqueCustomerIdentifier]=USER_UNIQUE_ID&Packets[0][Action]=User%3A%3ALogin
$ curl http://tracker.honeytracks.com/?ApiKey=$YOUR_API_KEY --data "\
Packets[0][ApiKey]=$YOUR_API_KEY&\
Packets[0][Language]=$USERS_LANGUAGE&\
Packets[0][ClientIP]=$USERS_IP_ADDRESS&\
Packets[0][UniqueCustomerIdentifier]=$USER_UNIQUE_ID&\
Packets[0][Space]=Default&\
Packets[0][Action]=User::Login"

Important: Please ensure that you send all data UTF-8 encoded, otherwise our tracking servers may reject or ignore your data.

The HoneyTracks Unity SDK supports only C# as a scripting language

Step 1: Basic setup in 5 minutes

The HoneyTracks Unity SDK needs to be imported into Unity first:

(Click pictures for bigger version)

1 Importing the SDK

1. Importing HoneyTracks SDK.png

2 Setting the API Key in HoneyTracksConfig.prefab

2. Setting API key in HoneyTracksConfig.prefab.png

3 Choosing script files to add tracking calls

3. Choosing script files to add tracking calls.png

4 Implement tracking code to desired position

https://docs.honeytracks.com/images/d/d7/4._Implement_tracking_code_to_desired_position.png


Step 2: Validate incoming events

We offer the possibility to see the newest received and processed events within our event live monitor, after implementing the first event go to Settings -> Products -> Event logto have a look if the data was processed successfully.

Step 3: Implement more tracking methods...

We recommend to implement as much as possible of our additional tracking methods to get the full insights, you should also have a deeper look to the following tracking methods: