Резюме #
The below documentation describes the Unity SDK for Tenjin. To learn more about Tenjin and our product offering, please visit https://www.tenjin.com.
- Пожалуйста, ознакомьтесь с нашим Примечания к выпуску чтобы увидеть подробную историю изменений.
- Tenjin Unity SDK supports both iOS and Android.
- Review the [iOS][1] and [Android][2] documentation and apply the proper platform settings to your builds.
- По всем вопросам и за поддержкой обращайтесь по адресу: support@tenjin.com.
If you are using Unity SDK v1.12.29 or lower, please follow these steps before completing the SDK integration.
To upgrade to v.1.12.30 or higher from lower versions, please ensure to remove the Tenjin binaries before installing the latest Unity version.
If you get this error when compiling on iOS: Library not loaded: @rpath/TenjinSDK.framework/TenjinSDK you need to go to “Frameworks, Libraries and Embedded Content” and add TenjinSDK, then select ‘Embed & Sign’
If you have libTenjinSDK.a and/or libTenjinSDKUniversal.a from older Tenjin SDK versions, please delete them and run pod install to integrate it on iOS
SDK Integration #
- Download the latest Unity SDK from здесь.
- Import the
TenjinUnityPackage.unitypackageinto your project:Assets -> Import Package.
Google Play #
По умолчанию, неуточненный является магазином приложений по умолчанию. Обновите значение магазина приложений до googleplay, if you distribute your app on Google Play Store.
Set your App Store Type value to googleplay:
BaseTenjin instance = Тендзин.getInstance(" ");
instance.SetAppStoreType(AppStoreType.googleplay);Tenjin SDK требует следующих разрешений:
android:имя="android.permission.INTERNET" />
android:имя="android.permission.ACCESS_NETWORK_STATE" /> Google Play Services requires all API level 32 (Android 13) apps using the advertising_id(Android Advertising ID (AAID)) to declare the Google Play Services AD_ID permission (shown below) in their manifest file. You are required to update the tenjin-android-sdk to version 1.12.8 in order to use the below permission.
android:name="com.google.android.gms.permission.AD_ID"/> Рекламный идентификатор Android (AAID) и реферер установки #
Добавить Рекламный идентификатор Android (AAID) и Установить реферер библиотеки, добавьте его в файл build.gradle.
dependencies {
implementation 'com.google.android.gms:play-services-ads-identifier:{version}'
implementation 'com.android.installreferrer:installreferrer:{version}'
}Чтобы иметь возможность собирать Meta's Install Referrer, add these queries to your Android Manifest:
<queries>
android:name="com.facebook.katana" />
<package android:name="com.instagram.android" />
Next, add the following to your strings.xml file (you can create this template file for storing the the string value based on this guide):
имя="facebook_app_id" translatable="false">YOUR_META_APP_ID Amazon store #
По умолчанию, неуточненный является магазином приложений по умолчанию. Обновите значение магазина приложений до amazon, if you distribute your app on Amazon store.
Set your App Store Type value to amazon:
BaseTenjin instance = Тендзин.getInstance(" ");
instance.SetAppStoreType(AppStoreType.amazon);OAID and other Android App Stores #
Tenjin поддерживает продвижение вашего приложения в других магазинах приложений Android с помощью Android OAID. У нас есть следующие требования для интеграции библиотек OAID. If you plan to release your app outside of Google Play, make sure to implement these OAID libraries.
MSA OAID #
MSA OAID - это рекламный идентификатор для устройств, произведенных в Китае, который предоставляет MSA (Mobile Security Alliance). Для интеграции с Библиотека MSA, Загрузите следующее oaid\_sdk\_1.0.25.aar.
Place the oaid_sdk_1.0.25.aar file in your project’s Android libs directory: /Assets/Plugins/Android
Set your App Store Type value to другие:
BaseTenjin instance = Тендзин.getInstance(" ");
instance.SetAppStoreType(AppStoreType.другие);Huawei OAID #
Если вы находитесь за пределами Китая, вы можете собирать OAID с помощью библиотеки, предоставленной компанией Huawei. Для интеграции с Библиотека Huawei OAID, download the following Huawei AAR file: huawei-ads-identifier.aar. If your app is in the Галерея приложений Huawei, download and add the Huawei Install Referrer file: huawei-ads-installreferrer.aar.
Place the Huawei files in your project’s Android libs directory: /Assets/Plugins/Android
Set your App Store Type value to другие:
BaseTenjin instance = Тендзин.getInstance(" ");
instance.SetAppStoreType(AppStoreType.другие);Настройки Proguard #
-keep class com.tenjin.** { *; }
-keep public class com.google.android.gms.ads.identifier.** { *; }
-keep public class com.google.android.gms.common.** { *; }
-keep public class com.android.installreferrer.** { *; }
-keep class * extends java.util.ListResourceBundle {
protected java.lang.Object[][] getContents();
}
-keepattributes *Annotation*If you are using Huawei libraries, you can to use these settings:
-keep class com.huawei.hms.ads.** { *; }
-keep interface com.huawei.hms.ads.** { *; }Инициализация приложения #
- Получите свой
SDK_KEYсо страницы вашего приложения. Примечание:SDK_KEYуникален для каждого вашего приложения. Вы можете создать до 3 ключей для одного приложения.

- In your project’s first
Start()method, add the following line of code. Also add toOnApplicationPause()if you want to send sessions data when a user resumes using the app from the background.
using UnityEngine;
using System.Collections;
public class TenjinExampleScript : MonoBehaviour {
void Start() {
TenjinConnect();
}
void OnApplicationPause(bool pauseStatus) {
if (!pauseStatus) {
TenjinConnect();
}
}
public void TenjinConnect() {
BaseTenjin instance = Тендзин.getInstance(" ");
// Sends install/open event to Tenjin
instance.Connect();
}
}ПРИМЕЧАНИЕ: Пожалуйста, убедитесь, что вы внедрили этот код в каждый Start() и OnApplicationPause(), Не только при первом открытии приложения.
App Store #
We support three app store options,
- googleplay
- amazon
- другие
По умолчанию, неуточненный is the default App Store. If you are publishing in a specific App Store, update the app store value to the appropriate app store value. The app store value другие is used for Huawei AppGallery and other app stores:
AndroidManifest.xml:
android:name="TENJIN_APP_STORE"
android:value="{{SET_APP_STORE_TYPE_VALUE}}" />SetAppStoreType():
BaseTenjin instance = Тендзин.getInstance(" ");
instance.SetAppStoreType(AppStoreType.{{SET_APP_STORE_TYPE_VALUE}});ATTrackingManager (iOS) #
- Starting with iOS 14, you have the option to show the initial
- If the device doesn’t accept tracking permission, IDFA will become zero. If the device accepts tracking permission, the
Connect()method will send the IDFA to our servers. - You can also still call Tenjin
connect(), without using ATTrackingManager. You can choose not to implement ATT if you don’t intend to access or pass the IDFA for any users to Tenjin.
using UnityEngine;
using System.Collections;
using UnityEngine.iOS;
public class TenjinExampleScript : MonoBehaviour {
void Start() {
TenjinConnect();
}
void OnApplicationPause(bool pauseStatus) {
if (!pauseStatus) {
TenjinConnect();
}
}
public void TenjinConnect() {
BaseTenjin instance = Тендзин.getInstance("SDK_KEY");
#if UNITY_IOS
if (new Version(Device.systemVersion).CompareTo(new Version("14.0")) >= 0) {
// Tenjin wrapper for requestTrackingAuthorization
instance.RequestTrackingAuthorizationWithCompletionHandler((status) => {
Debug.Log("===> App Tracking Transparency Authorization Status: " + status);
// Sends install/open event to Tenjin
instance.Connect();
});
}
else {
instance.Connect();
}
#elif UNITY_ANDROID
// Sends install/open event to Tenjin
instance.Connect();
#endif
}
}Displaying an ATT permission prompt #
To comply with Apple’s ATT guidelines, you must provide a description for the ATT permission prompt, then implement the permission request in your application.
> Note: You must implement the permission request before serving ads in your game.
Configuring a user tracking description #
Apple requires a description for the ATT permission prompt. You need to set the description with the NSUserTrackingUsageDescription key in the Info.plist file of your Xcode project. You have to provide a message that informs the user why you are requesting permission to use device tracking data:
- In your Xcode project navigator, open the
Info.plistfile. - Click the add button (+) beside any key in the property list editor to create a new property key.
- Enter the key name
NSUserTrackingUsageDescription. - Select a string value type.
- Enter the app tracking transparency message in the value field. Some examples include:
- “We will use your data to provide a better and personalized ad experience.”
- “We try to show ads for apps and products that will be most interesting to you based on the apps you use, the device you are on, and the country you are in.”
- “We try to show ads for apps and products that will be most interesting to you based on the apps you use.”
> Note: Apple provides specific [app store guidelines][30] that define acceptable use and messaging for all end-user facing privacy-related features. Tenjin does not provide legal advice. Therefore, the information on this page is not a substitute for seeking your own legal counsel to determine the legal requirements of your business and processes, and how to address them.
SKAdNetwork and Conversion Values #
As part of SKAdNetwork, we created wrapper method for updatePostbackConversionValue(_:). Our method will register the equivalent SKAdNetwork methods and also send the conversion values to our servers.
updatePostbackConversionValue(_:) 6 bit value should correspond to the in-app event and shouldn’t be entered as binary representation but 0-63 integer. Our server will reject any invalid values.
As of iOS 16.1, which supports SKAdNetwork 4.0, you can now send coarseValue (String, with possible variants being “low”, “medium” or “high”) and lockWindow (Boolean) as parameters on the update postback method:
updatePostbackConversionValue(conversionValue: Integer, coarseValue: String)
updatePostbackConversionValue(conversionValue: Integer, coarseValue: String, lockWindow: Bool)
- For iOS version 16.1+ which supports SKAdNetwork 4.0, you can call this method as many times as you want and can make the conversion value lower or higher than the previous value.
- For iOS versions lower than 16.1 supporting SKAdnetWork versions lower than 4.0, you can call this method and our SDK will automatically detect the iOS version and update
conversionValueonly.
using UnityEngine;
using System.Collections;
public class TenjinExampleScript : MonoBehaviour {
void Start() {
TenjinConnect();
}
void OnApplicationPause(bool pauseStatus) {
if (!pauseStatus) {
TenjinConnect();
}
}
public void TenjinConnect() {
BaseTenjin instance = Тендзин.getInstance("SDK_KEY");
#if UNITY_IOS
// Sends install/open event to Tenjin
instance.Connect();
// Sets SKAdNetwork Conversion Value
// You will need to use a value between 0-63
instance.updatePostbackConversionValue(<Integer between 0 и 63>);
// For iOS 16.1+ (SKAN 4.0)
instance.updatePostbackConversionValue(<Integer between 0 и 63>, "medium");
instance.updatePostbackConversionValue(<Integer between 0 и 63>, "medium", true);
#elif UNITY_ANDROID
// Sends install/open event to Tenjin
instance.Connect();
#endif
}
}SKAdNetwork and iOS 15+ Advertiser Postbacks #
To specify Tenjin as the destination for your [SK Ad Network postbacks][31], do the following:
- Select
Info.plistin the Project navigator in Xcode. - Click the Add button (+) beside a key in the property list editor and press Return.
- Type the key name
NSAdvertisingAttributionReportEndpoint. - Choose String from the pop-up menu in the Type column.
- Enter
https://tenjin-skan.com
These steps are adapted from Apple’s instructions at [https://developer.apple.com/documentation/storekit/skadnetwork/configuring\_an\_advertised\_app][32].
GDPR #
В соответствии с требованиями GDPR, с помощью SDK Tenjin вы можете отказаться от использования устройств/пользователей или выбрать, какие именно параметры, связанные с устройством, следует включить или исключить. OptOut() не будет отправлять никаких API-запросов в Tenjin, и мы не будем обрабатывать никаких событий.
Чтобы отказаться от участия/отказаться от участия:
void Start () {
BaseTenjin instance = Тендзин.getInstance("SDK_KEY");
boolean userOptIn = CheckOptInValue();
if (userOptIn) {
instance.OptIn();
}
else {
instance.OptOut();
}
instance.Connect();
}
boolean CheckOptInValue()
{
// check opt-in value
// return true; // if user opted-in
return false;
}- To opt-in/opt-out specific device-related parameters, you can use the
OptInParams()илиOptOutParams(). OptInParams()будет отправлять только те параметры устройства, которые указаны.OptOutParams()отправит все параметры, связанные с устройством, кроме тех, которые указаны.- Kindly note that we require the following parameters to properly track devices in Tenjin’s system. If one of these mandatory parameters is missing, the event will not be processed or recorded.
- For Android,
рекламный идентификатор- For iOS
developer_device_id- If you are targeting IMEI and/or OAID Ad Networks for Android, add:
imeiоаид- If you intend to use Google Ad Words, you will also need to add:
платформаos_versionверсия приложениялокальмодель устройстваbuild_idрекламный идентификаторdeveloper_device_id(for iOS)
Если вы хотите получить только определенные параметры, связанные с устройством, используйте OptInParams(). В примере ниже мы рассмотрим только эти параметры, связанные с устройством: ip_адрес, рекламный идентификатор, developer_device_id, limit_ad_tracking, реферер, и iad:
BaseTenjin instance = Тендзин.getInstance("SDK_KEY");
List<string> optInParams = new List<string> {"ip_адрес", "рекламный идентификатор", "developer_device_id", "limit_ad_tracking", "реферер", "iad"};
instance.OptInParams(optInParams);
instance.Connect();Если вы хотите отправить ВСЕ параметры, кроме определенных параметров, связанных с устройством, используйте OptOutParams(). В приведенном ниже примере мы отправим ВСЕ параметры, связанные с устройством, кроме: локаль, timezone, и build_id параметры.
BaseTenjin instance = Тендзин.getInstance("SDK_KEY");
List<string> optOutParams = new List<string> {"локаль", "timezone", "build_id"};
instance.OptOutParams(optOutParams);
instance.Connect();Включение/выключение с помощью CMP #
Вы можете автоматически отказаться от участия или отказаться от участия, используя свои согласия CMP (цель 1), которые уже сохранены в устройстве пользователя. Метод возвращает булево значение, чтобы сообщить вам о том, был ли пользователь согласен или нет.
OptInOutUsingCMP()
BaseTenjin instance = Тендзин.getInstance(" ");
optInOut = instance.OptInOutUsingCMP(); Параметры, связанные с устройством #
| Param | Description | Platform | Reference |
|---|---|---|---|
| ip\_address | IP Address | All | |
| advertising\_id | Device Advertising ID | All | [Android][34], [iOS][35] |
| developer\_device\_id | ID for Vendor | iOS | [iOS][36] |
| оаид | Open Advertising ID | Android | [Android][37] |
| imei | Device IMEI | Android | [Android][38] |
| limit\_ad\_tracking | limit ad tracking enabled | All | [Android][39], [iOS][40] |
| платформа | платформа | All | iOS or Android |
| реферер | Google Play Install Referrer | Android | [Android][41] |
| iad | Apple Search Ad parameters | iOS | [iOS][42] |
| os\_version | operating system version | All | [Android][43], [iOS][44] |
| device | device name | All | [Android][45], [iOS (hw.machine)][46] |
| device\_manufacturer | device manufactuer | Android | [Android][47] |
| device\_model | device model | All | [Android][48], [iOS (hw.model)][49] |
| device\_brand | device brand | Android | [Android][50] |
| device\_product | device product | Android | [Android][51] |
| device\_model\_name | device machine | iOS | [iOS (hw.model)][52] |
| device\_cpu | device cpu name | iOS | [iOS (hw.cputype)][53] |
| carrier | phone carrier | Android | [Android][54] |
| connection\_type | cellular or wifi | Android | [Android][55] |
| screen\_width | device screen width | Android | [Android][56] |
| screen\_height | device screen height | Android | [Android][57] |
| os\_version\_release | operating system version | All | [Android][58], [iOS][59] |
| build\_id | build ID | All | [Android][60], [iOS (kern.osversion)][61] |
| локаль | device locale | All | [Android][62], [iOS][63] |
| country | locale country | All | [Android][64], [iOS][65] |
| timezone | timezone | All | [Android][66], [iOS][67] |
События покупки #
iOS IAP Validation #
iOS receipt validation requires transactionId и receipt (signature will be set to null). For receipt, be sure to send the receipt Payload(the base64 encoded ASN.1 receipt) from Unity.
ВАЖНО: If you have subscription IAP, you will need to add your app’s public key in the Приборная панель Тендзина. You can retrieve your iOS App-Specific Shared Secret from the iTunes Connect Console \> Select your app \> App Information \> App-Specific Shared Secret.
Android IAP Validation #
Google Play App Store
Google Play receipt validation requires receipt и signature are required (transactionId is set to null).
ВАЖНО: Вам нужно будет добавить открытый ключ вашего приложения в Приборная панель Тендзина (на странице редактирования приложения). Вы можете получить свой открытый ключ RSA в Base64-кодировке из файла Консоль разработчика Google Play \> Выберите приложение > Монетизация > Настройка монетизации > Биллинг Google Play > Лицензирование: Открытый ключ RSA в кодировке Base64. Обратите внимание, что для Android мы в настоящее время поддерживаем только IAP-транзакции из Google Play.
(NOTE) For Google Play, Please ensure to ‘acknowledge’ the purchase event before sending it to Tenjin. For more details, read здесь
Amazon AppStore
Проверка квитанции в Amazon AppStore требует receiptId и userId параметры.
ВАЖНО: Вам нужно будет добавить общий ключ приложения Amazon в Приборная панель Тендзина. Общий секрет можно найти в Shared Key в вашей учетной записи разработчика с помощью Учетная запись Amazon Appstore
iOS and Android IAP Example #
In the example below, we are using the widely used MiniJSON library for JSON deserializing.
public static void OnProcessPurchase(PurchaseEventArgs purchaseEventArgs) {
var price = purchaseEventArgs.purchasedProduct.metadata.localizedPrice;
double lPrice = decimal.ToDouble(price);
var currencyCode = purchaseEventArgs.purchasedProduct.metadata.isoCurrencyCode;
var wrapper = Json.Deserialize(purchaseEventArgs.purchasedProduct.receipt) as Dictionary<string, object>; // https://gist.github.com/darktable/1411710
if (null == wrapper) {
return;
}
var store = (string)wrapper["Store"]; // GooglePlay, AmazonAppStore, AppleAppStore, etc.
var payload = (string)wrapper["Payload"]; // For Apple this will be the base64 encoded ASN.1 receipt. For Android, it is the raw JSON receipt.
var productId = purchaseEventArgs.purchasedProduct.definition.id;
#if UNITY_ANDROID
if (store.Equals("GooglePlay")) {
var googleDetails = Json.Deserialize(payload) as Dictionary<string, object>;
var googleJson = (string)googleDetails["json"];
var googleSig = (string)googleDetails["signature"];
CompletedAndroidPurchase(productId, currencyCode, 1, lPrice, googleJson, googleSig);
}
if (store.Equals("AmazonApps")) {
var amazonDetails = Json.Deserialize(payload) as Dictionary<string, object>;
var amazonReceiptId = (string)amazonDetails["receiptId"];
var amazonUserId = (string)amazonDetails["userId"];
CompletedAmazonPurchase(productId, currencyCode, 1, lPrice, amazonReceiptId, amazonUserId);
}
#elif UNITY_IOS
var transactionId = purchaseEventArgs.purchasedProduct.transactionID;
CompletedIosPurchase(productId, currencyCode, 1, lPrice , transactionId, payload);
#endif
}
private static void CompletedAndroidPurchase(string ProductId, string CurrencyCode, int Quantity, double UnitPrice, string Receipt, string Signature)
{
BaseTenjin instance = Тендзин.getInstance("SDK_KEY");
instance.Transaction(ProductId, CurrencyCode, Quantity, UnitPrice, null, Receipt, Signature);
}
private static void CompletedIosPurchase(string ProductId, string CurrencyCode, int Quantity, double UnitPrice, string TransactionId, string Receipt)
{
BaseTenjin instance = Тендзин.getInstance("SDK_KEY");
instance.Transaction(ProductId, CurrencyCode, Quantity, UnitPrice, TransactionId, Receipt, null);
}
private static void CompletedAmazonPurchase(string ProductId, string CurrencyCode, int Quantity, double UnitPrice, string ReceiptId, string UserId)
{
BaseTenjin instance = Тендзин.getInstance("SDK_KEY");
instance.TransactionAndroid(ProductId, CurrencyCode, Quantity, UnitPrice, ReceiptId, UserId);
}Отказ от ответственности: Если вы впервые внедряете события покупки в Tenjin, обязательно проверьте данные с помощью других инструментов, которые вы используете, прежде чем начинать масштабировать кампании по привлечению пользователей с использованием данных о покупках.
(Flexible App Store Commission setup) Choose between 15% and 30% App Store’s revenue commission via our new setup. The steps are –
- Перейдите в раздел КОНФИГУРИРОВАНИЕ -> Приложения
- Нажмите на приложение, для которого вы хотите его изменить
- В разделе ‘Комиссия App Store’ нажмите ‘Изменить’.’
- Выберите 30% или 15% в качестве желаемой комиссии магазина приложений.
- Выберите дату начала и дату окончания (или вы можете оставить дату окончания пустой, если вам не нужна дата окончания).
- Нажмите кнопку Сохранить (примечание: комиссия 15% может применяться только к датам, перенесенным вперед, а не к историческим датам. Поэтому установите дату начала с даты внесения изменений и вперед)
Subscription IAP #
- You are responsible to send a subscription transaction one time during each subscription interval (i.e., For example, for a monthly subscription, you will need to send us 1 transaction per month). In the example timeline below, a transaction event should only be sent at the “First Charge” and “Renewal” events. During the trial period, do not send Tenjin the transaction event.
- Tenjin does not de-dupe duplicate transactions.
- If you have iOS subscription IAP, you will need to add your app’s public key in the Приборная панель Тендзина. You can retrieve your iOS App-Specific Shared Secret from the iTunes Connect Console \> Select your app \> Features \> In-App Purchases \> App-Specific Shared Secret.
- For more information on iOS subscriptions, please see: Apple documentation on Working with Subscriptions
- For more information on Android subscriptions, please see: Google Play Billing subscriptions documentation
Нестандартные события #
ВАЖНО: Ограничьте названия пользовательских событий до 80 символов. Не превышайте 500 уникальных названий пользовательских событий.
- Include the Assets folder in your Unity project
- In your projects’ method for the custom event, write the following for a named event:
Tenjin.getInstance("and the following for a named event with an integer value:").SendEvent("name") Tenjin.getInstance("").SendEvent("nameWithValue","value") - Make sure
значениеpassed is an integer value(“2000” for example, not “0.02”). Ifзначениеis not an integer value,значениеparameter will be omitted.
Here’s an example of the code:
void MethodWithCustomEvent(){
//event with name
BaseTenjin instance = Тендзин.getInstance ("SDK_KEY");
instance.SendEvent("имя");
//event with name and integer value
instance.SendEvent("nameWithValue", "значение");
}.SendEvent("name") is for events that are static markers or milestones. This would include things like tutorial_complete, registration, or level_1.
.SendEvent("name", "value") is for events that you want to do math on a property of that event. For example, ("coins_purchased", "100") will let you analyze a sum or average of the coins that are purchased for that event.
Интеграция между серверами #
Тендзин предлагает межсерверная интеграция. Это позволит вам отправлять события установки и после установки непосредственно с ваших серверов на серверы Tenjin без необходимости интеграции SDK. Если вы хотите получить доступ к документации, пожалуйста, отправьте письмо на support@tenjin.com.
Параметр App Subversion для A/B-тестирования (требуется DataVault) #
Если вы проводите A/B-тесты и хотите получить отчет о различиях, мы можем добавить числовое значение к версии вашего приложения, используя AppendAppSubversion() метод. Например, если версия вашего приложения 1.0.1, и установите AppendAppSubversion(8888), Он сообщит о версии приложения как 1.0.1.8888.
Эти данные появятся в DataVault, где вы сможете запускать отчеты, используя значения субверсии приложения.
BaseTenjin instance = Тендзин.getInstance(" ");
instance.AppendAppSubversion(8888);
instance.Connect();Кампании LiveOps #
Tenjin supports retrieving of user attribution information, like sourcing ad network and campaign, from the SDK. This will allow developers to collect and analyze user-level attribution data in real-time. Here are the possible use cases using Tenjin LiveOps Campaigns:
- Если у вас есть собственный инструмент анлитики данных, пользовательский обратный вызов позволит вам привязать данные атрибуции к вашим внутриигровым данным на уровне устройств.
- Показывайте разный контент приложения в зависимости от того, откуда пришел пользователь. Например, если пользователь А приписан к органической сети, а пользователь Б - к Facebook, и пользователь Б, скорее всего, будет более вовлечен в работу с вашим приложением, то вы хотите показать специальное предложение в игре после того, как пользователь установит приложение. Если вы хотите обсудить более конкретные сценарии использования, напишите на support@tenjin.com.
NOTE: LiveOps Campaigns is a paid feature, so please contact your Tenjin account manager if you would like to get access.
Идентификатор пользователя клиента #
Вы можете задавать и получать идентификатор пользователя клиента, чтобы отправлять его в качестве параметра в событиях.
.SetCustomerUserId("user_id")
.GetCustomerUserId()
BaseTenjin instance = Тендзин.getInstance(" ");
instance.SetCustomerUserId("user_id");
string userId = instance.GetCustomerUserId(); Идентификатор установки аналитики #
Вы можете получить идентификатор аналитика, который генерируется случайным образом и сохраняется в локальном хранилище устройства. GetAnalyticsInstallationId()
BaseTenjin instance = Тендзин.getInstance(" ");
analyticsId = instance.GetAnalyticsInstallationId; Retry/cache events #
Вы можете включить/выключить повторную попытку и кэширование всех событий при неудачных запросах или отсутствии интернет-соединения у пользователей. Эти события будут отправляться после того, как новое событие будет добавлено в очередь и пользователь восстановит соединение.
.SetCacheEventSetting(true)
BaseTenjin instance = Тендзин.getInstance(" ");
instance.SetCacheEventSetting(true); Параметры Google DMA #
Если у вас уже есть встроенный CMP, параметры Google DMA будут автоматически собраны Tenjin SDK. В Tenjin SDK ничего не нужно реализовывать, если у вас есть встроенный CMP.. Если вы хотите переопределить CMP или просто хотите создать собственные механизмы согласия, вы можете использовать следующее:
SetGoogleDMAParameters(bool, bool)
BaseTenjin instance = Тендзин.getInstance(" ");
instance.SetGoogleDMAParameters(adPersonalization, adUserData); To explicitly manage the collection of Google DMA parameters, you have the flexibility to opt in or opt out at any time. While the default setting is to opt in, you can easily adjust your preferences using the OptInGoogleDMA or OptOutGoogleDMA methods, ensuring full control over your data privacy settings:
instance.OptInGoogleDMA();
instance.OptOutGoogleDMA(); Интеграция доходов от рекламы на уровне впечатлений #
Tenjin поддерживает возможность интеграции с функцией Impression Level Ad Revenue (ILRD) из,
- AppLovin
- Unity LevelPlay
- ГиперБид
- AdMob
- TopOn
- CAS
- TradPlus
This feature allows you to receive events which correspond to your ad revenue which is affected by each advertisement shown to a user. To enable this feature, follow the below instructions.
NOTE: ILRD is a paid feature, so please contact your Tenjin account manager to discuss your pricing options before sending ILRD events.
Тестирование #
You can verify if the integration is working correctly with our Инструмент для получения данных об устройстве в режиме реального времени. Добавьте свой рекламный идентификатор или IDFA/GAID в список тестовых устройств. Это можно найти в разделе Поддержка -\> Тестовые устройства. Перейти к Страница SDK Live и отправьте тестовые события из вашего приложения. Вы должны увидеть, как приходят живые события:
[1]: https://github.com/tenjin/tenjin-ios-sdk [2]: https://github.com/tenjin/tenjin-android-sdk [3]: https://github.com/googlesamples/unity-jar-resolver [4]: #proguard [5]: #sdk-integration [6]: #google-play [7]: #amazon [8]: #oaid [9]: #msa-oaid [10]: #huawei-oaid [11]: #proguard [12]: #initialization [13]: #app-store [14]: #attrackingmanager-ios [15]: #displaying-an-att-permission-prompt [16]: #configuring-a-user-tracking-description [17]: #skadnetwork-and-conversion-values [18]: #skadnetwork-and-ios-15-advertiser-postbacks [19]: #gdpr [20]: #purchase-events [21]: #ios-iap-validation [22]: #android-iap-validation [23]: #custom-events [24]: #deferred-deeplinks [25]: #servertoserver-integration [26]: #app-subversion-parameter-for-ab-testing-requires-datavault [68]: #liveops-campaigns [69]: #customer-user-id [27]: #impression-level-ad-revenue-integration [28]: #testing [29]: https://github.com/tenjin/tenjin-unity-sdk-demo [30]: https://developer.apple.com/app-store/user-privacy-and-data-use/ [31]: https://developer.apple.com/documentation/storekit/skadnetwork/receiving_ad_attributions_and_postbacks [32]: https://developer.apple.com/documentation/storekit/skadnetwork/configuring_an_advertised_app [33]: https://docs.unity3d.com/Manual/iphone-GettingStarted.html [34]: https://developers.google.com/android/reference/com/google/android/gms/ads/identifier/AdvertisingIdClient.html#getAdvertisingIdInfo(android.content.Context) [35]: https://developer.apple.com/documentation/adsupport/asidentifiermanager/1614151-advertisingidentifier [36]: https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor [37]: http://www.msa-alliance.cn/col.jsp?id=120 [38]: https://developer.android.com/reference/android/telephony/TelephonyManager#getImei() [39]: https://developers.google.com/android/reference/com/google/android/gms/ads/identifier/AdvertisingIdClient.Info.html#isLimitAdTrackingEnabled() [40]: https://developer.apple.com/documentation/adsupport/asidentifiermanager/1614148-isadvertisingtrackingenabled [41]: https://developer.android.com/google/play/installreferrer/index.html [42]: https://searchads.apple.com/advanced/help/measure-results/#attribution-api [43]: https://developer.android.com/reference/android/os/Build.VERSION.html#SDK_INT [44]: https://developer.apple.com/documentation/uikit/uidevice/1620043-systemversion [45]: https://developer.android.com/reference/android/os/Build.html#DEVICE [46]: https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man3/sysctl.3.html [47]: https://developer.android.com/reference/android/os/Build.html#MANUFACTURER [48]: https://developer.android.com/reference/android/os/Build.html#MODEL [49]: https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man3/sysctl.3.html [50]: https://developer.android.com/reference/android/os/Build.html#BRAND [51]: https://developer.android.com/reference/android/os/Build.html#PRODUCT [52]: https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man3/sysctl.3.html [53]: https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man3/sysctl.3.html [54]: https://developer.android.com/reference/android/telephony/TelephonyManager.html#getSimOperatorName() [55]: https://developer.android.com/reference/android/net/ConnectivityManager.html#getActiveNetworkInfo() [56]: https://developer.android.com/reference/android/util/DisplayMetrics.html#widthPixels [57]: https://developer.android.com/reference/android/util/DisplayMetrics.html#heightPixels [58]: https://developer.android.com/reference/android/os/Build.VERSION.html#RELEASE [59]: https://developer.apple.com/documentation/uikit/uidevice/1620043-systemversion [60]: https://developer.android.com/reference/android/os/Build.html [61]: https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man3/sysctl.3.html [62]: https://developer.android.com/reference/java/util/Locale.html#getDefault() [63]: https://developer.apple.com/documentation/foundation/nslocalekey [64]: https://developer.android.com/reference/java/util/Locale.html#getDefault() [65]: https://developer.apple.com/documentation/foundation/nslocalecountrycode [66]: https://developer.android.com/reference/java/util/TimeZone.html [67]: https://developer.apple.com/documentation/foundation/nstimezone/1387209-localtimezone [70]: #retrycache-events [71]: #analytics-installation-id [73]: #opt-inout-using-cmp [74]: #google-dma-parameters [image-1]: https://s3.amazonaws.com/tenjin-instructions/sdk_live_purchase_events_2.png
