TalkingData游戏统计对接

1、注册并登录https://www.talkingdata.com/ ,选择Game Analytics产品线

2、创建应用并获取App ID

成功登录后您会进入服务中心页面,只需点击游戏运营分按钮,即可开通游戏运营分析的使用。完全免费

 

 

 如果已创建的应用,请从“游戏管理->基本信息”中查看App ID。

 

 

3、获取SDK

 邮箱收到后下载SDK

4、https://github.com/TalkingData/GameAnalytics_SDK_Unity下载集成文件

5、将下载的文件Assets文件夹放入Unity内

6、按照集成说明将对应文件放到位置

集成说明

  1. 下载本项目(封装层)到本地;
  2. 访问 TalkingData官网 下载最新版的 Android 和 iOS 平台 Game Analytics SDK( Native SDK)
    • 方法1:选择 Unity 平台进行功能定制;
    • 方法2:分别选择 Android 和 iOS 平台进行功能定制,请确保两个平台功能项一致;
  3. 将下载的最新版 Native SDK 复制到 封装层 中,构成完整的 Unity SDK。(邮箱发送的SDK)
    • Android 平台
      将最新的 .jar 文件复制到 Assets/Plugins/Android 目录下
    • iOS 平台
      将最新的 .h 和 .a 文件复制到 Assets/Plugins/iOS 目录下
  4. 按 Native SDK 功能选项对 封装层 代码进行必要的修改,详见“注意事项”第2条;
  5. 将 Unity SDK 集成您需要统计的工程中,并按 集成文档 进行必要配置和功能调用。

7、按照注意事项修改:有ios端将宏打开,在Unity中添加宏(安卓和Ios要分别添加)

注意事项

  1. 分别选择 Android 和 iOS 平台进行功能定制时,请确保两个平台功能项一致。

  2. 如果申请 Native SDK 时选择了可选功能,则需要在本项目中启用所选功能对应的封装层代码。
    a) 在 Assets/Plugins/iOS/TalkingDataGA.mm 文件中释放所选功能的宏定义。
    b) 在 Unity 中添加相应功能的宏定义
    打开 Build Settings,先在 Platform 中选择 Android 或 iOS 平台,再点击 Switch Platform。当切换完平台后,点击 Player Settings,然后在 Other Settings 的 Scripting Define Symbols 中输入所选功能相应的宏(如果有多个宏,需要用分号隔开;Android 和 iOS 需要分别添加)。

    各功能宏定义如下:

    功能宏定义
    自定义事件TDGA_CUSTOM
    推送营销TDGA_PUSH

 

8、按照文档添加对应代码

 SDK初始化:

    
TalkingDataGA.OnStart("A527A3A546F04615******", "TalkingData");// TalkingDataGA.OnStart("游戏ID", "渠道");

 设置唯一账户

TDGAProfile profile = TDGAProfile.SetProfile(TalkingDataGA.GetDeviceId());

自定义事件

自定义事件用于统计任何您期望去追踪的数据,如:点击某功能按钮、填写某个输入框、触发了某个广告等。

开发者可以自行定义eventId,在游戏中需要追踪的位置进行调用,注意eventId中仅限使用中英文字符、数字和下划线,不要加空格或其他的转义字符。

Dictionary<string, object> dic = new Dictionary<string, object>();
dic.Add("key", "value"); // 自定义参数
TalkingDataGA.OnEvent("事件ID", dic);

8、注意问题

获取sdk获取过来的是安卓的jdk和ios的.h和.mm文件需要到https://github.com/TalkingData/GameAnalytics_SDK_Unity下载assets文件拖入相应位置。

9:完成Demo:

	/// <summary>
	/// 初始化
	/// </summary>
    private void initSDK() {
        try
        {
			TalkingDataGA.BackgroundSessionEnabled();
			TalkingDataGA.OnStart("759999D967AE4B24AA4945B61A91710F", "TalkingData");
			string userId = TalkingDataGA.GetDeviceId();
			TDGAProfile profile = TDGAProfile.SetProfile("User" + userId);
		}
        catch (System.Exception e)
        {
			throw;
        }
	}

    /// <summary>
    /// 按钮点击分析广告数据
    /// </summary>
    /// <param name="value"></param>
    private void AnalyticsClickData(String value) {
        Dictionary<string, object> dic = new Dictionary<string, object>();
        dic.Add("type", value);
        TalkingDataGA.OnEvent("AdClickEvent", dic);
    }
    /// <summary>
    /// 广告奖励分析广告数据
    /// </summary>
    /// <param name="value"></param>
    private void AnalyticsRewardData(string value)
	{
		Dictionary<string, object> dic = new Dictionary<string, object>();
		dic.Add("type", value);
		TalkingDataGA.OnEvent("AdRewardEvent", dic);
	}

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 4
    评论
Hardcover: 800 pages Publisher: Springer; 2013 edition (March 31, 2013) Language: English ISBN-10: 1447147685 ISBN-13: 978-1447147688 Developing a successful game in today’s market is a challenging endeavor. Thousands of titles are published yearly, all competing for players’ time and attention. Game analytics has emerged in the past few years as one of the main resources for ensuring game quality, maximizing success, understanding player behavior and enhancing the quality of the player experience. It has led to a paradigm shift in the development and design strategies of digital games, bringing data-driven intelligence practices into the fray for informing decision making at operational, tactical and strategic levels. Game Analytics - Maximizing the Value of Player Data is the first book on the topic of game analytics; the process of discovering and communicating patterns in data towards evaluating and driving action, improving performance and solving problems in game development and game research. Written by over 50 international experts from industry and research, it covers a comprehensive range of topics across more than 30 chapters, providing an in-depth discussion of game analytics and its practical applications. Topics covered include monetization strategies, design of telemetry systems, analytics for iterative production, game data mining and big data in game development, spatial analytics, visualization and reporting of analysis, player behavior analysis, quantitative user testing and game user research. This state-of-the-art volume is an essential source of reference for game developers and researchers. Key takeaways include: Thorough introduction to game analytics; covering analytics applied to data on players, processes and performance throughout the game lifecycle. In-depth coverage and advice on setting up analytics systems and developing good practices for integrating analytics in game-development and -management. Contributions by leading researchers and experienced professionals from the industry, including Ubisoft, Sony, EA, Bioware, Square Enix, THQ, Volition, and PlayableGames. Interviews with experienced industry professionals on how they use analytics to create hit games
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值