本文介绍了如何在Android谷歌分析V4中获取clientId?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在Android中获取自动设置的Analytics clientId。 (设置它在Android API文档中解释为 setClientId() c $ c $)
$ b

当我尝试使用 tracker.get(clientId)时,它将返回空白。任何想法的人?



预先感谢!

解决方案

对于你来说,它似乎像clientId属性存储与键& cid。

在内部它做到这一点:

  set(& cid,clientId); 

解决方法是调用它:

  tracker.get( &安培; CID); 

get()方法对客户端ID键具有特殊逻辑。它可能还会返回一个新生成的键或抛出 InterruptedException ,如ClientId加载或生成中断或者 ExecutionException 无法加载或生成客户端ID



您可以在Android Studio(或IntelliJ IDEA)中通过安装Java Bytecode Decompiler或 Java反编译器IntelliJ插件插件。这允许您查找Tracker.class符号并将其视为Java常规文件。


I am trying to get the automatically set Analytics clientId in Android. (Setting it is explained in the Android API documentation as setClientId())

When I try to use tracker.get("clientId") it returns empty. Any idea anyone?

Thanks in advance!

解决方案

I've ran a decompiler on it for you and it seems like the clientId property is stored with the key "&cid".

Internally it does this:

set("&cid", clientId);

The solution would be to call this:

tracker.get("&cid");

The get() method does however have special logic for the client ID key. It might also return a newly generated key or throw an InterruptedException like "ClientId loading or generation was interrupted" or an ExecutionException "Failed to load or generate client id"

You can solve these kinds of issues yourself in Android Studio (or IntelliJ IDEA) by installing the "Java Bytecode Decompiler" or "Java Decompiler IntelliJ Plugin" plugins. This allows you to find the Tracker.class symbol and view it as if it was a Java regular file.

这篇关于如何在Android谷歌分析V4中获取clientId?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-12 12:41