首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何在google分析视图中添加一个过滤器?

如何在google分析视图中添加一个过滤器?
EN

Stack Overflow用户
提问于 2015-03-27 22:57:52
回答 1查看 208关注 0票数 1

好的,所以我尝试以编程的方式向google分析视图中添加过滤器。谷歌的指南指出:

https://developers.google.com/analytics/devguides/config/mgmt/v3/mgmtReference/management/filters/insert#examples

本指南向您介绍如何插入过滤器。但是这个过滤器是在帐户级别创建的,然后您需要将它添加到特定的视图中。我怎样才能把它添加到视图中?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-03-31 21:34:06

您需要创建一个轮廓滤波链路

代码语言:javascript
运行
复制
# 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))
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/29311518

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档