本文介绍了创建一个 Google Analytics 视图过滤器,以排除缺少字段的匹配项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用 Google Analytics(分析)的移动 iOS 应用.

I have a mobile iOS app that uses Google Analytics.

最近,我在报告中收到了明显并非来自我的应用的点击.我想肯定有人在使用我的跟踪器 ID(我希望是错误的).

Recently I have been receiving hits in my reports that are clearly not coming from my app. I guess someone must be using my tracker ID (I hope, by mistake).

所以我一直在尝试创建一个不包含此流量的过滤视图.我的第一种方法是在 applicationID 字段上创建一个包含过滤器,希望可以过滤掉任何没有正确 applicationID 的命中.使用 Google Analytics iOS SDK 时,此字段始终设置为应用程序包标识符,因此其他人错误发送的命中具有正确值的可能性极小(如果不是不可能的话).

So I've been trying to create a filtered view that doesn't include this traffic. My first approach was to create an include filter on the applicationID field, hoping that would filter out any hit that doesn't have the right applicationID. When using the Google Analytics iOS SDK, this field is always set with the app bundle identifier, so it is highly improbable - if not impossible - that a hit sent by mistake by someone else will have the correct value.

它没有用,在想了几天之后,我才发现.有关视图过滤器的文档 (https://support.google.com/analytics/answer/1033162) 实际上是说:过滤器中指定的字段必须存在于命中中并且不能为空,以便过滤器应用于该命中".所以我不能对缺失的字段设置过滤器,这是一个问题,因为我收到的那些不需要的点击似乎所有字段都为空.

It didn't work, and after wondering why for days, I just found out. The document about view filters (https://support.google.com/analytics/answer/1033162) actually says : "Fields specified in a filter must exist in the hit and not be null in order for the filter to be applied to that hit". So I can't have filters on missing fields, which is a problem because those unwanted hits I'm receiving seems to have all of their fields empty.

这让我问:以前有人遇到过这个问题吗?如果是,您的方法是什么?

Which leads me to ask : Has anyone ever had this problem before ? And if yes, what is your approach ?

目前我正在使用一个未过滤的视图和一个自定义的段来完成工作(因为可以使用段来过滤空字段).但我想有一个过滤视图,我可以应用真实细分.

Currently I am using an unfiltered view with a custom segment that does the work (because the filtering of empty fields is doable using segments). But I would like to have a filtered view on which I could apply real segments.

感谢您的见解

推荐答案

我没有要测试的移动视图,但基于网络跟踪,以下似乎有效:

I don't have a mobile view to test with, but based on web tracking the following seems to work:

  • 创建新过滤器、自定义、高级
  • 字段 A:应用程序 ID
  • 提取 A : (.*)
  • 字段 B:留空
  • 输出到:自定义字段 1
  • 构造函数:$A1
  • 确保选中Field A required"和Override Output Field"

  • Create a new filter, custom, advanced
  • Field A : Application ID
  • Extract A : (.*)
  • Field B : leave empty
  • Output to : Custom field 1
  • Constructor : $A1
  • Make sure that "Field A required" and "Override Output Field" are checked

创建第二个过滤器,自定义,包括

Create a second filter, custom, include

似乎高级过滤器确实通过必填字段"设置识别字段是否为空.因此自定义字段仅在字段不为空时设置,随后您可以使用第二个过滤器仅包含设置了该字段的访问(从而排除了未设置该字段的点击)

It seems advanced filters do recognize if a field is empty via the "Field Required" setting. So the custom field is set only when the field is not empty, and you can subsequently use a second filter to include only visits that have the field set (thereby excluding hits that haven't the field set)

为了说明我不太聪明的指示,以下对我有用:

To illustrate my less than brilliant instructions, the following worked for me:

这篇关于创建一个 Google Analytics 视图过滤器,以排除缺少字段的匹配项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-01 12:01