Basic methods
Please take a look at our Expert tips before integrating the events.

Tutorial steps

The Tutorial steps event allows you to evaluate the effectiveness of the tutorial steps system. The event should be sent at the end of each tutorial step indicating the number of every passed step as a parameter.
Use the following constants to specify basic events of tutorial steps:
iOS
Android
Windows 8.1 and 10
Web
Unity
Mac OS
Adobe Air
UE4
    Start or -1 - at the beginning, before the first step is completed;
    Finish or -2 - instead of the final step number;
    Skipped or 0 - in case а user skipped the tutorial.
    DevToDev.TutorialState.Start or -1 - at the beginning, before the first step is completed;
    DevToDev.TutorialState.Finish or -2 - instead of the last step number;
    DevToDev.TutorialState.Skipped or 0 - if a user skipped the tutorial.
    DevToDev.TutorialState.Start or -1 - at the beginning, before the first step is completed;
    DevToDev.TutorialState.Finish or -2 - instead of the last step number;
    DevToDev.TutorialState.Skipped or 0 - if a user skipped the tutorial.
    -1 - Start the tutorial (at the beginning, before the first step is completed)
    -2 - Tutorial finished (instead of the last step number)
    0 - Tutorial skipped (if a user skipped the tutorial).
    DevToDev.TutorialState.Start or -1 - at the beginning, before the first step is completed;
    DevToDev.TutorialState.Finish or -2 - instead of the last step number;
    DevToDev.TutorialState.Skipped or 0 - if a user skipped the tutorial.
    Start or -1 - at the beginning, before the first step is completed;
    Finish or -2 - instead of the final step number;
    Skipped or 0 - in case a user skipped the tutorial.
    TutorialState.START or -1 - at the beginning, before the first step is completed;
    TutorialState.FINISH or -2 - instead of the last step number;
    TutorialState.SKIPPED or 0 - if a user skipped the tutorial.
    -1 (Start) - at the beginning, before the first step is completed;
    -2 (Finish) - instead of the number of the last step;
    0 (Skipped) - in case a user skipped the tutorial.
In other cases use step numbers. Make sure you use numbers above 0 to enumerate the steps.
The logic of the use of the Skipped constant in the Tutorial steps event is provided only in case a user has completely refused to pass the tutorial. After Skipped is used, no other values of the Tutorial steps event must be received.
iOS
Android
Windows 8.1 and 10
Web
Unity
Mac OS
Adobe Air
UE4
1
/**
2
* The event allowing to track the stage of tutorial a player is on.
3
* @param NSUInteger tutorialStep - the latest successfully completed tutorial step.
4
*/
5
[DevToDev tutorialCompleted: (NSUInteger) tutorialStep];
Copied!
1
/**
2
* The event allowing to track the stage of tutorial a player is on.
3
* @param int tutorialStep - the latest successfully completed tutorial step.
4
*/
5
DevToDev.tutorialCompleted(int tutorialStep);
Copied!
1
/**
2
* <param name="state"> The latest successfully completed tutorial step </param>
3
*/
4
DevToDev.SDK.Tutorial(int state)
Copied!
1
/**
2
* The event allowing to track the stage of tutorial a player is on.
3
* @param {number} tutorialStep - the latest successfully completed tutorial step.
4
*/
5
devtodev.tutorialCompleted(tutorialStep);
Copied!
1
/// <summary> The event allowing to track the stage of tutorial a player is on. </summary>
2
/// <param name="tutorialStep"> The latest successfully completed tutorial step </param>
3
DevToDev.Analytics.Tutorial(int tutorialStep);
Copied!
1
/**
2
* The event allowing to track the stage of tutorial a player is on.
3
* @param NSUInteger tutorialStep - the latest successfully completed tutorial step.
4
*/
5
[DevToDev tutorialCompleted: (NSUInteger) tutorialStep];
Copied!
1
/**
2
* The event allowing to track the stage of tutorial a player is on.
3
* @param tutorialStep - the latest successfully completed tutorial step.
4
*/
5
DevToDev.tutorialCompleted(tutorialStep:int);
Copied!
Blueprint
Field
Type
Description
Step
int32
The latest successfully completed tutorial step
Code
1
// The event allowing to track the stage of tutorial a player is on.
2
// int32 step - the latest successfully completed tutorial step.
3
4
UDevToDevBlueprintFunctionLibrary::TutorialCompleted(int32 step);
Copied!

Leveling up

You can analyze the distribution of the players over the levels. The event should be sent right after the player reached the next level. You can find more information on what is the right moment to use LevelUp event here.
iOS
Android
Windows 8.1 and 10
Web
Unity
Mac OS
Adobe Air
UE4
1
/**
2
* Player has reached a new level
3
* @param NSInteger level - level reached by the player.
4
*/
5
[DevToDev levelUp: (NSInteger) level];
Copied!
1
/**
2
* Player has reached a new level
3
* @param int level - level reached by the player.
4
*/
5
DevToDev.levelUp(int level);
Copied!
1
/**
2
* <param name="level"> Level reached by the player </param>
3
*/
4
DevToDev.SDK.Level(int level);
Copied!
1
/**
2
* Player has reached a new level
3
* @param {number} level - level reached by the player.
4
*/
5
6
devtodev.levelUp(level);
Copied!
1
/// <summary> Player has reached a new level </summary>
2
/// <param name="level"> Level reached by the player </param>
3
DevToDev.Analytics.LevelUp(int level);
Copied!
1
/**
2
* Player has reached a new level
3
* @param NSUInteger level - level reached by the player.
4
*/
5
[DevToDev levelUp: (NSUInteger) level];
Copied!
1
/**
2
* Player has reached a new level
3
* @param level - level reached by the player.
4
*/
5
DevToDev.levelUp(level:int);
Copied!

Blueprint

Field
Type
Description
Level
int32
level reached by the player
Code
1
// Player has reached a new level
2
// int32 level - level reached by the player.
3
4
UDevToDevBlueprintFunctionLibrary::LevelUp(int32 level);
Copied!
To track the average account balance of in-game currency by the end of each level, please provide the list of currency names and amounts.
iOS
Android
Windows 8.1 and 10
Web
Unity
Mac OS
Adobe Air
UE4
1
/**
2
* Player has reached a new level
3
* @param NSInteger level - level reached by the player.
4
* @param NSDictionary resources - dictionary with the currency names and amounts
5
*/
6
NSDictionary * resources = @{@"Currency name 1" : @100, @"Currency name 2" : @10};
7
[DevToDev levelUp: (NSUInteger) level withResources: withResources: (NSDictionary *) resources];
Copied!
1
/**
2
* @param int level - level reached by the player
3
* @param HashMap resources - hashmap with the currency names and amounts
4
*/
5
HashMap resources = new HashMap<String, Integer>();
6
resources.put("Currency name 1", 1000);
7
resources.put("Currency name 2", 10);
8
DevToDev.levelUp(level, resources);
Copied!
1
/**
2
* <param name="level"> Player level </param>
3
* <param name="resources">Dictionary with the currency names and amounts</param>
4
*/
5
Dictionary<string, int> resources = new Dictionary<string, int>();
6
resources.Add("Currency name 1", 1000);
7
resources.Add("Currency name 2", 10);
8
DevToDev.SDK.Level(level, resources);
Copied!
1
/**
2
* @param {number} level - player/character's "level"
3
* @param {Object} resources - Object with data about currencies. Optional.
4
* @param {Object[]} resources.balance - Account balance of in-game currency by the end of level. * Optional.
5
* @param {Object[]} resources.balance[].currency - Game currency name
6
* @param {Object[]} resources.balance[].amount - Game currency amount
7
* @param {Object[]} resources.earned - Game currency earned during the level. Optional.
8
* @param {Object[]} resources.earned[].currency - Game currency name
9
* @param {Object[]} resources.earned[].amount - Game currency amount
10
* @param {Object[]} resources.spent - Game currency amount spent during the level. Optional.
11
* @param {Object[]} resources.spent[].currency - Game currency name
12
* @param {Object[]} resources.spent[].amount - Game currency amount
13
* @param {Object[]} resources.bought - Game currency amount bought during the level. Optional.
14
* @param {Object[]} resources.bought[].currency - Game currency name
15
* @param {Object[]} resources.bought[].amount - Game currency amount
16
*/
17
18
devtodev.levelUp(level, resources);
Copied!
1
/// <summary> Player has reached a new level</summary>
2
/// <param name="level"> Player level </param>
3
/// <param name="resources"> Dictionary with the currency names and amounts </param>
4
/// <example>
5
///
6
/// Dictionary<string, int> resources = new Dictionary<string, int>();
7
/// resources.Add("Currency name 1", 1000);
8
/// resources.Add("Currency name 2", 10);
9
///
10
/// </example>
11
DevToDev.Analytics.LevelUp(level, resources);
Copied!
1
/**
2
* Player has reached a new level
3
* @param NSInteger level - level reached by the player.
4
* @param NSDictionary resources - dictionary with the currency names and amounts
5
*/
6
NSDictionary * resources = @{@"Currency name 1" : @100, @"Currency name 2" : @10};
7
[DevToDev levelUp: (NSUInteger) level withResources: withResources: (NSDictionary *) resources];
Copied!
1
/**
2
* Player has reached a new level
3
* @param level - level reached by the player.
4
* @param resources - dictionary with the currency names and amounts
5
*/
6
var resources: Dictionary = new Dictionary();
7
resources["Currency name 1"] = 1000;
8
resources["Currency name 2"] = 10;
9
DevToDev.levelUpWithResources(level:int, resources:Dictionary);
Copied!
Blueprint
Field
Type
Description
Level
int32
level reached by the player
1
// Player has reached a new level
2
// int32 level - level reached by the player.
3
// TArray<FAnalyticsEventAttr> Attributes - dictionary with the currency names and amounts
4
5
UDevToDevBlueprintFunctionLibrary::LevelUpWithAttributes(int32 level,
6
const TArray<FAnalyticsEventAttr>& Attributes);
Copied!
To track the average amount of in-game currency earned during a level, it is necessary to send a special event after each time an in-game account is replenished.
iOS
Android
Windows 8.1 and 10
Web
Unity
Mac OS
Adobe Air
UE4
1
/* *
2
* @param NSString * currencyName - currency name (max. 24 symbols)
3
* @param NSInteger amount - the amount an account has been credited with.
4
* @param AccrualType accrualType - the way the currency was obtained: earned or purchased
5
*/
6
[DevToDev currencyAccrual: (NSInteger) amount withCurrencyName: (nonnull NSString *) currencyName
7
andCurrencyType: (AccrualType) accrualType];
Copied!
1
/**
2
* @param String currencyName - currency name (max. 24 symbols)
3
* @param float currencyAmount - the amount an account has been credited with
4
* @param AccrualType accrualType - the way the currency was obtained: earned or purchased
5
*/
6
DevToDev.currencyAccrual(currencyName, currencyAmount, accrualType);
Copied!
1
/**
2
* <param name="currencyName">Currency name (max. 24 symbols)</param>
3
* <param name="currencyAmount ">The amount an account has been credited with</param>
4
* <param name="accrualType">The way the currency was obtained: earned or purchased</param>
5
*/
6
DevToDev.SDK.CurrencyAccrual(string currencyName, float currencyAmount, AccrualType accrualType);
Copied!
1
/// <param name="currencyName"> Currency name (max. 24 symbols) </param>
2
/// <param name="currencyAmount "> The amount an account has been credited with </param>
3
/// <param name="accrualType"> The way the currency was obtained: earned or purchased </param>
4
DevToDev.Analytics.CurrencyAccrual(int amount, string currencyName, AccrualType accrualType);
Copied!
1
/**
2
* @param NSString * currencyName - currency name (max. 24 symbols)
3
* @param float amount - the amount an account has been credited with.
4
* @param AccrualType accrualType - the way the currency was obtained: earned or purchased
5
*/
6
/* *
7
* @param NSString * currencyName - currency name (max. 24 symbols)
8
* @param NSInteger amount - the amount an account has been credited with.
9
* @param AccrualType accrualType - the way the currency was obtained: earned or purchased
10
*/
11
[DevToDev currencyAccrual: (NSInteger) amount withCurrencyName: (nonnull NSString *) currencyName
12
andCurrencyType: (AccrualType) accrualType];
Copied!
1
/**
2
* @param currencyName - currency name (max. 24 symbols)
3
* @param currencyAmount - the amount an account has been credited with
4
* @param accrualType - the way the currency was obtained: earned or purchased
5
*/
6
DevToDev.currencyAccrual(currencyName:String, currencyAmount:Number, accrualType:AccrualType);
Copied!

Blueprint

Field
Type
Description
Game Currency Type
FString
Currency name (max. 24 symbols)
Game Currency Amount
int32
The amount an account has been credited with.
accrualType
Enum
Can take one of following values: "Earned" or "Purchased"
Code
1
FAnalytics::Get().GetDefaultConfiguredProvider()->RecordCurrencyGiven(const FString& GameCurrencyType,
2
int GameCurrencyAmount,
3
const TArray<FAnalyticsEventAttribute>& EventAttrs);
Copied!
AccrualType can take one of the following values:
iOS
Android
Windows 8.1 and 10
Web
Unity
Mac OS
Adobe Air
UE4
1
typedef enum {
2
Earned,
3
Purchased
4
} AccrualType ;
Copied!
1
public enum AccrualType {
2
Earned,
3
Purchased
4
};
Copied!
1
public enum AccrualType {
2
Earned,
3
Purchased
4
};
Copied!
1
public enum AccrualType {
2
Earned,
3
Purchased
4
};
Copied!
1
typedef enum {
2
Earned,
3
Purchased
4
} AccrualType;
Copied!
1
AccrualType.EARNED;
2
AccrualType.PURCHASED;
Copied!

Payment

To track payments, add this event right after the platform confirms that a payment went through.
iOS
Android
Windows 8.1 and 10
Web
Unity
Mac OS
Adobe Air
UE4
1
/**
2
* Register transactions made through the platform's payment system.
3
*
4
* @param NSString * paymentId - transaction ID (max. 64 symbols)
5
* @param float inAppPrice - product price (in user's currency)
6
* @param NSString * inAppName - product name
7
* @param NSString * inAppCurrencyISOCode - transaction currency (ISO 4217 format)
8
*/
9
[DevToDev realPayment: (NSString *) transactionId withInAppPrice:(float) inAppPrice
10
andInAppName: (NSString *) inAppName andInAppCurrencyISOCode: (NSString *) inAppCurrencyISOCode];
Copied!
A unique order identifier is a value of a transactionIdentifier property in SKPaymentTransaction object inside the receipt of completed transaction.
devtodev server does not process transactions with previously used transaction IDs. Also, the server validates identifiers in appearance to avoid evident cheat transactions. To avoid adding cheat payments into reports completely, use devtodev anti-cheat service before creating a realPayment event.
1
/**
2
* Register transactions made through the platform's payment system.
3
*
4
* @param String paymentId - transaction ID (max. 64 symbols)
5
* @param float inAppPrice - product price (in user's currency)
6
* @param String inAppName - product name
7
* @param String inAppCurrencyISOCode - transaction currency
8
* (ISO 4217 format http://www.iso.org/iso/home/standards/currency_codes.htm Exapmle: "USD")
9
*/
10
DevToDev.realPayment(String paymentId, float inAppPrice, String inAppName,
11
String inAppCurrencyISOCode);
Copied!
How to find the transaction ID in GooglePlay transaction?
Find the INAPP_PURCHASE_DATA object In the JSON fields that are returned in the response data for a purchase order. A unique transaction identifier is the value of orderId property in INAPP_PURCHASE_DATA object. If the order is a test purchase made via the In-app Billing Sandbox, orderId property will be empty.
devtodev server does not process transactions with previously used transaction IDs. Also, the server validates the identifiers in appearance to avoid evident cheat transactions. To avoid completely the entering of cheat payments from GooglePlay in reports, use devtodev anticheat service before creating realPayment event.
1
/**
2
* Register transactions made through the platform's payment system.
3
* <param name="orderId"> Transaction id </param>
4
* <param name="price"> Product price (in user's currency) </param>
5
* <param name="productId"> Product id (product name) </param>
6
* <param name="currencyCode"> Transaction currency (ISO 4217 format)</param>
7
*/
8
DevToDev.SDK.RealPayment(string orderId, float price, string productId, string currencyCode)
Copied!
Example:
1
DevToDev.SDK.RealPayment("1836535032137741465" , 2.99f , "productId" , "USD" );
Copied!
1
/**
2
* Register transactions made through the platform's payment system.
3
*
4
* @param {string} transactionId - transaction ID
5
* @param {number} productPrice - product price (in user's currency)
6
* @param {string} productName - product name
7
* @param {string} transactionCurrencyISOCode - transaction currency (ISO 4217 format)
8
*/
9
10
devtodev.realPayment(transactionId, productPrice, productName, transactionCurrencyISOCode);
Copied!
Example:
1
devtodev.realPayment("12345", 9.99, "Currency pack 2", "USD");
Copied!
1
/// <summary> Register transactions made through the platform's payment system. </summary>
2
/// <param name="paymentId"> Transaction id </param>
3
/// <param name="inAppPrice"> Product price (in user's currency) </param>
4
/// <param name="inAppName"> Product id (product name) </param>
5
/// <param name="inAppCurrencyISOCode"> Transaction currency (ISO 4217 format)</param>
6
DevToDev.Analytics.RealPayment(string paymentId, float inAppPrice, string inAppName,
7
string inAppCurrencyISOCode);
Copied!
1
/**
2
* Register transactions made through the platform's payment system.
3
*
4
* @param NSString * paymentId - transaction ID
5
* @param float inAppPrice - product price (in user's currency)
6
* @param NSString * inAppName - product name
7
* @param NSString * inAppCurrencyISOCode - transaction currency (ISO 4217 format)
8
*/
9
[DevToDev realPayment: (NSString *) transactionId withInAppPrice:(float) inAppPrice
10
andInAppName: (NSString *) inAppName andInAppCurrencyISOCode: (NSString *) inAppCurrencyISOCode];
Copied!
1
/**
2
* Register transactions made through the platform's payment system.
3
* @param paymentId - transaction ID
4
* @param inAppPrice - product price (in user's currency)
5
* @param inAppName - product name
6
* @param inAppCurrencyISOCode - transaction currency (ISO 4217 format)
7
*/
8
DevToDev.realPayment(paymentId:String, inAppPrice:Number, inAppName:String,
9
inAppCurrencyISOCode:String);
Copied!
How to find the transaction ID in iTunes transaction?
Unique order identifier is a value of "transactionIdentifier" property in SKPaymentTransaction object inside the receipt of completed transaction.
How to find the transaction ID in GooglePlay transaction?
Find the INAPP_PURCHASE_DATA object In the JSON fields that are returned in the response data for a purchase order. A unique transaction identifier is the value of orderId property in INAPP_PURCHASE_DATA object. If the order is a test purchase made via the In-app Billing Sandbox, orderId property will be empty.
devtodev server does not process transactions with previously used transaction IDs. Also the server validates the identifiers in appearance, to avoid evident cheat transactions. To avoid the entering of cheat payments in reports completely, use devtodev anticheat service before creating realPayment event.
Blueprint
Field
type
Description
Transaction Id
FString
Unique transaction ID
In AppPrice
float
Product price (in user's currency)
In App Name
FString
Product name
In App Currency ISOCode
FString
Transaction currency (ISO 4217 format)
Code
1
// Register transactions made through the platform's payment system.
2
// FString transactionId - transaction ID
3
// float inAppPrice - product price (in user's currency)
4
// FString inAppName - product name
5
// FString inAppCurrencyISOCode - transaction currency (ISO 4217 format)
6
7
UDevToDevBlueprintFunctionLibrary::RealPayment(const FString& transactionId,
8
float inAppPrice,
9
const FString& inAppName,
10
const FString& inAppCurrencyISOCode);
Copied!

In-app purchases

To track expenditures of in-game currency and popularity of products, add this event right after the purchase.
iOS
Android
Windows 8.1 and 10
Web
Unity
Mac OS
Adobe Air
UE4
1
/**
2
* In-app purchase with a definite article ID.
3
*
4
* @param NSString purchaseId - unique purchase Id or name (max. 32 symbols)
5
* @param NSString purchaseType - purchase type or group (max. 96 symbols)
6
* @param NSInteger purchaseAmount - count of purchased goods
7
* @param NSInteger purchasePrice - cost of purchased goods (total cost -if several goods were purchased)
8
* @param NSString purchaseCurrency - currency name (max. 24 symbols)
9
*/
10
[DevToDev inAppPurchase: (NSString *) purchaseId withPurchaseType: (NSString *) purchaseType
11
andPurchaseAmount: (NSInteger) purchase Amount andPurchasePrice: (NSInteger) purchaseprice
12
andPurchaseCurrency: (NSString *) purchaseCurrency];
Copied!
In case a product is bought for several game currencies at once, it is necessary to make a dictionary that includes the names and amounts of the paid currencies.
1
NSMutableDictionary * resources = [[NSMutableDictionary alloc] init];
2
[resources setObject:@100 forKey:@"currency1"];
3
[resources setObject:@10 forKey:@"currency2"];
4
//...and so on...
5
6
[DevToDev inAppPurchase:(NSString )purchaseId withPurchaseType:(NSString )purchaseType
7
andPurchaseAmount:(NSInteger)purchaseAmount andResources: (NSDictionary *) resources];
Copied!
1
/**
2
* In-app purchase with a definite article ID.
3
*
4
* @param purchaseId - unique purchase Id or name (max. 32 symbols)
5
* @param purchaseType - purchase type or group (max. 96 symbols)
6
* @param purchaseAmount - count of purchased goods
7
* @param purchasePrice - cost of purchased goods (total cost - if several goods were purchased)
8
* @param purchaseCurrency - currency name (max. 24 symbols)
9
*/
10
DevToDev.inAppPurchase(String purchaseId, String purchaseType, int purchaseAmount,
11
int purchasePrice, String purchaseCurrency);
Copied!
In case a product was bought for several game currencies at once, it is necessary to make a hashmap that includes the names and amounts of the paid currencies.
1
HashMap resources = new HashMap();
2
resources.put("currency_1", 120);
3
resources.put("currency_2", 29);
Copied!
…and so on…
1
DevToDev.inAppPurchase(String purchaseId, String purchaseType, int purchaseAmount, HashMap resources);
Copied!
1
/**
2
* <param name="purchaseId"> Unique purchase ID or name (max. 32 symbols)</param>
3
* <param name="purchaseType"> Purchase type or group (max. 96 symbols)</param>
4
* <param name="purchaseAmount"> Number of purchased goods </param>
5
* <param name="purchasePrice"> Cost of purchased goods (total cost - if several goods were purchased)</param>
6
* <param name="purchasePriceCurrency"> Currency name (max. 24 symbols)</param>
7
*/
8
DevToDev.SDK.InAppPurchase(string purchaseId, string purchaseType, int purchaseAmount,
9
int purchasePrice, string purchasePriceCurrency)
Copied!
Example:
1
DevToDev.SDK.InAppPurchase("sword", "weapons", 1, 200, "coins");
Copied!
In case a product was bought for several game currencies at once, it is necessary to make a hashmap including the names and amounts of the paid currencies.
1
Dictionary<string, int> resources = new Dictionary<string, int>();
2
resources.Add("currency_1", 120);
3
resources.Add("currency_2", 29);
4
//...and so on...
5
6
DevToDev.SDK.InAppPurchase(string purchaseId, string purchaseType, int purchaseAmount,
7
Dictionary<string, int> resources);
Copied!
1
/**
2
* Tracks in-app purchases.
3
*
4
* @param {string} purchaseId - unique purchase Id or name (max. 32 symbols)
5
* @param {string} purchaseType - purchase type or group (max. 96 symbols)
6
* @param {number} purchaseAmount - count of purchased goods
7
* @param {Object[]} purchasePrice - array including the names and amounts of
8
* the paid currencies (total cost - if several goods were purchased)
9
* @param {string} purchasePrice[].currency - game currency name
10
* @param {number} purchasePrice[].amount - currency amount
11
*/
12
13
devtodev.inAppPurchase(purchaseId, purchaseType, purchaseAmount, purchasePrice);
Copied!
Example:
1
var purchasePrice = [
2
{
3
“currency” : "coins", //game currency name
4
“amount” : 1000 //game currency amount
5
},
6
{
7
“currency” : "gold", //game currency name
8
“amount” : 10 //game currency amount
9
}
10
];
11
12
devtodev.inAppPurchase(“cloak”, “clothes”, 1, purchasePrice);
Copied!
1
/// <summary> In-app purchase with a definite ID. </summary>
2
/// <param name="purchaseId"> Unique purchase ID or name (max. 32 symbols)</param>
3
/// <param name="purchaseType"> Purchase type or group (max. 96 symbols)</param>
4
/// <param name="purchaseAmount"> Number of purchased goods </param>
5
/// <param name="purchasePrice"> Cost of purchased goods (total cost - if several goods were purchased)</param>
6
/// <param name="purchasePriceCurrency"> Currency name (max. 24 symbols)</param>
7
DevToDev.Analytics.InAppPurchase(string purchaseId, string purchaseType, int purchaseAmount,
8
int purchasePrice, string purchaseCurrency);
Copied!
In case a product was bought for several game currencies at once, it is necessary to make a dictionary including the names and amounts of the paid currencies.
1
Dictionary<string, int> resources = new Dictionary<string, int>();
2
resources.Add("currency_1", 120);
3
resources.Add("currency_2", 29);
4
//...and so on...
5
6
DevToDev.Analytics.InAppPurchase(string purchaseId, string purchaseType, int purchaseAmount,
7
Dictionary<string, int> resources);
Copied!
1
/**
2
* In-app purchase with a definite article ID.
3
*
4
* @param purchaseId - unique purchase Id or name (max. 32 symbols)
5
* @param purchaseType - purchase type or group (max. 96 symbols)
6
* @param purchaseAmount - count of purchased goods
7
* @param purchasePrice - cost of purchased goods (total cost -if several goods were purchased)
8
* @param purchaseCurrency - currency name (max. 24 symbols)
9
*/
10
[DevToDev inAppPurchase: (NSString *) purchaseId withPurchaseType: (NSString *) purchaseType
11
andPurchaseAmount: (NSInteger) purchase Amount andPurchasePrice: (NSInteger) purchaseprice
12
andPurchaseCurrency: (NSString *) purchaseCurrency];
Copied!
In case a product was bought for several game currencies at once, it is necessary to make a dictionary including the names and amounts of the paid currencies.
1
NSMutableDictionary * resources = [[NSMutableDictionary alloc] init];
2
[resources setObject:@100 forKey:@"currency1"];
3
[resources setObject:@10 forKey:@"currency2"];
4
//...and so on...
5
6
[DevToDev inAppPurchase:(NSString )purchaseId withPurchaseType:(NSString )purchaseType
7
andPurchaseAmount:(NSInteger)purchaseAmount andResources: (NSDictionary *) resources];
Copied!
1
/**
2
* In-app purchase with a definite article ID.
3
* @param purchaseId - unique purchase Id or name (max. 32 symbols)
4
* @param purchaseType - purchase type or group (max. 96 symbols)
5
* @param purchaseAmount - count of purchased goods
6
* @param purchasePrice - cost of purchased goods (total cost - if several goods were purchased)
7
* @param purchaseCurrency - currency name (max. 24 symbols)
8
*/
9
DevToDev.inAppPurchase(purchaseId:String, purchaseType:String, purchaseAmount:int, purchasePrice:int,
10
purchaseCurrency:String);
Copied!
In case a product was bought for several game currencies at once, it is necessary to make a hashmap including the names and amounts of the paid currencies.
1
var resources: Dictionary = new Dictionary();
2
resources["currency_1"] = 120;
3
resources["currency_2"] = 29;
4
//...and so on...
5
6
DevToDev.inAppPurchaseWithResources(purchaseId:String, purchaseType:String, purchaseAmount:int,
7
resources:Dictionary);
Copied!
Blueprint
Notice! If the purchase is done by more than one currency, then the method should be called as many times as many currencies were used, but the amount of purchase should be set only in one of the times.
Use the method “Record Simple Item Purchase with Attributes” from Analytics Blueprint Library.
Field
Type
Description
Item Id
FString
Unique purchase Id or name (max. 32 symbols)
Item Quantity
int32
Count of purchased goods
Item Id field is the identifier of purchased item, Item Quantity is the amount of purchased item. Attributes array should contain the following obligatory information:
Field
Type
Description
purchaseType
FString
Purchase type or group (max. 96 symbols)
purchasePrice
int32
Cost of purchased goods (total cost -if several goods were purchased)
purchaseCurrency
FString
Currency name (max. 24 symbols)
Code
1
// In-app purchase with a definite article ID.
2
// FString ItemId - unique purchase Id or name (max. 32 symbols)
3
// int32 ItemQuantity - count of purchased goods
4
//
5
// FString purchaseType - purchase type or group (max. 96 symbols)
6
// int32 purchasePrice - cost of purchased goods (total cost -if several goods were purchased)
7
// FString purchaseCurrency - currency name (max. 24 symbols)
8
9
FAnalytics::Get().GetDefaultConfiguredProvider()->RecordItemPurchase(const FString& ItemId,
10
int ItemQuantity,
11
const TArray<FAnalyticsEventAttribute>& Attributes);
Copied!

Custom Events

If you want to count the events that are not among basic, use custom events.
The event must have a unique name and can include up to 20 parameters. The maximum length of the event name is 72 symbols.
Every parameter inside one event must have a unique name. The maximum length of the parameter name is 32 symbols.
The values of parameters can be string or number type (int, long, float, double). The maximum length of the parameter value is 255 symbols.
No more than 300 variants of custom event names can be used for one project. Try to enlarge events in meaning by using event parameters. Events that didn't get into the limit of unique event names will be discarded.
For a string parameter, it is acceptable to use not more than 50,000 unique values for the whole event history. In case the limit of unique values is exceeded, the parameter is ignored.
Therefore, we recommend not to set user IDs and Unix time as parameter values of custom events. Try to integrate parameter values if they have a very large variability. Otherwise, it will be very difficult to analyze the data or after some time it may be even ignored.
We strongly recommend not to change the type of data transferred in the parameter over time. In case you change the data type in parameter, it will be duplicated with the same name and different data types in devtodev database which will result in more complicated report building.
iOS
Android
Windows 8.1 and 10
Web
Unity
Mac OS
Adobe Air
UE4
1
/**
2
* @param NSString eventName - event name
3
*/
4
[DevToDev customEvent: (NSString *) eventName];
Copied!
20 parameter names may be associated with any event:
1
CustomEventParams * params_1 = [[CustomEventParams alloc] init];
2
[params_1 putParam:@"double" withDouble:123.1231231231231];
3
[params_1 putParam