简体   繁体   English

Branch.io + Unity:如何设置 Apple Search Ads?

[英]Branch.io + Unity: How to setup Apple Search Ads?

I have been integrating the Branch SDK into my Unity iOS app and everything worked fine.我一直在将 Branch SDK 集成到我的 Unity iOS 应用程序中,并且一切正常。

Now I am having some issues having the analytics page include the Apple Search Ads.现在我在分析页面包含 Apple Search Ads 时遇到了一些问题。 I read the docs ( https://docs.branch.io/deep-linked-ads/apple-mobile-tracking/ ) but I couldn't find anything specifically for Unity.我阅读了文档( https://docs.branch.io/deep-linked-ads/apple-mobile-tracking/ )但我找不到任何专门针对 Unity 的内容。

I tried matching the suggested functions and here is all I could manage to "port":我尝试匹配建议的功能,这是我可以设法“移植”的全部内容:

using UnityEngine;

public class BranchManager : MonoBehaviour
{
    void Start()
    {
        Branch.delayInitToCheckForSearchAds();
        Branch.initSession(CallbackWithBranchUniversalObject);
    }

    void CallbackWithBranchUniversalObject(BranchUniversalObject buo, BranchLinkProperties linkProps, string error)
    {
        if (error != null)
        {
            System.Console.WriteLine("Error : " + error);
        }
        else if (linkProps.controlParams.Count > 0)
        {
            System.Console.WriteLine("Deeplink params : "
                                    + buo.ToJsonString()
                                    + linkProps.ToJsonString());
        }
    }

}

Is this enough to retrieve the Attribution properly?这足以正确检索归因吗?

Without the delayInitToCheckForSearchAds it didn't work, so I am not sure.没有delayInitToCheckForSearchAds它不起作用,所以我不确定。

Also, not sure if this matters, but I have already my own plugin natively handling the Apple Attribution (to track on MixPanel).另外,不确定这是否重要,但我已经有自己的插件本地处理 Apple Attribution(在 MixPanel 上跟踪)。

Thanks in advance for the help!在此先感谢您的帮助! :) :)

Joan from Branch here -来自 Branch 这里的 Joan -

You will need delayInitToCheckForSearchAds() because there needs to be a check for Apple search Ads prior to initialization .您将需要delayInitToCheckForSearchAds()因为需要在初始化之前检查 Apple 搜索广告。 Note that by making the attribution call it'll cause a 1 second delay (a little longer if Apple Search Ads fails to respond).请注意,通过进行归因调用,它会导致 1 秒延迟(如果 Apple Search Ads 无法响应,则延迟时间会更长一些)。

Also, it shouldn't matter that you have your own plugin.此外,您拥有自己的插件应该无关紧要。

Here is a link to our Github page that highlights more on the Apple Search Ads integration specific to unity: Branch SDK - Unity: Apple Search Ads这是我们 Github 页面的链接,其中重点介绍了特定于Unity的 Apple Search Ads 集成: Branch SDK - Unity:Apple Search Ads

Hope this helps希望这可以帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM