好的,所以我尝试以编程的方式向google分析视图中添加过滤器。谷歌的指南指出:
本指南向您介绍如何插入过滤器。但是这个过滤器是在帐户级别创建的,然后您需要将它添加到特定的视图中。我怎样才能把它添加到视图中?
发布于 2015-03-31 21:34:06
您需要创建一个轮廓滤波链路
# Note: This code assumes you have an authorized Analytics service object.
# See the Filters Developer Guide for details.
# This request creates a new profile filter link.
try:
analytics.management().profileFilterLinks().insert(
accountId='123456',
webPropertyId='UA-123456-1',
profileId='7654321',
body={
'filterRef': {
'id': '1223334444'
}
}
).execute()
except TypeError, error:
# Handle errors in constructing a query.
print 'There was an error in constructing your query : %s' % error
except HttpError, error:
# Handle API errors.
print ('There was an API error : %s : %s' %
(error.resp.status, error.resp.reason))https://stackoverflow.com/questions/29311518
复制相似问题