简体   繁体   English

如何使用Google Analytics(分析)和Parse.IO跟踪用户?

[英]How can I track a user with Google Analytics and Parse.IO?

I'm trying to find out how I can track users in Google Analytics and Parse through some sort of ID that I can use both on GA and Parse. 我正在尝试找出如何在Google Analytics(分析)和Parse中通过可以同时在GA和Parse上使用的某种ID来跟踪用户的方法。 For example: In my Parse browser I can go to the Users table and see users that register every day on my app. 例如:在我的Parse浏览器中,我可以转到“用户”表,查看每天在我的应用程序中注册的用户。 Each user is assigned an ObjectID in Parse. 为每个用户分配一个Parse中的ObjectID。 I would like to use this objectID and match the user with its Behavior analytic in GA. 我想使用此objectID并将用户与其在GA中的“行为分析”相匹配。 Is ObjectID the way to do this? 是ObjectID做到这一点的方法吗? Can I use GA's Client Id to find a user in Parse? 我可以使用GA的客户ID在Parse中查找用户吗? Is there a better method for this? 有更好的方法吗?

My purpose for doing this is that I want to be able to look up a user in my Parse browser, look at his/her ClientID so I can then track that user's behavior with GA'S behavior analytics. 我这样做的目的是希望能够在Parse浏览器中查找用户,查看其ClientID,以便随后可以通过GA的行为分析来跟踪该用户的行为。

I think the best is to use objectId because it's unique identifier and this is exactly what you need. 我认为最好是使用objectId,因为它是唯一的标识符,而这正是您所需要的。 If you want you can also create your own unique id and store in an additional field of the user but I don't see any reason to do it. 如果您愿意,也可以创建自己的唯一ID,并将其存储在用户的其他字段中,但我看不出有任何理由。 ObjectId can give you what you need and also it's good because you can do quick query from parse DB since it is a unique index ObjectId可以为您提供所需的信息,这也很好,因为它是唯一索引,因此您可以从解析数据库中进行快速查询

To store your GA Client ID in parse please use the following code: 要在解析中存储您的GA客户ID,请使用以下代码:

Android version Android版

    ParseUser currentUser = ParseUser.getCurrentUser();
    currentUser.put("GAClientId","{YOUR_GA_CLIENT_ID}");
    currentUser.saveInBackground(new SaveCallback() {
        @Override
        public void done(ParseException e) {

        }
    });

IOS Swift version iOS Swift版本

    let user = PFUser.currentUser()
    user?.setObject("{YOUR_GA_CLIENT_ID}", forKey: "GAClientId")
    user?.saveInBackgroundWithBlock({ (succeeded: Bool, error: NSError?) -> Void in

    })

JavaScript Version JavaScript版本

var user = Parse.User.current();
user.set("GAClientID","{YOUR_GA_CLIENT_ID}");
user.save().then(function(){
    // success callback
},function(err){
    // error callback
});

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

相关问题 如何按用户ID跟踪应用:Google Analytics - How to track app by user id : Google Analytics 如何使用Google Analytics for Android跟踪用户首选项? - How to track user preferences with Google Analytics for Android? 我们可以使用Google Analytics(分析)跟踪用户在应用程序上花费了多少时间 - Can we track using google analytics, how much time user spending in application 我可以使用什么分析服务来跟踪用户的偏好? - What analytics service can I use to track user preferences? 我应该如何跟踪Google Analytics v4中的碎片? - How should I track Fragments in Google Analytics v4? 我们可以使用 Google Analytics 跟踪单个用户的屏幕信息吗? - Can we track individual user's screen info using Google Analytics? 如何在Android的Google Analytics(分析)v4中跟踪设备等用户的习惯属性? - How to track cusom property of user like device in Google Analytics v4 for Android? 如何在Android中使用Google Analytics(分析)跟踪Webview内容? - How to track webview content with Google Analytics in android? 跟踪视图 Google Analytics - Track view Google Analytics 跟踪用户花费的时间,通过Google Analytics(分析)成功注册 - Track Time spent by an user,Successful Registration by Google Analytics
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM