Filter 如何在pagePath上的google analytics api中设置过滤器?

Filter 如何在pagePath上的google analytics api中设置过滤器?,filter,google-analytics,Filter,Google Analytics,因此,在使用api时,我通常会传递如下参数: 1.年月日 2.尺寸 3.韵律学 4.轮廓 示例调用包括以下内容,例如: (start_date=2015-05-31&end_date=2015-05-31&dimensions=ga:date,ga:pagePath&metrics=ga:pageviews,ga:uniquePageviews,ga:sessions,ga:users,ga:bounces,ga:exits,ga:pageValue&webpro

因此,在使用api时,我通常会传递如下参数: 1.年月日 2.尺寸 3.韵律学 4.轮廓

示例调用包括以下内容,例如:

(start_date=2015-05-31&end_date=2015-05-31&dimensions=ga:date,ga:pagePath&metrics=ga:pageviews,ga:uniquePageviews,ga:sessions,ga:users,ga:bounces,ga:exits,ga:pageValue&webproperty_id=&profile_id=95736296,6125383)
我想补充一点: 5.过滤器

这有一个问题

例如,如果您没有放置获得的任何筛选器,请放置以下两列:

profileName,URL,metri_value
Profile 1, www.whatever.uk/payment_paypal, 5
Profile 1, www.whatever.uk/paypal, 3
Profile 1, www.whatever.uk/payment_error, 2
Profile 1, www.whatever.uk/1232431234, 5
Profile 1, www.whatever.uk/paypal123, 10
Profile 1, www.whatever.uk/paypal77777, 12
Profile 1, www.whatever.uk/1232asdf431234, 12
Profile 1, www.whatever.uk/123243asdfa1234, 11
Profile 1, www.whatever.uk/12324vxc31234, 10
Profile 1, www.whatever.uk/123243asdf1234, 1
Profile 1, www.whatever.uk/123243asdfd1234, 1
Profile 1, www.whatever.uk/1232431asdf234, 1
Profile 1, www.whatever.uk/1232431asdf234,1
Profile 1, www.whatever.uk/12324dfas31234,1
现在,如果我只想得到包含“paypal”的行,我必须下载所有经常是大量的内容,然后扔掉其中的90%。在我的示例中,我需要去掉所有不包含PayPal的“fluff”URL

这是因为如果我在API查询中添加一个过滤器(例如ga:pagePath%3D@%/paypal*),我将得到以下结果: 简介1,贝宝,27岁

这27行将是包含“paypal”的所有行的总和

我要求的结果是:

Profile 1, www.whatever.uk/payment_paypal, 5
Profile 1, www.whatever.uk/paypal, 3
Profile 1, www.whatever.uk/paypal123, 10
Profile 1, www.whatever.uk/paypal77777, 12

有没有办法做到这一点?

您的示例表达式中似乎有一个额外的%符号。它实际上是ga:pagePath%3D@/paypal*

建议您使用regex match而不是Contains——Contains区分大小写

ga:pagePath%3D~/paypal

只要在查询中包含了ga_pagePath,每个匹配行就应该有一行