iOS

Implementation

In order to start working with Cooladata JavaScript SDK follow the steps below:

Step 1 – Add Cooladata SDK to your project

Make sure that you are using the latest version of Xcode (5.0+), and targeting iOS 7.0 or higher. Demo project for Swift and Objective C can be found in our github repository: https://github.com/cooladata/pod.
Choose one of the following options to add the SDK to your project:

Option 1: Download the latest iOS SDK and import it (drag the cooladata-ios-sdk-X.X.X.framework to the framework’s folder in your project and select “Copy items to destination’s group folder”).

Option 2: Use CocoaPods:

  1. Create the Podfile
    • If this is your first Pod in your iOS project, create a file named Podfile:
      platform :ios, '7.0'
      use_frameworks!
      
      target 'MyApp' do
      pod 'CoolaPod', '~> 2.0.7'
      end
    • If you already use CocoaPods in your project, add a reference to CoolaData ‘s Pod:
      pod 'CoolaPod', '~> 2.0.7'
  2. Open the terminal app, change dir to your xcode project and run:
    $ pod install

    This command creates an xcode workspace for your project, and configures it to use CocoaPods.

  3. From now on, make sure to always open the Xcode workspace instead of the project file when building your project.

Step 2 – Initialization

Add the following import to the top of the AppDelegate.m file.

#import <cooladata-ios-sdk/CoolaDataTracker.h>

Add the following code inside the application:didFinishLaunchingWithOptions function.

[[CoolaDataTracker getInstance] setupWithAppKey:@"aknek0zuo8i4ztcmgopn5wotsceg80m9"];

Note: The CoolaDataTracker is a singleton. Its reference can be obtained by calling the getInstance method: [CoolaDataTracker getInstance]. Creating the new instance of the CoolaDataTracker object manually will cause an error; therefore do not call [CoolaDataTracker alloc] init].

Step 3 – Track Events

After the Cooladata Tracker SDK is properly set up, you are ready to report events from your application. To start doing so, you need to call the trackEvent function with suitable parameters on every users’ action that you would like to track.

// set properties on a dictionary
NSDictionary *properies = @{@"Type" : @"Female",
                                @"Amount" : @2, @"{u}Email":@"sam@email.com"};
    
// track event with properties
[[CoolaDataTracker getInstance] trackEvent:@"Add Item" properties:properties];

Full API Reference

setupWithApiToken

This method used to initialize a new CoolaData tracker object. Should be called only once from the application:didFinishLaunchingWithOptions.

NameTypeMandatoryDescription
appKeyNSStringYesThe AppKey provided by CoolaData.
serviceEndPointNSStringNoThe base URL for the CoolaData Tracker to use when accessing the CoolaData gateway.
userIdNSStringYesThe User ID of the current user. Mandatory in the setupWithApiToken function, or in the trackEvent function. I.e. if the User ID provided in the setupWithApiToken, there's no need to send User ID in the trackEvent function, and vice versa.
sessionIdNSStringNoThe Session ID relevant for this instance of the CoolaDataTracker.

CoolaDataDeliveryResult

This object will be returned from the callback function and contains the following.
Parameters

NameTypeDescription
eventIdNSStringThe ID of the event as specified in the track event.
statusBOOLThe status of the delivery. False or True.
deliveryStatusDescriptionNSStringThe description of the status state.
deliveryStatusCodeIntThe HTTP error code of the delivery attempt.
responsePropertiesNSDictionaryCustom properties to be sent with the event result.

trackEvent

Track user’ event

NameTypeMandatoryDescription
eventNameNSStringYesThe name of the event to report. This parameter is mandatory.
withEventIdNSStringNoThe Event ID relevant for this event. This parameter is optional. If response block is passed, event id must also be provided.
userIdNSStringNoThe User ID relevant for this event. This parameter is optional only if provided in the setup method. You must provide the userId either in the setup method or in the trackEvent method.
sessionIdNSStringNoThe Session ID relevant for this event. This parameter is optional.
optionalDataNSStringNoThe custom properties to be sent with the event. This parameter is optional.
errorNSErrorNoA pointer to an NSError object. It will be populated with an error in case an immediate  error occurs (mandatory parameter was not provided). This parameter is optional.
responseBlockBlockNoWhen calling the track event method, you can pass a response block that will be called with the result/error objects upon receive. For this to happen you must also pass an event id. You can pass the same event id for multiple events. All the blocks related to that event id will be called upon receipt of the related results. This parameter is optional.

Print Friendly, PDF & Email

ActionScript

Setup

Download the SDK from: https://github.com/cooladata/cooladata-actionscript

 

Flash Development

  1. Add the cooladata-sdk-ac3-x.x.x.swc to the lib folder of your project.
  2. Right-click the file and choose “Add To Library”.

 

Adobe CS4 (and above)

  1. Save the cooladata-sdk-ac3-x.x.x.swc in a folder that is accessible to CS4.
  2. Go to the Publish Settings menu.
  3. Click on the Settings button.
  4. Click on the SWC file icon.
  5. Browse to the location of the cooladata-sdk-ac3-x.x.x.swc file.
  6. Select the cooladata-sdk-ac3-x.x.x.swc file.

In order to use CoolaDataTracker SDK for reporting events, it must be initialized first using the setup method:

CoolaDataTracker
 .getInstance()
 .setup(apiToken:String,serviceEndPoint:String,userId:String,sessionId:String);

Example:

CoolaDataTracker
 .getInstance()
 .setup("3r783b097dde47b592cd48697073b6dc" ,"https://api.cooladata.com" , "uid_12345","sid_12345");

 

Sending Events

After the Cooladata Tracker SDK is properly set up, you are ready to report events from your application. To start doing so, you need to call the trackEvent function with suitable parameters on every user’s action that you would like to track.

Example:

var paramsDictionary:Dictionary = new Dictionary();
paramsDictionary["paramName"] = "paramValue";
CoolaDataTracker.getInstance().trackEvent(eventNameTextInput.text, null, null, paramsDictionary, null, null);

 

Sending Event with Parameters:

var paramsDictionary:Dictionary = new Dictionary();

paramsDictionary["paramName"] = "paramValue";

CoolaDataTracker.getInstance().trackEvent(eventNameTextInput.text, null, null, paramsDictionary, null, null);

 

Parameters Descriptions:

Parameter NameTypeMandatoryDescription
eventNameStringYesThe name of the event to report.
userIdStringYesThe User ID relevant for this event. You must provide the userId either in the setup method or in the trackEvent method. This parameter is optional only if provided in the setup method.
sessionIdStringNoThe Session ID relevant for this event.
eventIdStringNoAn ID of the event.
dictionaryDictionaryNoThe custom properties to be sent with the event.
callBackFunctionBooleanNoA CoolaDataDeliveryResult type result that will be returned when the data is sent.

Print Friendly, PDF & Email

Google Tag Manager

Google Tag Manager (GTM) is a free and easy to use platform that allows you to manage CoolaData’s code snippets and firing of events without having to edit the code of your site or application.

Using GTM it is possible to go deeper. GTM offers Macros and Data Layer Objects that provide ways of listening to events (as opposed to simple pageviews) and registering their particular properties. However, this would require changes at the code level of your site. It is up to you to decide if it is not simpler, in these cases, to implement the CoolaData JavaScript SDK directly in your site, without GTM.

For more information on Google Tag Manager visit: https://www.google.com/analytics/tag-manager/ and https://support.google.com/tagmanager#topic=3441530.

This post will will walk you through configuring Cooladata JavaScript Tracker via Google Tag Manager.

 

Installing GTM

  1. Open Google Tag Manager
  2. If you haven’t yet, sign up for an account (free).
  3. Create a new Container: name your container (“Cooladata”), and choose Web as the type:
  4. You will be asked to add a code snippet to your site. Follow the instruction on screen to implement GTM on your site.

 

Creating the CoolaData Tracker Init tag

  1. Click “New Tag” to create the basic tracker tag.
  2. Select a tag type – “Custom HTML Tag”
  3. Paste the CoolaData JS Setup snippet (can be found in app.cooladata.com under Project – Event Source – JS) in the HTML section.
  4. Choose the trigger “All Pages”
  5. Name the tag: “Cooladata-tracker”
  6. Save the tag.

 

Creating custom event tags

  1. Create a new tag and select type – “Custom HTML Tag”.
  2. Paste the CoolaData JS Track Event snippet (can be found in app.cooladata.com under Project – Event Source – JS) in the HTML section. Enter the event name and properties you wish to track. For example:
    <script type="text/javascript">
      cooladata.trackEvent('Add Item', {
        'Type': 'T-Shirt',
        'Amount': 2,
        '{u}email':'sam@email.com'
      });
    </script>

  3. Create a new trigger according to the action you wish to track:
  4. Name the tag and save it:

 

Publishing tags

To publish your changes to production, name the new version and click Publish:

Print Friendly, PDF & Email

AppsFlyer

AppsFlyer provides a service for mobile campaign download attribution, allowing mobile app publishers to identify which downloads came from specific marketing and ad campaigns, and which are organic downloads. AppsFlyer has a unique method for user identification.

The AppsFlyer-CoolaData integration allows you to track activation, retention and other behavioral analyses and link them to the campaigns identified by AppsFlyer allowing you to optimize your campaigns by quality of customers via customer lifetime value (LTV) and virality scores as well as quantity of installs.

Example Business Questions:

  • Cohort by Users who did: Install and also did: Purchase, breakdown by Campaign Name
  • Path with pillar events: Install, Start Game, Invite Friend
  • Power KPI – track number of installs, number of active users
  1. AppsFlyer tracks downloads via the AppStore or Android Store, Google Play etc. – events that happen outside of network.
  2. AppsFlyer does unique user identification.
  3. CoolaData can combine events across an entire lifecycle of a customer from download through activation and ongoing use (retention).
  4. CoolaData does not do user identification, but needs a user ID.
  5. CoolaData uses the AppsFlyer ID as the unique user ID, saving implementers from managing and combining separate user IDs.

 

Setup

The integration uses a combination of standard and custom CoolaData properties. To ensure that AppsFlyer is able to send the user_id, the app developer must set the custom user ID in the app initialization stage.

  1. Log in to the AppsFlyer Dashboard
  2. Select the app you want
  3. Click on “Integrated Partners” in the Configuration menu:
  4. Search for CoolaData:
  5. In the first tab of the configuration window (“Integration parameters”) under token insert your CoolaData app key (found in Project-settings in CoolaData)
  6. Check the Enable checkbox
  7. Click Save & Close

After this initial setup, install events will be automatically sent to Cooladata.

IMPORTANT NOTE:

According to Facebook and Twitter T&C, Appsflyer are unable share user level data with any 3rd party. As a result, all Facebook and Twitter installs are sent to Cooladata as organic.

How it works

The main usage scenario is tracking the Install event, captured by AppsFlyer and sent to CoolaData. When the user installs the app, an AppsFlyer event is triggered to CoolaData, containing the properties listed in the JSON below as event properties:

{
    "user_id”: ”{custom_user_id}”,
    "event_timestamp_epoch": "{epoch_timestamp}",
    "event_name": "install",
    "media_source”: ”{media_source}",
    "campaign_name": "{campaign_name}",
    "appsflyer_id": "{appsflyer_id}",
    "session_ip":"{install_ip}",
    "session_dua":"{user-agent}",
    "session_app_id":"{application_name}",
    "build_version":"{application_build_version}"
}

Event Name: Install 

Properties:

  • event_name
  • user_id
  • appsflyer_id
  • event_timestamp_epoch
  • session_dua
  • session_app_id
  • session_ip
  • media_source
  • campaign_name
  • build_version

You can now start creating your widgets in CoolaData to use the events and properties sent by AppsFlyer.

 

 Sending in-app events

You could also postback Appsflyer in-app events to Cooladata. To set this up:

  1. In the integration configuration window go to the second tab: “In-App events”
  2.   Send In-App events to Cooladata – choose and make sure the token contains the Cooladata same app key:
  3. In the “In App Events Mapping” section – map the event names you want to send to Cooladata (“Cooladata events” column contains the event_name sent to Cooladata). Select “send value” if you also want to send the events custom properties along with the in-app events:
  4. Click on “save and close” to save the configurations. In app events are now sent to Cooladata and can be viewed in the “Live events” view.
Print Friendly, PDF & Email

Kochava

Kochava is a mobile measurement company that helps mobile app developers and advertisers analyze the effectiveness of marketing campaigns, by shedding light on what media advertising efforts are converting, and the effectiveness of their mobile ad spend.
Kochava’s platform allows developers to:

  • Track ad network agnostic conversion tracking.
  • Track app-specific feature tracking.
  • Provide push notifications (both programmatic and via rich-media push).

The Kochava platform provides out-of-the-box SDK, and is integrated with over 650 mobile ad networks, publishers, and exchanges.

 

Setup

Kochava’s integration with CoolaData allows mobile developers and advertisers to gain deeper insights of users through CoolaData’s advanced behavioral analytics. A simple wizard on the Kochava side enables a choice of what Kochava data to send to CoolaData for behavioral analytics.

KochavaCoolaData

The Kochava integration is illustrated in the following diagram:

How it works

When an ad is placed and then a user installs an app, an ‘Install’ event is sent back to Kochava to notify them of the event. On the Kochava side, an event is triggered to CoolaData, containing the properties listed in the JSON below as event properties:

{
    "user_id": "KD591de4ce53c12",
    "event_timestamp_epoch": 1495131342000,
    "event_name": "install",
    "media_source": "",
    "campaign_name": "",
    "customer_app_id": "koconversionsdemo174ea19bc63928c",
    "session_ip": "101.27.196.196",
    "session_dua": "Go-http-client/2.0",
    "session_app_id": "testapp123",
    "build_version": "testbuild123"
}

 

KochavaFlow

Print Friendly, PDF & Email