简体   繁体   English

Android SDK谷歌分析跟踪带有元数据的事件

[英]android sdk google analytics track events with metadata

in the link: https://developers.google.com/analytics/devguides/collection/android/v4/events 在链接中: https : //developers.google.com/analytics/devguides/collection/android/v4/events

google explains how to send events. 谷歌解释了如何发送事件。 However I didn't see any mention of a way to send events with extra pairs. 但是,我没有提到任何发送额外对事件的方法。 for example if I want to send an event of uploading images, and I would like to also send something like <"number_of_images_uploaded", 4> <"location_of_upload", "Italy"> <"was_registered_user", false> 例如,如果我想发送一个上传图像的事件,并且我还想发送类似<“ number_of_images_uploaded”,4> <“ location_of_upload”,“ Italy”> <“ was_registered_user”,false>

etc.. 等等..

is there a way to do this? 有没有办法做到这一点?

EDIT: Apparently you can do it with custom dimensions 编辑:显然,您可以使用自定义尺寸

https://developers.google.com/analytics/devguides/collection/android/v4/customdimsmets https://developers.google.com/analytics/devguides/collection/android/v4/customdimsmets

ORIGINAL ANSWER 原始答案

Can't do it. 做不到 The link you provided shows that you can only send events with categories, actions, labels, and values. 您提供的链接显示您只能发送带有类别,操作,标签和值的事件。

The only way to store this meta data in combination with google analytics is to do it yourself. 将此元数据与Google Analytics(分析)结合存储的唯一方法是自己进行操作。

eg 例如

  1. Send an HTTP request to your own server to create a record (or records) in a database with the meta information and return an identifier in the response. 向您自己的服务器发送HTTP请求,以使用元信息在数据库中创建一条或多条记录,并在响应中返回标识符。
  2. When you receive a response from the server, send the google analytics event information to google along with your event ID that you received from your server. 当您收到服务器的回复时,请将Google Analytics(分析)事件信息以及从服务器收到的事件ID一起发送给google。

This allows you to use google analytics for general user-interaction information and also allows you to link specific events in google analytics to their metadata on your server. 这样,您就可以将Google Analytics(分析)用于一般的用户互动信息,还可以将Google Analytics(分析)中的特定事件链接到服务器上的事件元数据。

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

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